Class ConditionalListEdit
- java.lang.Object
-
- jmri.jmrit.conditional.ConditionalEditBase
-
- jmri.jmrit.conditional.ConditionalList
-
- jmri.jmrit.conditional.ConditionalListEdit
-
public class ConditionalListEdit extends ConditionalList
The traditional list based conditional editor based on the original editor included in LogixTableAction.Conditionals now have two policies to trigger execution of their action lists:
- the previous policy - Trigger on change of state only
- the new default - Trigger on any enabled state calculation
Two additional action and variable name selection methods have been added:
- Single Pick List
- Combo Box Selection
Add a Browse Option to the Logix Select Menu. This will display a window that creates a formatted list of the contents of the selected Logix with each Conditional, Variable and Action. The code is courtesy of Chuck Catania and is used with his permission. Apr 2, 2017 - Dave Sand
Compare with the other Conditional Edit tool
ConditionalTreeEdit
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classConditionalListEdit.ConditionalTableModelTable model for Conditionals in the Edit Logix pane.-
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) int_conditionalRowNumber(package private) javax.swing.JTextField_editUserName(package private) boolean_inReorderMode(package private) int_nextInOrder(package private) int_numConditionals(package private) javax.swing.JLabel_status(package private) ConditionalListEdit.ConditionalTableModelconditionalTableModel(package private) static intSTRUT-
Fields inherited from class jmri.jmrit.conditional.ConditionalList
_conditionalFrame, _curConditional, _newConditional, _oldTargetNames
-
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 ConditionalListEdit()ConditionalListEdit(java.lang.String sName)Create a new Conditional List View editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcalculatePressed(java.awt.event.ActionEvent e)Responds to the Calculate Button in the Edit Logix window.(package private) booleancheckConditionalUserName(java.lang.String uName)(package private) booleancheckEditConditional()Check if edit of a conditional is in progress.(package private) voidcloseConditionalFrame()(package private) voiddeleteConditionalPressed()Respond to the Delete Conditional Button in the Edit Conditional window.(package private) voiddeletePressed(java.awt.event.ActionEvent e)Respond to the Delete button in the Edit Logix window.(package private) voiddonePressed(java.awt.event.ActionEvent e)Respond to the Done button in the Edit Logix window.(package private) voideditConditionalPressed(int rx)Respond to Edit Button in the Conditional table of the Edit Logix Window.(package private) voidfinishDone()protected java.lang.StringgetClassName()(package private) javax.swing.JPanelmakeBottomPanel()Make the bottom panel for _conditionalFrame to hold buttons for Update/Save, Cancel, Delete/FullEdit(package private) voidmakeEditConditionalWindow()Create and/or initialize the Edit Conditional window.(package private) voidmakeEditLogixWindow()Create and/or initialize the Edit Logix pane.(package private) voidnewConditionalPressed(java.awt.event.ActionEvent e)Respond to the New Conditional Button in Edit Logix Window.(package private) voidreorderPressed(java.awt.event.ActionEvent e)Respond to the Reorder Button in the Edit Logix pane.(package private) voidswapConditional(int row)Respond to the First/Next (Delete/Reorder) Button in the ConditionalTableModel.(package private) booleanupdateConditional(java.lang.String uName, Conditional.AntecedentOperator logicType, boolean trigger, java.lang.String antecedent)Update _curConditional, the current Conditional.(package private) voidupdateConditionalTableModel()-
Methods inherited from class jmri.jmrit.conditional.ConditionalList
closeConditionalFrame, getPickSingleListener, makeNewConditional, updateConditional
-
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
-
_editUserName
javax.swing.JTextField _editUserName
-
_status
javax.swing.JLabel _status
-
_numConditionals
int _numConditionals
-
conditionalTableModel
ConditionalListEdit.ConditionalTableModel conditionalTableModel
-
_conditionalRowNumber
int _conditionalRowNumber
-
_inReorderMode
boolean _inReorderMode
-
_nextInOrder
int _nextInOrder
-
STRUT
static final int STRUT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConditionalListEdit
public ConditionalListEdit(java.lang.String sName)
Create a new Conditional List View editor.- Parameters:
sName- name of the Logix being edited
-
ConditionalListEdit
public ConditionalListEdit()
-
-
Method Detail
-
makeEditLogixWindow
void makeEditLogixWindow()
Create and/or initialize the Edit Logix pane.
-
newConditionalPressed
void newConditionalPressed(java.awt.event.ActionEvent e)
Respond to the New Conditional Button in Edit Logix Window.- Parameters:
e- The event heard
-
updateConditionalTableModel
void updateConditionalTableModel()
- Specified by:
updateConditionalTableModelin classConditionalList
-
editConditionalPressed
void editConditionalPressed(int rx)
Respond to Edit Button in the Conditional table of the Edit Logix Window.- Parameters:
rx- index (row number) of Conditional to be edited
-
reorderPressed
void reorderPressed(java.awt.event.ActionEvent e)
Respond to the Reorder Button in the Edit Logix pane.- Parameters:
e- The event heard
-
calculatePressed
void calculatePressed(java.awt.event.ActionEvent e)
Responds to the Calculate Button in the Edit Logix window.- Parameters:
e- The event heard
-
donePressed
void donePressed(java.awt.event.ActionEvent e)
Respond to the Done button in the Edit Logix window.Note: We also get here if the Edit Logix window is dismissed, or if the Add button is pressed in the Logic Table with an active Edit Logix window.
- Parameters:
e- The event heard
-
finishDone
void finishDone()
-
deletePressed
void deletePressed(java.awt.event.ActionEvent e)
Respond to the Delete button in the Edit Logix window.- Parameters:
e- The event heard
-
deleteConditionalPressed
void deleteConditionalPressed()
Respond to the Delete Conditional Button in the Edit Conditional window.
-
checkEditConditional
boolean checkEditConditional()
Check if edit of a conditional is in progress.- Returns:
- true if this is the case, after showing dialog to user
-
makeEditConditionalWindow
void makeEditConditionalWindow()
Create and/or initialize the Edit Conditional window.Note: you can get here via the New Conditional button (newConditionalPressed) or via an Edit button in the Conditional table of the Edit Logix window.
-
makeBottomPanel
javax.swing.JPanel makeBottomPanel()
Make the bottom panel for _conditionalFrame to hold buttons for Update/Save, Cancel, Delete/FullEdit- Specified by:
makeBottomPanelin classConditionalList- Returns:
- the panel
-
updateConditional
boolean updateConditional(java.lang.String uName, Conditional.AntecedentOperator logicType, boolean trigger, java.lang.String antecedent)
Description copied from class:ConditionalListUpdate _curConditional, the current Conditional. Checks for being well formed rules and registers its usage.- Specified by:
updateConditionalin classConditionalList- Parameters:
uName- Conditiona's user namelogicType- Logic type od antecedenttrigger- Trigger on variablr change action choiceantecedent- the antecedent- Returns:
- true, if update is made
-
closeConditionalFrame
void closeConditionalFrame()
- Specified by:
closeConditionalFramein classConditionalList
-
checkConditionalUserName
boolean checkConditionalUserName(java.lang.String uName)
-
swapConditional
void swapConditional(int row)
Respond to the First/Next (Delete/Reorder) Button in the ConditionalTableModel.- Parameters:
row- index of the row to put as next in line (instead of the one that was supposed to be next)
-
getClassName
protected java.lang.String getClassName()
- Overrides:
getClassNamein classConditionalList
-
-