Package adams.flow.core
Class PauseStateManager
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.flow.core.PauseStateManager
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
public class PauseStateManager extends LoggingObject
Manages the pause state in the flow.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected HashSet<FlowPauseStateListener>
m_Listeners
the listeners.protected boolean
m_Paused
whether the state is paused.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description PauseStateManager()
Initializes the handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(FlowPauseStateListener l)
Adds the specified listener.boolean
isPaused()
Returns whether the handler is in paused state.protected void
notifyListeners(FlowPauseStateEvent e)
Notifies all listeners.void
pause(Actor source)
Pauses the flow.void
removeListener(FlowPauseStateListener l)
Removes the specified listener.void
resume(Actor source)
Resumes the flow.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Listeners
protected HashSet<FlowPauseStateListener> m_Listeners
the listeners.
-
m_Paused
protected boolean m_Paused
whether the state is paused.
-
-
Method Detail
-
addListener
public void addListener(FlowPauseStateListener l)
Adds the specified listener.- Parameters:
l
- the listener to add
-
removeListener
public void removeListener(FlowPauseStateListener l)
Removes the specified listener.- Parameters:
l
- the listener to remove
-
notifyListeners
protected void notifyListeners(FlowPauseStateEvent e)
Notifies all listeners.- Parameters:
e
- the event to send
-
pause
public void pause(Actor source)
Pauses the flow.- Parameters:
source
- the flow that triggers the pausing
-
resume
public void resume(Actor source)
Resumes the flow.- Parameters:
source
- the flow that triggers the resuming
-
isPaused
public boolean isPaused()
Returns whether the handler is in paused state.- Returns:
- true if in paused state
-
-