Class Action
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.automation.actions.Action
- All Implemented Interfaces:
PropertyChangeFirer,PropertyChangeProvider
- Direct Known Subclasses:
ActivateTrainScheduleAction,ApplyTrainScheduleAction,BuildTrainAction,BuildTrainIfSelectedAction,CounterAction,DeselectTrainAction,GenerateSwitchListChangesAction,GotoAction,HaltAction,IsTrainEnRouteAction,MessageYesNoAction,MoveTrainAction,NoAction,PrintSwitchListChangesAction,PrintTrainBuildReportAction,PrintTrainManifestAction,PrintTrainManifestIfSelectedAction,ResetSwitchListsAction,ResetTrainAction,RunAutomationAction,RunSwitchListChangesAction,RunTrainAction,SelectTrainAction,TerminateTrainAction,UpdateSwitchListAction,WaitSwitchListAction,WaitTrainAction,WaitTrainTerminatedAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AutomationItemstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidabstract voiddoAction()intfinishAction(boolean success) Completes the action by displaying the correct message if there's one.intfinishAction(boolean success, Object[] buttons) Completes the action by displaying the correct message if there's one.abstract intgetCode()protected intgetCode(int code) Mask off menu bits.JComboBox<?>getFormatedMessage(String message) Formats a message using fixed arguments in the following order:abstract StringgetName()booleanbooleanUsed to determine if this action can run concurrently with other actions.booleanbooleanbooleanbooleanbooleanintsendMessage(String message, Object[] buttons, boolean success) Displays message if there's one.voidvoidsetRunning(boolean running) toString()For combo boxes.Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
ACTION_COMPLETE_CHANGED_PROPERTY
- See Also:
-
ACTION_HALT_CHANGED_PROPERTY
- See Also:
-
ACTION_RUNNING_CHANGED_PROPERTY
- See Also:
-
ACTION_GOTO_CHANGED_PROPERTY
- See Also:
-
HALT
- See Also:
-
OKAY
- See Also:
-
CLOSED
- See Also:
-
NO_MESSAGE_SENT
- See Also:
-
FINISH_FAILED
- See Also:
-
_automationItem
-
-
Constructor Details
-
Action
public Action()
-
-
Method Details
-
getCode
-
getName
-
doAction
-
cancelAction
-
toString
For combo boxes. -
getCode
Mask off menu bits.- Parameters:
code- the integer to be modified by masking off menu bits.- Returns:
- code and ActionCodes.CODE_MASK
-
isTrainMenuEnabled
-
isRouteMenuEnabled
-
isMessageOkEnabled
-
isMessageFailEnabled
-
isAutomationMenuEnabled
-
isGotoMenuEnabled
-
isConcurrentAction
Used to determine if this action can run concurrently with other actions.- Returns:
- true if a concurrent action
-
setAutomationItem
-
getAutomationItem
-
getActionString
-
getStatus
-
getActionSuccessfulString
-
getActionFailedString
-
setRunning
-
finishAction
Completes the action by displaying the correct message if there's one. Will halt if the option to halt the automation is enabled or the user requested the automation to halt.- Parameters:
success- true if action succeeded- Returns:
- OKAY, HALT, CLOSED, NO_MESSAGE_SENT, FINISH_FAILED
-
finishAction
Completes the action by displaying the correct message if there's one. Will halt if the option to halt the automation is enabled or the user requested the automation to halt.- Parameters:
success- true if action succeededbuttons- buttons to display in message- Returns:
- OKAY, HALT, CLOSED, NO_MESSAGE_SENT, FINISH_FAILED
-
sendMessage
Displays message if there's one.- Parameters:
buttons- the buttons to display, if success and two or more buttons, the second button becomes the defaultsuccess- true if action succeededmessage- the text to be displayed- Returns:
- array number for which button was pressed, NO_MESSAGE_SENT, CLOSED
-
getFormatedMessage
Formats a message using fixed arguments in the following order:action name, train name, route location name, automation name, goto item id, train schedule day.
- Parameters:
message- the string to be formated- Returns:
- formated message
-
getComboBox
-