Package jmri.jmrit.beantable
Class LRouteTableAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.beantable.AbstractTableAction<Logix>
-
- jmri.jmrit.beantable.LRouteTableAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class LRouteTableAction extends AbstractTableAction<Logix>
Swing action to create and register groups of Logix Condtionals to perform a railroad control task.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
LRouteTableAction.AlignElement
(package private) class
LRouteTableAction.AlignmentModel
Table model for selecting output variablesclass
LRouteTableAction.ComboBoxCellEditor
(package private) class
LRouteTableAction.LBeanTableDataModel
(package private) static class
LRouteTableAction.RouteElement
Base class for all the output (ConditionalAction) and input (ConditionalVariable) elementsstatic class
LRouteTableAction.RouteElementComparator
Sorts RouteElementclass
LRouteTableAction.RouteElementModel
Base Table model for selecting Route elements(package private) class
LRouteTableAction.RouteInputElement
(package private) class
LRouteTableAction.RouteInputLight
(package private) class
LRouteTableAction.RouteInputModel
Table model for selecting input variables(package private) class
LRouteTableAction.RouteInputSensor
(package private) class
LRouteTableAction.RouteInputSignal
(package private) class
LRouteTableAction.RouteInputTurnout
(package private) class
LRouteTableAction.RouteOutputElement
(package private) class
LRouteTableAction.RouteOutputLight
(package private) class
LRouteTableAction.RouteOutputModel
Table model for selecting output variables(package private) class
LRouteTableAction.RouteOutputSensor
(package private) class
LRouteTableAction.RouteOutputSignal
(package private) class
LRouteTableAction.RouteOutputTurnout
-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.AbstractTableAction
AbstractTableAction.TableItem<E extends NamedBean>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) JmriJFrame
_addFrame
(package private) javax.swing.JRadioButton
_alignAllButton
(package private) javax.swing.JComboBox<java.lang.String>
_alignCombo
(package private) java.util.ArrayList<LRouteTableAction.AlignElement>
_alignList
(package private) LRouteTableAction.AlignmentModel
_alignModel
(package private) ConditionalManager
_conditionalManager
(package private) boolean
_initialize
(package private) javax.swing.JRadioButton
_initializeButton
(package private) javax.swing.JRadioButton
_inputAllButton
(package private) java.util.ArrayList<LRouteTableAction.RouteInputElement>
_inputList
(package private) LRouteTableAction.RouteInputModel
_inputModel
(package private) javax.swing.JScrollPane
_inputScrollPane
(package private) boolean
_lock
(package private) javax.swing.JCheckBox
_lockCheckBox
(package private) LogixManager
_logixManager
(package private) javax.swing.JRadioButton
_newRouteButton
(package private) boolean
_newRouteType
(package private) javax.swing.JRadioButton
_outputAllButton
(package private) java.util.ArrayList<LRouteTableAction.RouteOutputElement>
_outputList
(package private) LRouteTableAction.RouteOutputModel
_outputModel
(package private) javax.swing.JScrollPane
_outputScrollPane
(package private) javax.swing.JComboBox<java.lang.String>
_setStateCombo
(package private) boolean
_showAllAlign
(package private) boolean
_showAllInput
(package private) boolean
_showAllOutput
(package private) javax.swing.JTextField
_systemName
(package private) javax.swing.JTabbedPane
_tabbedPane
(package private) javax.swing.JComboBox<java.lang.String>
_testStateCombo
(package private) javax.swing.JPanel
_typePanel
(package private) javax.swing.JTextField
_userName
static int
ALL_TYPE
(package private) javax.swing.JButton
cancelButton
static int
CLEAR_SIGNAL_HELD
static int
CONDITIONAL_TYPE
static java.lang.String
CONDITIONAL_USER_PREFIX
(package private) javax.swing.JButton
createButton
(package private) javax.swing.JButton
deleteButton
static int
LIGHT_TYPE
static int
OFFSET
(package private) static java.util.ResourceBundle
rbx
(package private) boolean
routeDirty
(package private) ScriptFileChooser
scriptChooser
(package private) javax.swing.JTextField
scriptFile
static int
SENSOR_TYPE
static int
SET_SIGNAL_DARK
static int
SET_SIGNAL_HELD
static int
SET_SIGNAL_LIT
static int
SIGNAL_TYPE
(package private) javax.swing.JFileChooser
soundChooser
(package private) javax.swing.JTextField
soundFile
static int
TURNOUT_TYPE
(package private) javax.swing.JButton
updateButton
static int
VETO
-
Fields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, m
-
-
Constructor Summary
Constructors Constructor Description LRouteTableAction()
LRouteTableAction(java.lang.String s)
Create an action with a specific title.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPressed(java.awt.event.ActionEvent e)
(package private) void
buildLists()
(package private) void
cancelIncludedOnly()
Cancels included only option(package private) void
cancelPressed(java.awt.event.ActionEvent e)
Responds to the Cancel button.(package private) Logix
checkNamesOK()
(package private) boolean
checkNewNamesOK()
(package private) void
clearPage()
(package private) java.util.ArrayList<ConditionalAction>
cloneActionList(java.util.ArrayList<ConditionalAction> actionList, int option)
protected void
createModel()
Create the JTable DataModel, along with the changes for the specific case of Road Conditionals.(package private) void
createPressed(java.awt.event.ActionEvent e)
Responds to the Add Route button.(package private) void
deletePressed(java.awt.event.ActionEvent e)
Responds to the Delete button.(package private) void
editPressed(java.lang.String sName)
Edit button in Logix Route table pressed.(package private) void
finishUpdate()
(package private) void
getAlignmentSensors(java.lang.String cSysName)
Extract the Alignment Sensors and their types.java.lang.String
getClassDescription()
protected java.lang.String
getClassName()
(package private) void
getControlsAndActions(java.lang.String cSysName)
Extract the Control (input) and Action (output) elements and their states.(package private) void
getLockConditions(java.lang.String cSysName)
Extract the Lock expression.static java.lang.String
getLogixInitializer()
(package private) char
getRouteConditionalType(java.lang.String logixSysName, java.lang.String cSysName)
Get the type letter from the possible LRoute conditional.(package private) void
handleCreateException(java.lang.String sysName)
protected java.lang.String
helpTarget()
Specify the JavaHelp target for this specific panel.(package private) void
initializeIncludedAlignList()
Initialize list of included alignment sensors(package private) void
initializeIncludedInputList()
Initialize list of included input elements(package private) void
initializeIncludedOutputList()
Initialize list of included input elements(package private) int
makeAlignConditional(int numConds, java.util.ArrayList<ConditionalAction> actionList, java.util.ArrayList<ConditionalVariable> triggerList, Logix logix, java.lang.String sName, java.lang.String uName)
Create a new alignment conditional.(package private) javax.swing.JScrollPane
makeColumns(javax.swing.JTable table, javax.swing.JComboBox<java.lang.String> box, boolean specialBox)
(package private) void
makeEditWindow()
Set up Create/Edit LRoute pane(package private) int
makeRouteConditional(int numConds, java.util.ArrayList<ConditionalAction> actionList, java.util.ArrayList<ConditionalVariable> triggerList, java.util.ArrayList<ConditionalVariable> vetoList, Logix logix, java.lang.String sName, java.lang.String uName, java.lang.String type)
Create a new Route conditional.(package private) javax.swing.JPanel
makeShowButtons(javax.swing.JRadioButton allButton, javax.swing.JRadioButton includeButton, javax.swing.JRadioButton extraButton, java.lang.String msg)
(package private) java.util.ArrayList<LRouteTableAction.RouteOutputElement>
makeTurnoutLockList()
(package private) boolean
removeConditionals(java.lang.String cSystemName, Logix logix)
void
setMessagePreferencesDetails()
(package private) void
setScriptPressed()
Set the script file(package private) void
setSoundPressed()
Set the sound fileprotected void
setTitle()
Include the correct title.(package private) void
setupEdit(java.awt.event.ActionEvent e)
Interprets the conditionals from the Logix that was selected for editing and attempts to reconstruct the window entries.(package private) void
showMessage(java.lang.String msg)
(package private) void
showReminderMessage()
(package private) void
updatePressed()
Update the Route Table.-
Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addBottomButtons, addToFrame, addToFrame, addToPanel, columnsVisibleUpdated, configureManagerComboBox, configureTable, displayHwError, dispose, getDataModel, getFrame, getManager, getPanel, getTableDataModel, includeAddButton, nextName, print, removePrefixBoxListener, setFrame, setManager, setMenuBar
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
rbx
static final java.util.ResourceBundle rbx
-
_conditionalManager
ConditionalManager _conditionalManager
-
_logixManager
LogixManager _logixManager
-
_systemName
javax.swing.JTextField _systemName
-
_userName
javax.swing.JTextField _userName
-
_addFrame
JmriJFrame _addFrame
-
_tabbedPane
javax.swing.JTabbedPane _tabbedPane
-
_inputModel
LRouteTableAction.RouteInputModel _inputModel
-
_inputScrollPane
javax.swing.JScrollPane _inputScrollPane
-
_testStateCombo
javax.swing.JComboBox<java.lang.String> _testStateCombo
-
_inputAllButton
javax.swing.JRadioButton _inputAllButton
-
_showAllInput
boolean _showAllInput
-
_outputModel
LRouteTableAction.RouteOutputModel _outputModel
-
_outputScrollPane
javax.swing.JScrollPane _outputScrollPane
-
_setStateCombo
javax.swing.JComboBox<java.lang.String> _setStateCombo
-
_outputAllButton
javax.swing.JRadioButton _outputAllButton
-
_showAllOutput
boolean _showAllOutput
-
_alignModel
LRouteTableAction.AlignmentModel _alignModel
-
_alignCombo
javax.swing.JComboBox<java.lang.String> _alignCombo
-
_alignAllButton
javax.swing.JRadioButton _alignAllButton
-
_showAllAlign
boolean _showAllAlign
-
_lockCheckBox
javax.swing.JCheckBox _lockCheckBox
-
_lock
boolean _lock
-
_typePanel
javax.swing.JPanel _typePanel
-
_newRouteButton
javax.swing.JRadioButton _newRouteButton
-
_newRouteType
boolean _newRouteType
-
_initializeButton
javax.swing.JRadioButton _initializeButton
-
_initialize
boolean _initialize
-
soundFile
javax.swing.JTextField soundFile
-
scriptFile
javax.swing.JTextField scriptFile
-
cancelButton
javax.swing.JButton cancelButton
-
createButton
javax.swing.JButton createButton
-
deleteButton
javax.swing.JButton deleteButton
-
updateButton
javax.swing.JButton updateButton
-
routeDirty
boolean routeDirty
-
_inputList
java.util.ArrayList<LRouteTableAction.RouteInputElement> _inputList
-
_outputList
java.util.ArrayList<LRouteTableAction.RouteOutputElement> _outputList
-
_alignList
java.util.ArrayList<LRouteTableAction.AlignElement> _alignList
-
soundChooser
javax.swing.JFileChooser soundChooser
-
scriptChooser
ScriptFileChooser scriptChooser
-
CONDITIONAL_USER_PREFIX
public static final java.lang.String CONDITIONAL_USER_PREFIX
- See Also:
- Constant Field Values
-
SENSOR_TYPE
public static final int SENSOR_TYPE
- See Also:
- Constant Field Values
-
TURNOUT_TYPE
public static final int TURNOUT_TYPE
- See Also:
- Constant Field Values
-
LIGHT_TYPE
public static final int LIGHT_TYPE
- See Also:
- Constant Field Values
-
SIGNAL_TYPE
public static final int SIGNAL_TYPE
- See Also:
- Constant Field Values
-
CONDITIONAL_TYPE
public static final int CONDITIONAL_TYPE
- See Also:
- Constant Field Values
-
ALL_TYPE
public static final int ALL_TYPE
- See Also:
- Constant Field Values
-
VETO
public static final int VETO
- See Also:
- Constant Field Values
-
OFFSET
public static final int OFFSET
- See Also:
- Constant Field Values
-
SET_SIGNAL_HELD
public static final int SET_SIGNAL_HELD
- See Also:
- Constant Field Values
-
CLEAR_SIGNAL_HELD
public static final int CLEAR_SIGNAL_HELD
- See Also:
- Constant Field Values
-
SET_SIGNAL_DARK
public static final int SET_SIGNAL_DARK
- See Also:
- Constant Field Values
-
SET_SIGNAL_LIT
public static final int SET_SIGNAL_LIT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LRouteTableAction
public LRouteTableAction(java.lang.String s)
Create an action with a specific title.Note that the argument is the Action title, not the title of the resulting frame. Perhaps this should be changed?
- Parameters:
s
- title of the action
-
LRouteTableAction
public LRouteTableAction()
-
-
Method Detail
-
createModel
protected void createModel()
Create the JTable DataModel, along with the changes for the specific case of Road Conditionals.- Specified by:
createModel
in classAbstractTableAction<Logix>
-
setTitle
protected void setTitle()
Description copied from class:AbstractTableAction
Include the correct title.- Specified by:
setTitle
in classAbstractTableAction<Logix>
-
helpTarget
protected java.lang.String helpTarget()
Description copied from class:AbstractTableAction
Specify the JavaHelp target for this specific panel.- Overrides:
helpTarget
in classAbstractTableAction<Logix>
- Returns:
- a fixed default string "index" pointing to to highest level in JMRI Help
-
buildLists
void buildLists()
-
editPressed
void editPressed(java.lang.String sName)
Edit button in Logix Route table pressed.- Parameters:
sName
- system name of Logix to edit
-
setupEdit
void setupEdit(java.awt.event.ActionEvent e)
Interprets the conditionals from the Logix that was selected for editing and attempts to reconstruct the window entries.- Parameters:
e
- the action event
-
getRouteConditionalType
char getRouteConditionalType(java.lang.String logixSysName, java.lang.String cSysName)
Get the type letter from the possible LRoute conditional.- Parameters:
logixSysName
- logix system namecSysName
- conditional system name- Returns:
- the type letter
-
getControlsAndActions
void getControlsAndActions(java.lang.String cSysName)
Extract the Control (input) and Action (output) elements and their states.- Parameters:
cSysName
- the conditional system name
-
getAlignmentSensors
void getAlignmentSensors(java.lang.String cSysName)
Extract the Alignment Sensors and their types.- Parameters:
cSysName
- the conditional system name
-
getLockConditions
void getLockConditions(java.lang.String cSysName)
Extract the Lock expression. For now, same as action control expression.- Parameters:
cSysName
- the conditional system name
-
cancelPressed
void cancelPressed(java.awt.event.ActionEvent e)
Responds to the Cancel button.- Parameters:
e
- the action event
-
addPressed
protected void addPressed(java.awt.event.ActionEvent e)
- Specified by:
addPressed
in classAbstractTableAction<Logix>
-
makeEditWindow
void makeEditWindow()
Set up Create/Edit LRoute pane
-
showReminderMessage
void showReminderMessage()
-
makeShowButtons
javax.swing.JPanel makeShowButtons(javax.swing.JRadioButton allButton, javax.swing.JRadioButton includeButton, javax.swing.JRadioButton extraButton, java.lang.String msg)
-
makeColumns
javax.swing.JScrollPane makeColumns(javax.swing.JTable table, javax.swing.JComboBox<java.lang.String> box, boolean specialBox)
-
initializeIncludedInputList
void initializeIncludedInputList()
Initialize list of included input elements
-
initializeIncludedOutputList
void initializeIncludedOutputList()
Initialize list of included input elements
-
initializeIncludedAlignList
void initializeIncludedAlignList()
Initialize list of included alignment sensors
-
makeTurnoutLockList
java.util.ArrayList<LRouteTableAction.RouteOutputElement> makeTurnoutLockList()
-
showMessage
void showMessage(java.lang.String msg)
-
checkNewNamesOK
boolean checkNewNamesOK()
-
checkNamesOK
Logix checkNamesOK()
-
setSoundPressed
void setSoundPressed()
Set the sound file
-
setScriptPressed
void setScriptPressed()
Set the script file
-
createPressed
void createPressed(java.awt.event.ActionEvent e)
Responds to the Add Route button.- Parameters:
e
- the action event
-
deletePressed
void deletePressed(java.awt.event.ActionEvent e)
Responds to the Delete button.- Parameters:
e
- the action event
-
updatePressed
void updatePressed()
Update the Route Table.
-
removeConditionals
boolean removeConditionals(java.lang.String cSystemName, Logix logix)
-
makeRouteConditional
int makeRouteConditional(int numConds, java.util.ArrayList<ConditionalAction> actionList, java.util.ArrayList<ConditionalVariable> triggerList, java.util.ArrayList<ConditionalVariable> vetoList, Logix logix, java.lang.String sName, java.lang.String uName, java.lang.String type)
Create a new Route conditional.- Parameters:
numConds
- number of existing route conditionalsactionList
- actions to take in conditionaltriggerList
- triggers for conditional to take actionsvetoList
- controls that veto taking actionslogix
- Logix to add the conditional tosName
- system name for conditionaluName
- user name for conditionaltype
- type of conditional- Returns:
- number of conditionals after the creation
- Throws:
java.lang.IllegalArgumentException
- if "user input no good"
-
handleCreateException
void handleCreateException(java.lang.String sysName)
-
makeAlignConditional
int makeAlignConditional(int numConds, java.util.ArrayList<ConditionalAction> actionList, java.util.ArrayList<ConditionalVariable> triggerList, Logix logix, java.lang.String sName, java.lang.String uName)
Create a new alignment conditional.- Parameters:
numConds
- number of existing route conditionalsactionList
- actions to take in conditionaltriggerList
- triggers for conditional to take actionslogix
- Logix to add the conditional tosName
- system name for conditionaluName
- user name for conditional- Returns:
- number of conditionals after the creation
- Throws:
java.lang.IllegalArgumentException
- if "user input no good"
-
cloneActionList
java.util.ArrayList<ConditionalAction> cloneActionList(java.util.ArrayList<ConditionalAction> actionList, int option)
-
finishUpdate
void finishUpdate()
-
clearPage
void clearPage()
-
cancelIncludedOnly
void cancelIncludedOnly()
Cancels included only option
-
getLogixInitializer
public static java.lang.String getLogixInitializer()
-
setMessagePreferencesDetails
public void setMessagePreferencesDetails()
- Overrides:
setMessagePreferencesDetails
in classAbstractTableAction<Logix>
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassName
in classAbstractTableAction<Logix>
-
getClassDescription
public java.lang.String getClassDescription()
- Overrides:
getClassDescription
in classAbstractTableAction<Logix>
-
-