Class ConditionalTreeEdit
- java.lang.Object
-
- jmri.jmrit.conditional.ConditionalEditBase
-
- jmri.jmrit.conditional.ConditionalTreeEdit
-
public class ConditionalTreeEdit extends ConditionalEditBase
A tree based editor for maintaining Logix Conditionals, State Variables and Actions.The tree has 3 levels. The first level are the conditionals contained in the selected Logix. The second level contains the antecedent, logic type and trigger mode settings. The third level contains the detail Variable and Action lines.
Compare with the other Conditional Edit tool
ConditionalListEdit
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
ConditionalTreeEdit.ActionTypeListener
Listener for _actionTypeBox.(package private) static class
ConditionalTreeEdit.ConditionalTreeNode
Conditional Tree Node Definition.-
Nested classes/interfaces inherited from class jmri.jmrit.conditional.ConditionalEditBase
ConditionalEditBase.LogixEventListener, ConditionalEditBase.NameBoxListener, ConditionalEditBase.PickSingleListener, ConditionalEditBase.SelectionMode
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ConditionalTreeEdit.ConditionalTreeNode
_actHead
(package private) javax.swing.JComboBox<java.lang.String>
_actionBox
(package private) javax.swing.JLabel
_actionBoxLabel
(package private) javax.swing.JComboBox<Conditional.ItemType>
_actionItemBox
(package private) javax.swing.JLabel
_actionLabel
(package private) java.util.List<ConditionalAction>
_actionList
(package private) javax.swing.JTextField
_actionNameField
(package private) javax.swing.JLabel
_actionNameLabel
(package private) javax.swing.JComboBox<java.lang.String>
_actionOptionBox
(package private) javax.swing.JButton
_actionSetButton
(package private) javax.swing.JLabel
_actionsLabel
(package private) javax.swing.JComboBox<Conditional.Action>
_actionTypeBox
(package private) javax.swing.JLabel
_actionTypeLabel
(package private) ConditionalTreeEdit.ActionTypeListener
_actionTypeListener
(package private) ConditionalTreeEdit.ConditionalTreeNode
_actNode
(package private) javax.swing.JPanel
_addButtonPanel
(package private) java.lang.String
_antecedent
(package private) javax.swing.JLabel
_antecedentLabel
(package private) javax.swing.JButton
_cancelAction
(package private) javax.swing.event.TreeSelectionListener
_cdlListener
(package private) javax.swing.tree.DefaultTreeModel
_cdlModel
(package private) ConditionalTreeEdit.ConditionalTreeNode
_cdlNode
(package private) javax.swing.tree.DefaultMutableTreeNode
_cdlRoot
(package private) javax.swing.JTree
_cdlTree
(package private) javax.swing.JPanel
_checkButtonPanel
(package private) NamedBeanComboBox<?>
_comboNameBox
(package private) javax.swing.JLabel
_conditionalLabel
(package private) ConditionalAction
_curAction
(package private) Conditional.ItemType
_curActionItem
(package private) Conditional
_curConditional
(package private) java.lang.String
_curConditionalName
(package private) javax.swing.JPanel
_curDetailPanel
(package private) ConditionalTreeEdit.ConditionalTreeNode
_curNode
(package private) java.lang.String
_curNodeName
(package private) int
_curNodeRow
(package private) java.lang.String
_curNodeText
(package private) java.lang.String
_curNodeType
(package private) javax.swing.tree.TreePath
_curTreePath
(package private) ConditionalVariable
_curVariable
(package private) Conditional.ItemType
_curVariableItem
(package private) javax.swing.JPanel
_deleteButtonPanel
(package private) javax.swing.JPanel
_detailFooter
(package private) javax.swing.JPanel
_detailGrid
(package private) boolean
_editActive
(package private) javax.swing.JTextField
_editAntecedent
(package private) javax.swing.JTextField
_editConditionalUserName
(package private) javax.swing.JTextField
_editLogixUserName
(package private) javax.swing.JComboBox<Conditional.AntecedentOperator>
_editOperatorMode
(package private) javax.swing.JPanel
_gridPanel
(package private) javax.swing.JPanel
_helpButtonPanel
(package private) javax.swing.JPanel
_labelPanel
(package private) ConditionalTreeEdit.ConditionalTreeNode
_leafNode
(package private) javax.swing.JPanel
_leftButtonBar
(package private) Conditional.AntecedentOperator
_logicType
(package private) javax.swing.JLabel
_logicTypeLabel
(package private) javax.swing.JLabel
_longActionLabel
(package private) javax.swing.JTextField
_longActionString
(package private) javax.swing.JPanel
_moveButtonPanel
(package private) boolean
_newActionItem
(package private) boolean
_newVariableItem
(package private) java.util.TreeSet<java.lang.String>
_oldTargetNames
(package private) java.lang.String
_pickCommand
(package private) Conditional.ItemType
_pickItem
(package private) javax.swing.JComboBox<java.lang.String>
_selectConditionalBox
(package private) java.util.ArrayList<java.lang.String>
_selectConditionalList
(package private) javax.swing.JComboBox<java.lang.String>
_selectLogixBox
(package private) java.util.TreeMap<java.lang.String,java.lang.String>
_selectLogixMap
(package private) javax.swing.JLabel
_shortActionLabel
(package private) javax.swing.JTextField
_shortActionString
(package private) javax.swing.JPanel
_toggleButtonPanel
(package private) boolean
_triggerMode
(package private) javax.swing.JLabel
_triggerModeLabel
(package private) javax.swing.JButton
_updateAction
(package private) ConditionalTreeEdit.ConditionalTreeNode
_varHead
(package private) javax.swing.JComboBox<java.lang.String>
_variableCompareOpBox
(package private) javax.swing.JComboBox<Conditional.Type>
_variableCompareTypeBox
(package private) javax.swing.JTextField
_variableData1Field
(package private) javax.swing.JTextField
_variableData2Field
(package private) javax.swing.JComboBox<Conditional.ItemType>
_variableItemBox
(package private) javax.swing.JLabel
_variableLabel
(package private) java.util.List<ConditionalVariable>
_variableList
(package private) javax.swing.JLabel
_variableMemoryValueLabel
(package private) javax.swing.JTextField
_variableNameField
(package private) javax.swing.JLabel
_variableNameLabel
(package private) javax.swing.JCheckBox
_variableNegated
(package private) javax.swing.JComboBox<java.lang.String>
_variableOperBox
(package private) javax.swing.JComboBox<java.lang.String>
_variableSignalBox
(package private) javax.swing.JLabel
_variablesLabel
(package private) javax.swing.JComboBox<Conditional.Type>
_variableStateBox
(package private) javax.swing.JCheckBox
_variableTriggerActions
(package private) ConditionalTreeEdit.ConditionalTreeNode
_varNode
(package private) java.awt.event.ActionListener
actionSignalHeadNameListener
(package private) java.awt.event.ActionListener
actionSignalMastNameListener
(package private) java.awt.event.ActionListener
compareTypeBoxListener
(package private) javax.swing.JFileChooser
defaultFileChooser
(package private) java.awt.event.FocusListener
detailFocusEvent
Focus gained implies intent to make changes, set up for edit.(package private) ScriptFileChooser
scriptFileChooser
(package private) java.awt.event.ActionListener
selectConditionalBoxListener
(package private) java.awt.event.ActionListener
selectLogixBoxListener
(package private) javax.swing.JFileChooser
sndFileChooser
(package private) java.awt.event.ActionListener
variableSignalHeadNameListener
(package private) java.awt.event.ActionListener
variableSignalMastNameListener
(package private) java.awt.event.ActionListener
variableSignalTestStateListener
-
Fields inherited from class jmri.jmrit.conditional.ConditionalEditBase
_conditionalManager, _curLogix, _editLogixFrame, _inEditMode, _logixManager, _pickListener, _pickSingleFrame, _pickTable, _pickTables, _pickTabPane, _selectionMode, _showReminder, _suppressIndirectRef, _suppressReminder, listenerList, logixData
-
-
Constructor Summary
Constructors Constructor Description ConditionalTreeEdit()
ConditionalTreeEdit(java.lang.String sName)
Create a new Conditional Tree View editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
actionItemChanged(Conditional.ItemType type)
Respond to a change in an Action Type comboBox.(package private) void
addPressed()
Add new items: Conditionals, Variables or Actions.(package private) void
antecedentChanged(java.lang.String antecedentText)
Update the antecedent.(package private) void
appendToAntecedent()
Add a R# to the antecedent statement.(package private) void
buildActionComponents()
Called once during class initialization to define the GUI objects.(package private) void
buildConditionalComponents()
Initialize conditional components.(package private) javax.swing.JTree
buildConditionalTree()
Create the conditional tree structure using the current Logix.(package private) java.lang.String
buildNodeText(java.lang.String nodeType, java.lang.Object component, int idx)
Create the localized node text display strings based on node type.(package private) void
buildVariableComponents()
Called once during class initialization to define the GUI objects.(package private) void
cancelEditAction()
Respond to Cancel action button and window closer of the Edit Action window.(package private) void
cancelEditVariable()
Respond to Cancel variable button(package private) void
cancelPressed()
Cancel the current node edit.(package private) boolean
checkIsAction(java.lang.String name, Conditional.ItemType itemType)
Check that a state variable is not also used as an action(package private) boolean
checkIsVariable(java.lang.String name, Conditional.ItemType itemType)
Check that an action is not also used as a state variable(package private) void
checkPressed()
Refresh the Conditional or Variable state.(package private) void
cleanUpAction()
Clean up Update and Delete Action buttons.(package private) void
cleanUpVariable()
Clean up: Cancel, Update and Delete Variable buttons.(package private) void
createConditionalContent()
Create the tree content.(package private) void
deletePressed()
Process the node delete request.(package private) void
donePressed()
Clean up, notify the parent Logix that edit session is done.(package private) void
doPickList()
Create a Variable or Action based tabbed PickList with appropriate tab selected.(package private) void
doPickSingle()
Create a Variable or Action based single pane PickList.(package private) void
downPressed()
Move a conditional, variable or action row down 1 row.(package private) void
editPressed()
Set up the edit environment for the selected node Called fromtreeRowSelected(jmri.jmrit.conditional.ConditionalTreeEdit.ConditionalTreeNode)
.protected java.lang.String
getClassName()
(package private) void
helpPressed()
Respond to Help button press in the Edit Logix menu bar.(package private) void
initializeActionVariables()
Set display to show current action (curAction) parameters.(package private) void
initializeStateVariables()
Set display to show current state variable (curVariable) parameters.(package private) void
loadJComboBoxWithHeadAppearances(javax.swing.JComboBox<java.lang.String> box, java.lang.String signalHeadName)
Fetch valid localized appearances for a given Signal Head.(package private) void
loadJComboBoxWithMastAspects(javax.swing.JComboBox<java.lang.String> box, java.lang.String mastName)
Fetch valid aspects for a given Signal Mast.(package private) void
loadSelectConditionalBox(java.lang.String logixName)
Load the Conditional selection box.(package private) void
loadSelectLogixBox()
Load the Logix selection box.(package private) void
logicTypeChanged(Conditional.AntecedentOperator newType)
Respond to a change of Logic Type in the dialog window by showing/hiding the _antecedentPanel when Mixed is selected.(package private) void
makeAntecedent()
Build the antecedent statement.(package private) void
makeAntecedentGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Antecedent when the Logic Type is Mixed.(package private) void
makeChangeTriggerActionGrid(java.awt.GridBagConstraints c)
Add the change/trigger box the grid.(package private) void
makeConditionalGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Conditional User Name.(package private) void
makeConditionalVariableGrid(java.awt.GridBagConstraints c)
Create the Logix and Conditional rows and the State row.(package private) void
makeDetailGrid(java.lang.String gridType)
Build new GridBag content.(package private) void
makeEditLogixWindow()
Create the edit logix window.(package private) void
makeEmptyActionGrid(java.awt.GridBagConstraints c)
Create a one row grid with just the Action Item box.(package private) void
makeEmptyGrid(java.awt.GridBagConstraints c)
This grid is used when there are no edit grids required.(package private) void
makeEmptyVariableGrid(java.awt.GridBagConstraints c)
Create a one row grid with just the Variable Type box.(package private) void
makeFastClockVariableGrid(java.awt.GridBagConstraints c)
Create the Fast Clock start and end time rows.(package private) void
makeFileActionGrid(java.awt.GridBagConstraints c)
Add the file selection components.(package private) void
makeLogicTypeGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Logic Type.(package private) void
makeMemoryVariableGrid(java.awt.GridBagConstraints c)
Create the Memory specific rows.(package private) void
makeNameTypeActionGrid(java.awt.GridBagConstraints c, boolean finalRow)
Create the standard Name and Type rows.(package private) void
makeOptionsVariableGrid(java.awt.GridBagConstraints c)
(package private) void
makeShortFieldActionGrid(java.awt.GridBagConstraints c, boolean includeBox)
Add the short name field to the grid.(package private) void
makeSignalAspectVariableGrid(java.awt.GridBagConstraints c)
Add the Aspect field for signal heads and signal masts.(package private) void
makeStandardActionGrid(java.awt.GridBagConstraints c, boolean finalRow)
Add the action box to the grid.(package private) void
makeStandardVariableGrid(java.awt.GridBagConstraints c)
Create the standard Name and State rows.(package private) void
makeTypeActionGrid(java.awt.GridBagConstraints c, boolean finalRow)
Create the standard Type row.(package private) void
makeTypeShortActionGrid(java.awt.GridBagConstraints c)
Just a short text field, no name field.(package private) void
moveTreeNode(java.lang.String direction)
Move a tree node in response to a up or down request.(package private) void
newAction()
Create a new action Can be invoked by a Actions or Action node.(package private) void
newVariable()
Create a new variable Can be invoked by a Variables or Variable node.(package private) void
removeActionTimers()
Remove Action timers and listeners before Action list structure changes.(package private) void
setActionNameBox(Conditional.ItemType itemType)
Update the name combo box selection based on the current contents of the name field.(package private) void
setEditMode(boolean active)
Enable/disable buttons based on edit state.(package private) void
setFileLocation(java.awt.event.ActionEvent e)
Respond to the [...] button in the Edit Action window action section.(package private) void
setFocusListeners()
Add the focus listener to each detail edit field.(package private) void
setMoveButtons()
Enable/Disable the Up and Down buttons based on the postion in the list.(package private) void
setPickWindow(java.lang.String cmd, Conditional.ItemType item)
Ceate tabbed Pick Taba;e or Pick Single based on Selection Mode.(package private) void
setVariableNameBox(Conditional.ItemType itemType)
Update the name combo box selection based on the current contents of the name field.(package private) void
showNodeEditMessage()
Display reminder to finish a node before starting another.(package private) void
togglePressed()
Update the Actions trigger mode, adjust the Action descriptions.(package private) void
treeRowSelected(ConditionalTreeEdit.ConditionalTreeNode selectedNode)
Change the button row based on the currently selected node type.(package private) void
updateAction()
Respond to Update button.(package private) void
updateActionList()
Update the conditional action list and refresh the local copy.(package private) void
updatePressed()
Apply the updates to the current node.(package private) void
updateVariable()
Respond to Update Variable button in the Edit Variable pane.(package private) void
updateVariableList()
Update the conditional variable list and refresh the local copy.(package private) void
updateVariableNegation()
Update the variable negation.(package private) void
updateVariableOperator()
Update the variable operation.(package private) void
upPressed()
Move a conditional, variable or action row up 1 row.(package private) void
userNameChanged(java.lang.String newName)
Change the conditional user name.(package private) boolean
validateAction()
Validate Action data from Edit Action Window, and transfer it to current action object as appropriate.(package private) boolean
validateAntecedent(java.lang.String antecedentText)
Check the antecedent and logic type.(package private) boolean
validateVariable()
Validate Variable data from Edit Variable panel, and transfer it to current variable object as appropriate.-
Methods inherited from class jmri.jmrit.conditional.ConditionalEditBase
addLogixEventListener, appendToAntecedent, bringToFront, checkConditionalReferences, checkConditionalUserName, closeSinglePanelPickList, confirmActionAsVariable, confirmIndirectMemory, createNameBox, createSinglePanelPickList, displayBadNumberReference, findPickListTabPane, fireLogixEvent, formatTime, getLight, hidePickListTable, loadReferenceNames, loadSelectionMode, locateAt, makeAntecedent, messageDuplicateConditionalUserName, messageInvalidActionItemName, messageInvalidSignalHeadAppearance, openPickListTable, parseTime, removeLogixEventListener, setPickListTab, showSaveReminder, translateAntecedent, updateWhereUsed, validateAntecedent, validateAudioReference, validateConditionalReference, validateEntryExitReference, validateIntensity, validateIntensityReference, validateLightReference, validateLogixReference, validateMemoryReference, validateOBlockReference, validateRouteReference, validateSensorReference, validateSignalHeadReference, validateSignalMastReference, validateTime, validateTimeReference, validateTurnoutReference, validateWarrantReference
-
-
-
-
Field Detail
-
_curDetailPanel
javax.swing.JPanel _curDetailPanel
-
_editLogixUserName
javax.swing.JTextField _editLogixUserName
-
_comboNameBox
NamedBeanComboBox<?> _comboNameBox
-
_detailGrid
javax.swing.JPanel _detailGrid
-
_detailFooter
javax.swing.JPanel _detailFooter
-
_gridPanel
javax.swing.JPanel _gridPanel
-
_editConditionalUserName
javax.swing.JTextField _editConditionalUserName
-
_editAntecedent
javax.swing.JTextField _editAntecedent
-
_editOperatorMode
javax.swing.JComboBox<Conditional.AntecedentOperator> _editOperatorMode
-
_editActive
boolean _editActive
-
_cancelAction
javax.swing.JButton _cancelAction
-
_updateAction
javax.swing.JButton _updateAction
-
_pickCommand
java.lang.String _pickCommand
-
_pickItem
Conditional.ItemType _pickItem
-
_cdlTree
javax.swing.JTree _cdlTree
-
_cdlModel
javax.swing.tree.DefaultTreeModel _cdlModel
-
_cdlRoot
javax.swing.tree.DefaultMutableTreeNode _cdlRoot
-
_cdlListener
javax.swing.event.TreeSelectionListener _cdlListener
-
_curTreePath
javax.swing.tree.TreePath _curTreePath
-
_curNodeName
java.lang.String _curNodeName
-
_curNodeType
java.lang.String _curNodeType
-
_curNodeText
java.lang.String _curNodeText
-
_curNodeRow
int _curNodeRow
-
_leftButtonBar
javax.swing.JPanel _leftButtonBar
-
_labelPanel
javax.swing.JPanel _labelPanel
-
_addButtonPanel
javax.swing.JPanel _addButtonPanel
-
_toggleButtonPanel
javax.swing.JPanel _toggleButtonPanel
-
_checkButtonPanel
javax.swing.JPanel _checkButtonPanel
-
_moveButtonPanel
javax.swing.JPanel _moveButtonPanel
-
_deleteButtonPanel
javax.swing.JPanel _deleteButtonPanel
-
_helpButtonPanel
javax.swing.JPanel _helpButtonPanel
-
_conditionalLabel
javax.swing.JLabel _conditionalLabel
-
_antecedentLabel
javax.swing.JLabel _antecedentLabel
-
_logicTypeLabel
javax.swing.JLabel _logicTypeLabel
-
_triggerModeLabel
javax.swing.JLabel _triggerModeLabel
-
_variablesLabel
javax.swing.JLabel _variablesLabel
-
_variableLabel
javax.swing.JLabel _variableLabel
-
_actionsLabel
javax.swing.JLabel _actionsLabel
-
_actionLabel
javax.swing.JLabel _actionLabel
-
_curConditional
Conditional _curConditional
-
_variableList
java.util.List<ConditionalVariable> _variableList
-
_actionList
java.util.List<ConditionalAction> _actionList
-
_curVariable
ConditionalVariable _curVariable
-
_curAction
ConditionalAction _curAction
-
_curVariableItem
Conditional.ItemType _curVariableItem
-
_curActionItem
Conditional.ItemType _curActionItem
-
_curConditionalName
java.lang.String _curConditionalName
-
_antecedent
java.lang.String _antecedent
-
_logicType
Conditional.AntecedentOperator _logicType
-
_triggerMode
boolean _triggerMode
-
_newActionItem
boolean _newActionItem
-
_newVariableItem
boolean _newVariableItem
-
_oldTargetNames
java.util.TreeSet<java.lang.String> _oldTargetNames
-
_selectLogixBox
javax.swing.JComboBox<java.lang.String> _selectLogixBox
-
_selectConditionalBox
javax.swing.JComboBox<java.lang.String> _selectConditionalBox
-
_selectLogixMap
java.util.TreeMap<java.lang.String,java.lang.String> _selectLogixMap
-
_selectConditionalList
java.util.ArrayList<java.lang.String> _selectConditionalList
-
_variableItemBox
javax.swing.JComboBox<Conditional.ItemType> _variableItemBox
-
_variableStateBox
javax.swing.JComboBox<Conditional.Type> _variableStateBox
-
_variableOperBox
javax.swing.JComboBox<java.lang.String> _variableOperBox
-
_variableNegated
javax.swing.JCheckBox _variableNegated
-
_variableTriggerActions
javax.swing.JCheckBox _variableTriggerActions
-
_variableNameField
javax.swing.JTextField _variableNameField
-
_variableNameLabel
javax.swing.JLabel _variableNameLabel
-
_variableCompareOpBox
javax.swing.JComboBox<java.lang.String> _variableCompareOpBox
-
_variableSignalBox
javax.swing.JComboBox<java.lang.String> _variableSignalBox
-
_variableCompareTypeBox
javax.swing.JComboBox<Conditional.Type> _variableCompareTypeBox
-
_variableMemoryValueLabel
javax.swing.JLabel _variableMemoryValueLabel
-
_variableData1Field
javax.swing.JTextField _variableData1Field
-
_variableData2Field
javax.swing.JTextField _variableData2Field
-
_actionItemBox
javax.swing.JComboBox<Conditional.ItemType> _actionItemBox
-
_actionTypeBox
javax.swing.JComboBox<Conditional.Action> _actionTypeBox
-
_actionTypeLabel
javax.swing.JLabel _actionTypeLabel
-
_actionNameField
javax.swing.JTextField _actionNameField
-
_actionNameLabel
javax.swing.JLabel _actionNameLabel
-
_actionBox
javax.swing.JComboBox<java.lang.String> _actionBox
-
_actionBoxLabel
javax.swing.JLabel _actionBoxLabel
-
_longActionString
javax.swing.JTextField _longActionString
-
_longActionLabel
javax.swing.JLabel _longActionLabel
-
_shortActionString
javax.swing.JTextField _shortActionString
-
_shortActionLabel
javax.swing.JLabel _shortActionLabel
-
_actionOptionBox
javax.swing.JComboBox<java.lang.String> _actionOptionBox
-
_actionSetButton
javax.swing.JButton _actionSetButton
-
detailFocusEvent
transient java.awt.event.FocusListener detailFocusEvent
Focus gained implies intent to make changes, set up for edit.
-
variableSignalHeadNameListener
transient java.awt.event.ActionListener variableSignalHeadNameListener
-
variableSignalMastNameListener
transient java.awt.event.ActionListener variableSignalMastNameListener
-
variableSignalTestStateListener
transient java.awt.event.ActionListener variableSignalTestStateListener
-
selectLogixBoxListener
transient java.awt.event.ActionListener selectLogixBoxListener
-
selectConditionalBoxListener
transient java.awt.event.ActionListener selectConditionalBoxListener
-
compareTypeBoxListener
transient java.awt.event.ActionListener compareTypeBoxListener
-
sndFileChooser
javax.swing.JFileChooser sndFileChooser
-
scriptFileChooser
ScriptFileChooser scriptFileChooser
-
defaultFileChooser
javax.swing.JFileChooser defaultFileChooser
-
_actionTypeListener
ConditionalTreeEdit.ActionTypeListener _actionTypeListener
-
actionSignalHeadNameListener
transient java.awt.event.ActionListener actionSignalHeadNameListener
-
actionSignalMastNameListener
transient java.awt.event.ActionListener actionSignalMastNameListener
-
-
Constructor Detail
-
ConditionalTreeEdit
public ConditionalTreeEdit(java.lang.String sName)
Create a new Conditional Tree View editor.- Parameters:
sName
- The system name of the current Logix
-
ConditionalTreeEdit
public ConditionalTreeEdit()
-
-
Method Detail
-
makeEditLogixWindow
void makeEditLogixWindow()
Create the edit logix window.The left side contains a tree structure containing the conditionals for the current Logix. The right side contains detail edit panes based on the current tree row selection.
-
buildConditionalComponents
void buildConditionalComponents()
Initialize conditional components.
-
makeDetailGrid
void makeDetailGrid(java.lang.String gridType)
Build new GridBag content. The grid panel is hidden, emptied, re-built and made visible.- Parameters:
gridType
- The type of grid to create
-
makeEmptyGrid
void makeEmptyGrid(java.awt.GridBagConstraints c)
This grid is used when there are no edit grids required.- Parameters:
c
- The constraints object used for the grid construction
-
makeConditionalGrid
void makeConditionalGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Conditional User Name.- Parameters:
c
- The constraints object used for the grid construction
-
makeAntecedentGrid
void makeAntecedentGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Antecedent when the Logic Type is Mixed.- Parameters:
c
- The constraints object used for the grid construction
-
makeLogicTypeGrid
void makeLogicTypeGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Logic Type.- Parameters:
c
- The constraints object used for the grid construction
-
addPressed
void addPressed()
Add new items: Conditionals, Variables or Actions.
-
newVariable
void newVariable()
Create a new variable Can be invoked by a Variables or Variable node.
-
newAction
void newAction()
Create a new action Can be invoked by a Actions or Action node.
-
editPressed
void editPressed()
Set up the edit environment for the selected node Called fromtreeRowSelected(jmri.jmrit.conditional.ConditionalTreeEdit.ConditionalTreeNode)
. This takes the place of an actual button.
-
updatePressed
void updatePressed()
Apply the updates to the current node.
-
userNameChanged
void userNameChanged(java.lang.String newName)
Change the conditional user name.- Parameters:
newName
- The proposed new name
-
logicTypeChanged
void logicTypeChanged(Conditional.AntecedentOperator newType)
Respond to a change of Logic Type in the dialog window by showing/hiding the _antecedentPanel when Mixed is selected.- Parameters:
newType
- The selected logic type
-
antecedentChanged
void antecedentChanged(java.lang.String antecedentText)
Update the antecedent.- Parameters:
antecedentText
- the new antecedent
-
makeAntecedent
void makeAntecedent()
Build the antecedent statement.
-
appendToAntecedent
void appendToAntecedent()
Add a R# to the antecedent statement.
-
validateAntecedent
boolean validateAntecedent(java.lang.String antecedentText)
Check the antecedent and logic type.- Parameters:
antecedentText
- The user supplied antecedent text- Returns:
- false if antecedent can't be validated
-
togglePressed
void togglePressed()
Update the Actions trigger mode, adjust the Action descriptions.
-
checkPressed
void checkPressed()
Refresh the Conditional or Variable state.
-
deletePressed
void deletePressed()
Process the node delete request.
-
upPressed
void upPressed()
Move a conditional, variable or action row up 1 row.
-
downPressed
void downPressed()
Move a conditional, variable or action row down 1 row.
-
removeActionTimers
void removeActionTimers()
Remove Action timers and listeners before Action list structure changes. This relates to moving and deleting rows. New actions at the end are not problem. The issue is that the timer listeners are tied to the action row number. This can result in orphan timers and listeners that keep running.- Since:
- 4.11.2
-
moveTreeNode
void moveTreeNode(java.lang.String direction)
Move a tree node in response to a up or down request.- Parameters:
direction
- The direction of movement, Up or Down
-
setMoveButtons
void setMoveButtons()
Enable/Disable the Up and Down buttons based on the postion in the list.
-
helpPressed
void helpPressed()
Respond to Help button press in the Edit Logix menu bar. Only visible when using mixed mode and an antecedent node is selected.
-
cancelPressed
void cancelPressed()
Cancel the current node edit.
-
donePressed
void donePressed()
Clean up, notify the parent Logix that edit session is done.
-
buildConditionalTree
javax.swing.JTree buildConditionalTree()
Create the conditional tree structure using the current Logix.- Returns:
- _cdlTree The tree ddefinition with its content
-
createConditionalContent
void createConditionalContent()
Create the tree content. Level 1 are the conditionals, Level 2 includes the antecedent, logic type, trigger mode and parent nodes for Variables and Actions, Level 3 contains the detail Variable and Action entries.
-
treeRowSelected
void treeRowSelected(ConditionalTreeEdit.ConditionalTreeNode selectedNode)
Change the button row based on the currently selected node type. Invoke edit where appropriate.- Parameters:
selectedNode
- The node object
-
buildNodeText
java.lang.String buildNodeText(java.lang.String nodeType, java.lang.Object component, int idx)
Create the localized node text display strings based on node type.- Parameters:
nodeType
- The type of the nodecomponent
- The conditional object or child objectidx
- Optional index value- Returns:
- nodeText containing the text to display on the node
-
showNodeEditMessage
void showNodeEditMessage()
Display reminder to finish a node before starting another. This is a session reminder.
-
setFocusListeners
void setFocusListeners()
Add the focus listener to each detail edit field.
-
setEditMode
void setEditMode(boolean active)
Enable/disable buttons based on edit state. Open pick lists based on the current SelectionMode. The edit state controls the ability to select tree nodes.- Parameters:
active
- True to make edit active, false to make edit inactive
-
setPickWindow
void setPickWindow(java.lang.String cmd, Conditional.ItemType item)
Ceate tabbed Pick Taba;e or Pick Single based on Selection Mode. Called bysetEditMode(boolean)
when edit mode becomes active. Called byvariableTypeChanged(jmri.Conditional.ItemType)
andactionItemChanged(jmri.Conditional.ItemType)
when item type changes.- Parameters:
cmd
- The source or action to be performed.item
- The item type for Variable or Action or zero
-
doPickList
void doPickList()
Create a Variable or Action based tabbed PickList with appropriate tab selected.
-
doPickSingle
void doPickSingle()
Create a Variable or Action based single pane PickList.
-
buildVariableComponents
void buildVariableComponents()
Called once during class initialization to define the GUI objects. Where possible, the combo box content is loaded.
-
makeEmptyVariableGrid
void makeEmptyVariableGrid(java.awt.GridBagConstraints c)
Create a one row grid with just the Variable Type box. This is the base for larger grids as well as the initial grid for new State Variables.- Parameters:
c
- the constraints object used for the grid construction
-
makeOptionsVariableGrid
void makeOptionsVariableGrid(java.awt.GridBagConstraints c)
-
makeStandardVariableGrid
void makeStandardVariableGrid(java.awt.GridBagConstraints c)
Create the standard Name and State rows. The name field will be either a text field or a combo box. The name field label is a variable to support run time changes.- Parameters:
c
- The constraints object used for the grid construction
-
makeSignalAspectVariableGrid
void makeSignalAspectVariableGrid(java.awt.GridBagConstraints c)
Add the Aspect field for signal heads and signal masts.- Parameters:
c
- The constraints object used for the grid construction
-
makeConditionalVariableGrid
void makeConditionalVariableGrid(java.awt.GridBagConstraints c)
Create the Logix and Conditional rows and the State row.- Parameters:
c
- The constraints object used for the grid construction
-
makeMemoryVariableGrid
void makeMemoryVariableGrid(java.awt.GridBagConstraints c)
Create the Memory specific rows.- Parameters:
c
- The constraints object used for the grid construction
-
makeFastClockVariableGrid
void makeFastClockVariableGrid(java.awt.GridBagConstraints c)
Create the Fast Clock start and end time rows.- Parameters:
c
- The constraints object used for the grid construction
-
initializeStateVariables
void initializeStateVariables()
Set display to show current state variable (curVariable) parameters.
-
setVariableNameBox
void setVariableNameBox(Conditional.ItemType itemType)
Update the name combo box selection based on the current contents of the name field. Called by variableItemChanged.- Parameters:
itemType
- The item type, such as sensor or turnout.- Since:
- 4.7.3
-
cancelEditVariable
void cancelEditVariable()
Respond to Cancel variable button
-
updateVariable
void updateVariable()
Respond to Update Variable button in the Edit Variable pane.
-
cleanUpVariable
void cleanUpVariable()
Clean up: Cancel, Update and Delete Variable buttons.
-
loadSelectLogixBox
void loadSelectLogixBox()
Load the Logix selection box. Set the selection to the current Logix.- Since:
- 4.7.4
-
loadSelectConditionalBox
void loadSelectConditionalBox(java.lang.String logixName)
Load the Conditional selection box. The first row is a prompt.- Parameters:
logixName
- The Logix system name for selecting the owned Conditionals- Since:
- 4.7.4
-
loadJComboBoxWithHeadAppearances
void loadJComboBoxWithHeadAppearances(javax.swing.JComboBox<java.lang.String> box, java.lang.String signalHeadName)
Fetch valid localized appearances for a given Signal Head.Warn if head is not found.
- Parameters:
box
- the comboBox on the setup pane to fillsignalHeadName
- user or system name of the Signal Head
-
loadJComboBoxWithMastAspects
void loadJComboBoxWithMastAspects(javax.swing.JComboBox<java.lang.String> box, java.lang.String mastName)
Fetch valid aspects for a given Signal Mast.Warn if mast is not found.
- Parameters:
box
- the comboBox on the setup pane to fillmastName
- user or system name of the Signal Mast
-
validateVariable
boolean validateVariable()
Validate Variable data from Edit Variable panel, and transfer it to current variable object as appropriate.Messages are sent to the user for any errors found. This routine returns false immediately after finding the first error, even if there might be more errors.
- Returns:
- true if all data checks out OK, otherwise false
-
updateVariableOperator
void updateVariableOperator()
Update the variable operation. If a change has occurred, also update the antecedent and antecedent tree node.
-
updateVariableNegation
void updateVariableNegation()
Update the variable negation. If a change has occurred, also update the antecedent and antecedent tree node.
-
updateVariableList
void updateVariableList()
Update the conditional variable list and refresh the local copy. The parent Logix is de-activated and re-activated. This ensures that listeners are properly handled.- Since:
- 4.11.2
-
buildActionComponents
void buildActionComponents()
Called once during class initialization to define the GUI objects. Where possible, the combo box content is loaded.
-
makeEmptyActionGrid
void makeEmptyActionGrid(java.awt.GridBagConstraints c)
Create a one row grid with just the Action Item box. This is the base for larger grids as well as the initial grid for new Actions.- Parameters:
c
- the constraints object used for the grid construction
-
makeNameTypeActionGrid
void makeNameTypeActionGrid(java.awt.GridBagConstraints c, boolean finalRow)
Create the standard Name and Type rows. The name field will be either a text field or a combo box. The name field label is a variable to support run time changes.- Parameters:
c
- The constraints object used for the grid constructionfinalRow
- Controls whether the tigger combo box is included
-
makeTypeActionGrid
void makeTypeActionGrid(java.awt.GridBagConstraints c, boolean finalRow)
Create the standard Type row.- Parameters:
c
- The constraints object used for the grid constructionfinalRow
- Controls whether the tigger combo box is included
-
makeStandardActionGrid
void makeStandardActionGrid(java.awt.GridBagConstraints c, boolean finalRow)
Add the action box to the grid.- Parameters:
c
- The constraints object used for the grid constructionfinalRow
- Controls whether the tigger combo box is included
-
makeShortFieldActionGrid
void makeShortFieldActionGrid(java.awt.GridBagConstraints c, boolean includeBox)
Add the short name field to the grid.- Parameters:
c
- The constraints object used for the grid constructionincludeBox
- Controls whether the normal action type combo box is included
-
makeTypeShortActionGrid
void makeTypeShortActionGrid(java.awt.GridBagConstraints c)
Just a short text field, no name field. Used by set clock and jython command.- Parameters:
c
- The constraints object used for the grid construction
-
makeFileActionGrid
void makeFileActionGrid(java.awt.GridBagConstraints c)
Add the file selection components.- Parameters:
c
- The constraints object used for the grid construction
-
makeChangeTriggerActionGrid
void makeChangeTriggerActionGrid(java.awt.GridBagConstraints c)
Add the change/trigger box the grid. This is the last item in an Action and is usually called from one of the other entry points.- Parameters:
c
- The constraints object used for the grid construction
-
initializeActionVariables
void initializeActionVariables()
Set display to show current action (curAction) parameters.
-
actionItemChanged
void actionItemChanged(Conditional.ItemType type)
Respond to a change in an Action Type comboBox.Set components visible for the selected type.
- Parameters:
type
- index of the newly selected Action type
-
setActionNameBox
void setActionNameBox(Conditional.ItemType itemType)
Update the name combo box selection based on the current contents of the name field.- Parameters:
itemType
- The item type, such as sensor or turnout.- Since:
- 4.7.3
-
cancelEditAction
void cancelEditAction()
Respond to Cancel action button and window closer of the Edit Action window.Also does cleanup of Update and Delete buttons.
-
updateAction
void updateAction()
Respond to Update button.
-
cleanUpAction
void cleanUpAction()
Clean up Update and Delete Action buttons.
-
setFileLocation
void setFileLocation(java.awt.event.ActionEvent e)
Respond to the [...] button in the Edit Action window action section.Ask user to select an audio or python script file on disk.
- Parameters:
e
- the event heard
-
validateAction
boolean validateAction()
Validate Action data from Edit Action Window, and transfer it to current action object as appropriate.Messages are sent to the user for any errors found. This routine returns false immediately after finding an error, even if there might be more errors.
- Returns:
- true if all data checks out OK, otherwise false.
-
updateActionList
void updateActionList()
Update the conditional action list and refresh the local copy. The parent Logix is de-activated and re-activated. This ensures that listeners are properly handled, specifically the delayed sensor and turnout options.- Since:
- 4.11.2
-
checkIsAction
boolean checkIsAction(java.lang.String name, Conditional.ItemType itemType)
Check that a state variable is not also used as an action- Parameters:
name
- of the state variableitemType
- item type of the state variable- Returns:
- true if variable is not an action of if the user OK's its use as an action also.
-
checkIsVariable
boolean checkIsVariable(java.lang.String name, Conditional.ItemType itemType)
Check that an action is not also used as a state variable- Parameters:
name
- of the actionitemType
- item type of the action- Returns:
- true if action is not a state variable of if the user OK's its use as such.
-
getClassName
protected java.lang.String getClassName()
- Overrides:
getClassName
in classConditionalEditBase
-
-