Package jmri.jmrit.operations.automation
Class AutomationItem
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.jmrit.operations.automation.AutomationItem
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
public class AutomationItem extends PropertyChangeSupport implements java.beans.PropertyChangeListener
Represents one automation item of a automation
-
-
Field Summary
Fields Modifier and Type Field Description protected Action
_action
protected boolean
_actionRan
protected boolean
_actionRunning
protected boolean
_actionSuccessful
protected java.lang.String
_automationIdToRun
protected boolean
_gotoAutomationBranched
protected java.lang.String
_gotoAutomationItemId
protected boolean
_haltFail
protected java.lang.String
_id
protected java.lang.String
_message
protected java.lang.String
_messageFail
protected RouteLocation
_routeLocation
protected int
_sequenceId
protected Train
_train
protected java.lang.String
_trainScheduleId
static java.lang.String
DISPOSE
static java.lang.String
NONE
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description AutomationItem(java.lang.String id)
AutomationItem(org.jdom2.Element e)
Construct this Entry from XML.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyItem(AutomationItem item)
Copies item.void
dispose()
void
doAction()
Action
getAction()
static Action
getActionByCode(int code)
int
getActionCode()
static javax.swing.JComboBox<Action>
getActionComboBox()
static java.util.List<Action>
getActionList()
Gets a list of all known automation actionsjava.lang.String
getActionName()
Automation
getAutomationToRun()
The automation for actions, not the automation associated with this item.AutomationItem
getGotoAutomationItem()
The automationItem for actions not this item.java.lang.String
getId()
java.lang.String
getMessage()
java.lang.String
getMessageFail()
RouteLocation
getRouteLocation()
int
getSequenceId()
java.lang.String
getStatus()
Train
getTrain()
TrainSchedule
getTrainSchedule()
java.lang.String
getTrainScheduleId()
boolean
isActionRan()
boolean
isActionRunning()
boolean
isActionSuccessful()
boolean
isGotoBranched()
boolean
isHaltFailureEnabled()
void
propertyChange(java.beans.PropertyChangeEvent e)
void
reset()
void
setAction(Action action)
void
setActionRan(boolean ran)
void
setActionRunning(boolean actionRunning)
void
setActionSuccessful(boolean successful)
void
setAutomationToRun(Automation automation)
The automation for actions, not the automation associated with this item.protected void
setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
void
setGotoAutomationItem(AutomationItem automationItem)
The automation for action GOTO, not this automation item.void
setGotoBranched(boolean branched)
void
setHaltFailureEnabled(boolean enable)
void
setMessage(java.lang.String message)
void
setMessageFail(java.lang.String message)
void
setOther(java.lang.Object other)
void
setRouteLocation(RouteLocation rl)
void
setSequenceId(int sequence)
void
setTrain(Train train)
void
setTrainSchedule(TrainSchedule trainSchedule)
org.jdom2.Element
store()
Create an XML element to represent this Entry.java.lang.String
toString()
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
NONE
public static final java.lang.String NONE
- See Also:
- Constant Field Values
-
_id
protected java.lang.String _id
-
_sequenceId
protected int _sequenceId
-
_actionRunning
protected boolean _actionRunning
-
_actionSuccessful
protected boolean _actionSuccessful
-
_actionRan
protected boolean _actionRan
-
_haltFail
protected boolean _haltFail
-
_message
protected java.lang.String _message
-
_messageFail
protected java.lang.String _messageFail
-
_routeLocation
protected RouteLocation _routeLocation
-
_automationIdToRun
protected java.lang.String _automationIdToRun
-
_gotoAutomationItemId
protected java.lang.String _gotoAutomationItemId
-
_gotoAutomationBranched
protected boolean _gotoAutomationBranched
-
_trainScheduleId
protected java.lang.String _trainScheduleId
-
DISPOSE
public static final java.lang.String DISPOSE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AutomationItem
public AutomationItem(java.lang.String id)
-
AutomationItem
public AutomationItem(org.jdom2.Element e)
Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in operations-trains.xml- Parameters:
e
- Consist XML element
-
-
Method Detail
-
getId
public java.lang.String getId()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSequenceId
public int getSequenceId()
-
setSequenceId
public void setSequenceId(int sequence)
-
getActionName
public java.lang.String getActionName()
-
getActionCode
public int getActionCode()
-
doAction
public void doAction()
-
setRouteLocation
public void setRouteLocation(RouteLocation rl)
-
getRouteLocation
public RouteLocation getRouteLocation()
-
setOther
public void setOther(java.lang.Object other)
-
setAutomationToRun
public void setAutomationToRun(Automation automation)
The automation for actions, not the automation associated with this item.- Parameters:
automation
- the automation to run
-
getAutomationToRun
public Automation getAutomationToRun()
The automation for actions, not the automation associated with this item.- Returns:
- Automation for this action
-
setGotoAutomationItem
public void setGotoAutomationItem(AutomationItem automationItem)
The automation for action GOTO, not this automation item.- Parameters:
automationItem
- which automation item to GOTO
-
getGotoAutomationItem
public AutomationItem getGotoAutomationItem()
The automationItem for actions not this item.- Returns:
- AutomationItem for GOTO
-
setGotoBranched
public void setGotoBranched(boolean branched)
-
isGotoBranched
public boolean isGotoBranched()
-
setTrainSchedule
public void setTrainSchedule(TrainSchedule trainSchedule)
-
getTrainSchedule
public TrainSchedule getTrainSchedule()
-
getTrainScheduleId
public java.lang.String getTrainScheduleId()
-
setMessage
public void setMessage(java.lang.String message)
-
getMessage
public java.lang.String getMessage()
-
setMessageFail
public void setMessageFail(java.lang.String message)
-
getMessageFail
public java.lang.String getMessageFail()
-
isHaltFailureEnabled
public boolean isHaltFailureEnabled()
-
setHaltFailureEnabled
public void setHaltFailureEnabled(boolean enable)
-
setActionRunning
public void setActionRunning(boolean actionRunning)
-
isActionRunning
public boolean isActionRunning()
-
setActionSuccessful
public void setActionSuccessful(boolean successful)
-
setActionRan
public void setActionRan(boolean ran)
-
isActionRan
public boolean isActionRan()
-
isActionSuccessful
public boolean isActionSuccessful()
-
getStatus
public java.lang.String getStatus()
-
reset
public void reset()
-
copyItem
public void copyItem(AutomationItem item)
Copies item.- Parameters:
item
- The item to copy.
-
getActionByCode
public static Action getActionByCode(int code)
-
getActionList
public static java.util.List<Action> getActionList()
Gets a list of all known automation actions- Returns:
- list of automation actions
-
getActionComboBox
public static javax.swing.JComboBox<Action> getActionComboBox()
-
dispose
public void dispose()
-
store
public org.jdom2.Element store()
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-trains.dtd.- Returns:
- Contents in a JDOM Element
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
setDirtyAndFirePropertyChange
protected void setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
-
-