|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.core.impl.DemonstratorImpl
Manages the demonstration of a project. Therefore, it runs an extra thread that moves the messages and calls the methods of active nodes in an 'endless' loop. Registers itself as a PropertyListener with each node and connection to be able to react to changes of the 'working' property.
Constructor Summary | |
DemonstratorImpl(Project project,
GraphicsControl graphicsControl)
Constructor |
Method Summary | |
void |
addActiveMessage(Message message)
Adds a message to the active messages. |
void |
addActiveNode(Node node)
Adds a node to the active nodes. |
Message |
createMessage(Node sender,
Node receiver,
Object payload)
Creates a new message. |
void |
endPause()
Continues the demonstration. |
Statistics |
getCurrentStatistics()
Returns up-to-date statistics about the demo. |
boolean |
isPaused()
Returns whether the demo is paused. |
boolean |
isRunning()
Returns whether the demo is running (and not paused). |
boolean |
isStopped()
Returns whether the demo is stopped. |
void |
pause()
Pauses the demonstration. |
void |
pauseActiveNode(Node node,
long timeInMillis)
Removes a node from the active nodes for a certain time. |
void |
propertyAdded(PropertyEvent pe)
Called whenever a property is added to the PropertyHolder. |
void |
propertyChanged(PropertyEvent pe)
Called whenever a property of the PropertyHolder is changed. |
void |
propertyRemoved(PropertyEvent pe)
Called whenever a property is removed from the PropertyHolder. |
void |
removeActiveNode(Node node)
Removes a node from the active nodes. |
void |
reset()
Resets the demonstrator for a new run. |
void |
run()
Runs the demonstration. |
void |
start()
Starts the demonstration thread. |
void |
stop()
Stops the demonstration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DemonstratorImpl(Project project, GraphicsControl graphicsControl)
project
- the project that is demonstratedgraphicsControl
- the graphics controlling objectMethod Detail |
public void reset()
public void start()
public void pause()
public void endPause()
public void stop()
public boolean isStopped()
Demonstrator
isStopped
in interface Demonstrator
public boolean isPaused()
Demonstrator
isPaused
in interface Demonstrator
public boolean isRunning()
Demonstrator
isRunning
in interface Demonstrator
public void run()
run
in interface Runnable
Runnable.run()
public void addActiveNode(Node node)
Demonstrator
addActiveNode
in interface Demonstrator
node
- the nodepublic void removeActiveNode(Node node)
Demonstrator
removeActiveNode
in interface Demonstrator
node
- the nodepublic void addActiveMessage(Message message)
Demonstrator
addActiveMessage
in interface Demonstrator
message
- the messagepublic void pauseActiveNode(Node node, long timeInMillis)
Demonstrator
pauseActiveNode
in interface Demonstrator
node
- the nodetimeInMillis
- time in milliseconds after which the node will be
activatedpublic Message createMessage(Node sender, Node receiver, Object payload)
Demonstrator
createMessage
in interface Demonstrator
sender
- the node that sends the messagereceiver
- the node that shall receive the messagepayload
- possible payload that the message carries
public Statistics getCurrentStatistics()
Demonstrator
getCurrentStatistics
in interface Demonstrator
public void propertyChanged(PropertyEvent pe)
PropertyListener
propertyChanged
in interface PropertyListener
pe
- the PropertyEventpublic void propertyAdded(PropertyEvent pe)
PropertyListener
propertyAdded
in interface PropertyListener
pe
- the PropertyEventpublic void propertyRemoved(PropertyEvent pe)
PropertyListener
propertyRemoved
in interface PropertyListener
pe
- the PropertyEvent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |