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) classConditionalTreeEdit.ActionTypeListenerListener for _actionTypeBox.(package private) static classConditionalTreeEdit.ConditionalTreeNodeConditional 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.ActionListeneractionSignalHeadNameListener(package private) java.awt.event.ActionListeneractionSignalMastNameListener(package private) java.awt.event.ActionListenercompareTypeBoxListener(package private) javax.swing.JFileChooserdefaultFileChooser(package private) java.awt.event.FocusListenerdetailFocusEventFocus gained implies intent to make changes, set up for edit.(package private) ScriptFileChooserscriptFileChooser(package private) java.awt.event.ActionListenerselectConditionalBoxListener(package private) java.awt.event.ActionListenerselectLogixBoxListener(package private) javax.swing.JFileChoosersndFileChooser(package private) java.awt.event.ActionListenervariableSignalHeadNameListener(package private) java.awt.event.ActionListenervariableSignalMastNameListener(package private) java.awt.event.ActionListenervariableSignalTestStateListener-
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) voidactionItemChanged(Conditional.ItemType type)Respond to a change in an Action Type comboBox.(package private) voidaddPressed()Add new items: Conditionals, Variables or Actions.(package private) voidantecedentChanged(java.lang.String antecedentText)Update the antecedent.(package private) voidappendToAntecedent()Add a R# to the antecedent statement.(package private) voidbuildActionComponents()Called once during class initialization to define the GUI objects.(package private) voidbuildConditionalComponents()Initialize conditional components.(package private) javax.swing.JTreebuildConditionalTree()Create the conditional tree structure using the current Logix.(package private) java.lang.StringbuildNodeText(java.lang.String nodeType, java.lang.Object component, int idx)Create the localized node text display strings based on node type.(package private) voidbuildVariableComponents()Called once during class initialization to define the GUI objects.(package private) voidcancelEditAction()Respond to Cancel action button and window closer of the Edit Action window.(package private) voidcancelEditVariable()Respond to Cancel variable button(package private) voidcancelPressed()Cancel the current node edit.(package private) booleancheckIsAction(java.lang.String name, Conditional.ItemType itemType)Check that a state variable is not also used as an action(package private) booleancheckIsVariable(java.lang.String name, Conditional.ItemType itemType)Check that an action is not also used as a state variable(package private) voidcheckPressed()Refresh the Conditional or Variable state.(package private) voidcleanUpAction()Clean up Update and Delete Action buttons.(package private) voidcleanUpVariable()Clean up: Cancel, Update and Delete Variable buttons.(package private) voidcreateConditionalContent()Create the tree content.(package private) voiddeletePressed()Process the node delete request.(package private) voiddonePressed()Clean up, notify the parent Logix that edit session is done.(package private) voiddoPickList()Create a Variable or Action based tabbed PickList with appropriate tab selected.(package private) voiddoPickSingle()Create a Variable or Action based single pane PickList.(package private) voiddownPressed()Move a conditional, variable or action row down 1 row.(package private) voideditPressed()Set up the edit environment for the selected node Called fromtreeRowSelected(jmri.jmrit.conditional.ConditionalTreeEdit.ConditionalTreeNode).protected java.lang.StringgetClassName()(package private) voidhelpPressed()Respond to Help button press in the Edit Logix menu bar.(package private) voidinitializeActionVariables()Set display to show current action (curAction) parameters.(package private) voidinitializeStateVariables()Set display to show current state variable (curVariable) parameters.(package private) voidloadJComboBoxWithHeadAppearances(javax.swing.JComboBox<java.lang.String> box, java.lang.String signalHeadName)Fetch valid localized appearances for a given Signal Head.(package private) voidloadJComboBoxWithMastAspects(javax.swing.JComboBox<java.lang.String> box, java.lang.String mastName)Fetch valid aspects for a given Signal Mast.(package private) voidloadSelectConditionalBox(java.lang.String logixName)Load the Conditional selection box.(package private) voidloadSelectLogixBox()Load the Logix selection box.(package private) voidlogicTypeChanged(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) voidmakeAntecedent()Build the antecedent statement.(package private) voidmakeAntecedentGrid(java.awt.GridBagConstraints c)This grid is used to edit the Antecedent when the Logic Type is Mixed.(package private) voidmakeChangeTriggerActionGrid(java.awt.GridBagConstraints c)Add the change/trigger box the grid.(package private) voidmakeConditionalGrid(java.awt.GridBagConstraints c)This grid is used to edit the Conditional User Name.(package private) voidmakeConditionalVariableGrid(java.awt.GridBagConstraints c)Create the Logix and Conditional rows and the State row.(package private) voidmakeDetailGrid(java.lang.String gridType)Build new GridBag content.(package private) voidmakeEditLogixWindow()Create the edit logix window.(package private) voidmakeEmptyActionGrid(java.awt.GridBagConstraints c)Create a one row grid with just the Action Item box.(package private) voidmakeEmptyGrid(java.awt.GridBagConstraints c)This grid is used when there are no edit grids required.(package private) voidmakeEmptyVariableGrid(java.awt.GridBagConstraints c)Create a one row grid with just the Variable Type box.(package private) voidmakeFastClockVariableGrid(java.awt.GridBagConstraints c)Create the Fast Clock start and end time rows.(package private) voidmakeFileActionGrid(java.awt.GridBagConstraints c)Add the file selection components.(package private) voidmakeLogicTypeGrid(java.awt.GridBagConstraints c)This grid is used to edit the Logic Type.(package private) voidmakeMemoryVariableGrid(java.awt.GridBagConstraints c)Create the Memory specific rows.(package private) voidmakeNameTypeActionGrid(java.awt.GridBagConstraints c, boolean finalRow)Create the standard Name and Type rows.(package private) voidmakeOptionsVariableGrid(java.awt.GridBagConstraints c)(package private) voidmakeShortFieldActionGrid(java.awt.GridBagConstraints c, boolean includeBox)Add the short name field to the grid.(package private) voidmakeSignalAspectVariableGrid(java.awt.GridBagConstraints c)Add the Aspect field for signal heads and signal masts.(package private) voidmakeStandardActionGrid(java.awt.GridBagConstraints c, boolean finalRow)Add the action box to the grid.(package private) voidmakeStandardVariableGrid(java.awt.GridBagConstraints c)Create the standard Name and State rows.(package private) voidmakeTypeActionGrid(java.awt.GridBagConstraints c, boolean finalRow)Create the standard Type row.(package private) voidmakeTypeShortActionGrid(java.awt.GridBagConstraints c)Just a short text field, no name field.(package private) voidmoveTreeNode(java.lang.String direction)Move a tree node in response to a up or down request.(package private) voidnewAction()Create a new action Can be invoked by a Actions or Action node.(package private) voidnewVariable()Create a new variable Can be invoked by a Variables or Variable node.(package private) voidremoveActionTimers()Remove Action timers and listeners before Action list structure changes.(package private) voidsetActionNameBox(Conditional.ItemType itemType)Update the name combo box selection based on the current contents of the name field.(package private) voidsetEditMode(boolean active)Enable/disable buttons based on edit state.(package private) voidsetFileLocation(java.awt.event.ActionEvent e)Respond to the [...] button in the Edit Action window action section.(package private) voidsetFocusListeners()Add the focus listener to each detail edit field.(package private) voidsetMoveButtons()Enable/Disable the Up and Down buttons based on the postion in the list.(package private) voidsetPickWindow(java.lang.String cmd, Conditional.ItemType item)Ceate tabbed Pick Taba;e or Pick Single based on Selection Mode.(package private) voidsetVariableNameBox(Conditional.ItemType itemType)Update the name combo box selection based on the current contents of the name field.(package private) voidshowNodeEditMessage()Display reminder to finish a node before starting another.(package private) voidtogglePressed()Update the Actions trigger mode, adjust the Action descriptions.(package private) voidtreeRowSelected(ConditionalTreeEdit.ConditionalTreeNode selectedNode)Change the button row based on the currently selected node type.(package private) voidupdateAction()Respond to Update button.(package private) voidupdateActionList()Update the conditional action list and refresh the local copy.(package private) voidupdatePressed()Apply the updates to the current node.(package private) voidupdateVariable()Respond to Update Variable button in the Edit Variable pane.(package private) voidupdateVariableList()Update the conditional variable list and refresh the local copy.(package private) voidupdateVariableNegation()Update the variable negation.(package private) voidupdateVariableOperator()Update the variable operation.(package private) voidupPressed()Move a conditional, variable or action row up 1 row.(package private) voiduserNameChanged(java.lang.String newName)Change the conditional user name.(package private) booleanvalidateAction()Validate Action data from Edit Action Window, and transfer it to current action object as appropriate.(package private) booleanvalidateAntecedent(java.lang.String antecedentText)Check the antecedent and logic type.(package private) booleanvalidateVariable()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, 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:
getClassNamein classConditionalEditBase
-
-