|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
fi.helsinki.dacopan.ui.MainFrame
public class MainFrame
MainFrame controls the program execution.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
DACOPAN_EXPLORE_MODE
|
static java.lang.String |
DACOPAN_EXTENSION_PEF
|
static java.lang.String |
DACOPAN_EXTENSION_SCENARIO
|
static int |
DACOPAN_NO_MODE
|
static int |
DACOPAN_SCENARIO_MODE
|
static int |
DACOPAN_STEP_BACKWARD
|
static int |
DACOPAN_STEP_FORWARD
|
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
MainFrame()
This is the normal constructor that just creates the MainFrame and sets up the animator, and then waits for the user to do something. |
|
MainFrame(DataView data,
NoteManager noteManager)
This constructor can be used in testing the animator, as it works with a given dataview as if a PEF had already been loaded in the memory. |
Method Summary | |
---|---|
void |
advance(float step,
float nowTime)
Signals the listener that it should visualise the network exchange data at the nowTime point in time,
possibly as an incremental change to previous state. |
protected void |
applyDefaultSettings(GeneralSettings generalSettings)
Creates default GeneralSettings and MSC settings for all layers based on the data that is currently in DataView. |
void |
changeLayer(Layer layer)
Changes the layer to the one requested. |
void |
closeAnimation()
Closes the animation and returns to the start state |
void |
continueAnimationModeMSC()
When the animation comes back from the ENC mode we need to handle that event in different ways depending on the animator mode: in explore mode we just continue from where we paused the animation when going to ENC. |
void |
fastForwardAnimation()
Fast forwards the animation to the end. |
AnimationTimeState |
getAnimationTimeState()
|
TransferUnit |
getCurrentENCUnit()
Returns the current enc unit if in ENC mode. |
Layer |
getCurrentLayer()
Return a reference to the layer currently visible in MSC/UFO/ENC |
SettingsMSC |
getCurrentMSCSettings()
|
DataView |
getDataView()
Returns a reference to the data view so that for example the animation panels can use the data. |
FileInformation |
getFileInformation()
|
int |
getMode()
|
MSCPanel |
getMSCPanel()
|
NoteManager |
getNoteManager()
Returns the current instance of the NoteManager being used to store the notes of the currently loaded scenario |
GeneralSettings |
getSettings()
Returns a reference to the general settings for the animator. |
void |
invokeChangeSettings()
|
boolean |
isAnimationSequenceDialogActive()
|
boolean |
isInENCMode()
|
boolean |
isInExploreMode()
|
boolean |
isInMSCMode()
|
boolean |
isInPlayMode()
|
boolean |
isInScenarioMode()
|
boolean |
isInTSCMode()
|
boolean |
isPaused()
|
boolean |
isTSCEnabled()
|
void |
loadAllSettings(GeneralSettings generalSettings)
Loads and applies the global settings stored in a global settings file in the user's home directory. |
void |
loadAnimationFile(java.io.File file)
Loads an animation file to the animator. |
static void |
main(java.lang.String[] args)
Creates the MainFrame object and shows it - and so it starts running :) |
void |
pauseAnimation()
Pauses the animation |
void |
playAnimation()
Starts or resumes the animation. |
void |
recreateUI()
|
void |
refreshScenarioSettings()
|
void |
refreshSettings()
Refreshes the MSC mode with updated settings from animatorSettings. |
void |
refreshUI()
|
void |
rewindAnimation()
Rewinds the animation to the beginning |
void |
saveAllSettings()
Saves the global settings in a global settings file in the user's home directory |
void |
saveAnimationFile(boolean forceFileChooser)
Saves the scenario that is currently in memory. |
void |
setAnimatorMode(int mode)
Sets the animation mode to the given mode: DACOPAN_SCENARIO_MODE : Scenario
DACOPAN_EXPLORE_MODE : Explore mode
|
void |
setFileModified(boolean value)
|
void |
setSettings(GeneralSettings generalSettings)
|
void |
setupAnimationModeENC(TransferUnit unit)
Sets up the ENC animation mode. |
void |
setupAnimationModeMSC(SettingsMSC mscSettings,
boolean resetNowTime)
This method sets up the MSC animation mode by creating the needed animation panels and giving them correct settings. |
void |
setupAnimationModeTSC()
|
void |
showScenarioDialog()
|
void |
stepInAnimation(int stepDirection)
Steps in the animation. |
void |
stepTo(float nowTime)
Signals the listener that it should visualise the network exchange data at the nowTime point in time. |
void |
toPauseMode()
Signals the listener that the animation has moved to PAUSE mode. |
void |
toPlayMode()
Signals the listener that the animation has moved to PLAY mode. |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public static final java.lang.String DACOPAN_EXTENSION_PEF
public static final java.lang.String DACOPAN_EXTENSION_SCENARIO
public static final int DACOPAN_STEP_BACKWARD
public static final int DACOPAN_STEP_FORWARD
public static final int DACOPAN_NO_MODE
public static final int DACOPAN_EXPLORE_MODE
public static final int DACOPAN_SCENARIO_MODE
Constructor Detail |
---|
public MainFrame(DataView data, NoteManager noteManager)
public MainFrame()
Method Detail |
---|
public void playAnimation()
We just call animationTimeState to continue playing the MSC settings it has been set up to show.
public void pauseAnimation()
public void rewindAnimation()
public void fastForwardAnimation()
public void stepInAnimation(int stepDirection)
stepDirection
- The direction for steppingpublic boolean isInPlayMode()
public void setAnimatorMode(int mode) throws java.lang.IllegalArgumentException
DACOPAN_SCENARIO_MODE
: ScenarioDACOPAN_EXPLORE_MODE
: Explore mode
mode
-
java.lang.IllegalArgumentException
public void loadAnimationFile(java.io.File file)
file
- The file to be loadedpublic void saveAnimationFile(boolean forceFileChooser)
public void setFileModified(boolean value)
public void closeAnimation()
public void changeLayer(Layer layer) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
layer
-
java.lang.IllegalStateException
java.lang.IllegalArgumentException
public void refreshSettings()
public void refreshScenarioSettings()
public DataView getDataView()
public Layer getCurrentLayer()
public NoteManager getNoteManager()
public FileInformation getFileInformation()
public GeneralSettings getSettings()
public void setSettings(GeneralSettings generalSettings)
public AnimationTimeState getAnimationTimeState()
public MSCPanel getMSCPanel()
public boolean isInExploreMode()
public boolean isInScenarioMode()
public boolean isInMSCMode()
public boolean isInENCMode()
public boolean isInTSCMode()
public TransferUnit getCurrentENCUnit() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public void setupAnimationModeMSC(SettingsMSC mscSettings, boolean resetNowTime)
mscSettings
- Settings for the MSC animationpublic void setupAnimationModeTSC()
public void continueAnimationModeMSC()
public void setupAnimationModeENC(TransferUnit unit)
unit
- public void saveAllSettings()
public void loadAllSettings(GeneralSettings generalSettings)
generalSettings
- The settings object for which the settings are
loaded (can be other than the settings currently in use).protected void applyDefaultSettings(GeneralSettings generalSettings)
public static void main(java.lang.String[] args)
args
- public void advance(float step, float nowTime)
ControlSignalsListener
nowTime
point in time,
possibly as an incremental change to previous state. The
change is given as step
parameter.
The listener is free to implement the advance
signal as if it was the same thing as receiving a stepTo
signal.
It is the responsibility of the listening object to call
repaint()
on itself as a result of receiving
this signal.
advance
in interface ControlSignalsListener
step
- The incremental time step from the previous state.nowTime
- The point of time in network exchange data
the listener should visualize.public void stepTo(float nowTime)
ControlSignalsListener
nowTime
point in time.
It is the responsibility of the listening object to call
repaint()
on itself as a result of receiving
this signal.
stepTo
in interface ControlSignalsListener
nowTime
- The point of time in network exchange data
the listener should visualize.public void toPauseMode()
ControlSignalsListener
toPauseMode
in interface ControlSignalsListener
public void toPlayMode()
ControlSignalsListener
toPlayMode
in interface ControlSignalsListener
public boolean isPaused()
public SettingsMSC getCurrentMSCSettings()
public int getMode()
public void invokeChangeSettings()
public boolean isAnimationSequenceDialogActive()
public void showScenarioDialog()
public boolean isTSCEnabled()
public void refreshUI()
public void recreateUI()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |