|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.dacopan.animseq.AnimationSequence
public class AnimationSequence
A class to handle the logic of the animation sequence (also called scenario play list). This class encapsulates the list itself and all direct references to list items. This class provides functionality for recording items, deleting items, playing the list in sequential order and for navigating the list by showing each individual item item upon request.
The play list consists of specific item. Each item is either showable or non-showable. Non-showable items are some kind of markers, and selecting them from the list causes no actions. The end marker at the end of the list is one such marker. All showable items, when selected, cause the UI of the application to present some type of visualisation.
Inserting or recording new items to the list is possible when the recording mode is on. In that case some user actions (such as pressing play, changing the layer, or showing the encapsulation for a unit) are automatically interpreted (by MainFrame) as recording actions. Other recording actions are manually initiated by selecting buttons in the ScenarioEditorPanel. New items are always inserted in the insertion positions (in the place of the current item) in the list. At any time, at most one 'unfinished' item may exist in the list. An unfinished item is an MSC item with the start time recorded but the end time missing. In cases of new recording actions while there still is an unfinished item, the AnimationSequence tries to finish the unfinished item by recording the 'now time' as the end time for the unfinished item.
The actions of scenario play list are closely related to the scenario ScenarioEditorDialog. Such a dialog should always be is existence. The dialog can be hidden, but never closed and disposed of.
Some methods in this class are purposefully package private, so that they can only be called by classes in the same package. This is done to enforce encapsulation of the logic inside this package.
Constructor Summary | |
---|---|
AnimationSequence(MainFrame frame)
Creates a new instance of AnimationSequence |
Method Summary | |
---|---|
java.lang.Object |
getData()
Returns the list data for saving in a scenario file. |
java.lang.String[] |
getPlaylist()
Returns the visible data for the scenario play list. |
boolean |
hasShowables()
Returns true if animation sequence contains showable items (items that will set MainFrame to some state) and false otherwise. |
boolean |
isActive()
Returns true if the scenario dialog is visible, false otherwise. |
boolean |
isInRecordingMode()
Returns true if AnimationSequence is in recording mode, false otherwise. |
boolean |
layerChanged()
This method should be called from MainFrame whenever the user tries to change layer. |
void |
notifyExitFromEnc()
The MainFrame should call this method when quitting the enc mode. |
void |
recordEnc(TransferUnit unit)
Instructs the AnimationSequence to record a new ENC item in the current insertion position. |
void |
recordStartMSC(SettingsMSC settings,
float startTime)
Should be called when the start time for a new MSC item should be recorded. |
void |
refreshRecordingButtons()
|
void |
refreshWindow()
Completely re-creates the scenario window with all its contents. |
void |
setActive(boolean isScenarioModeActive)
Either shows the scenario play list dialog or hides it. |
void |
setData(java.lang.Object o)
Initialises the state of the AnimationTimeState and replaces the old play list with the new list given as parameter. |
boolean |
showFirstShowable()
Shows the first showable item. |
void |
showNext()
Moves to the next item in play list and executes the action associated with it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnimationSequence(MainFrame frame)
Method Detail |
---|
public void showNext()
playNext
- If true, the AnimationTimeState is set to play mode after executing the
action within the item.public void setActive(boolean isScenarioModeActive)
isScenarioModeActive
- If true, the dialog is shown, if false, the dialog is hidden.public void notifyExitFromEnc()
public java.lang.String[] getPlaylist()
public void recordStartMSC(SettingsMSC settings, float startTime)
settings
- The settings for the new item.startTime
- The start time for the new item.public void recordEnc(TransferUnit unit)
unit
- The selected unit in the enc diagram.public java.lang.Object getData()
getData
in interface Saveable
public void setData(java.lang.Object o)
setData
in interface Saveable
o
- New scenario list, as loaded from a scenario file.public boolean hasShowables()
public boolean showFirstShowable()
public void refreshWindow()
public void refreshRecordingButtons()
public boolean isActive()
public boolean isInRecordingMode()
public boolean layerChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |