|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractAction
jmri.jmrit.beantable.AbstractTableAction
jmri.jmrit.beantable.LogixTableAction
public class LogixTableAction
Swing action to create and register a Logix Table.
Also contains the windows to create, edit, and delete a Logix. Also contains the window to define and edit a Conditional.
Most of the text used in this GUI is in LogixTableBundle.properties, accessed via rbx, and the remainder of the text is in BeanTableBundle.properties, accessed via rb. Methods and Members for 'state variables' and 'actions' removed to become their own objects - 'ConditionalVariable' and 'ConditionalAction' in jmri package. Two more types of logic for a Conditional to use in its antecedent have been added to the original 'AND'ing all statevariables - 'OR' (i.e. all OR's) and 'MIXED' (i.e. general boolean statement with any mixture of boolean operations). The 'OR's an 'AND's types are unambiguous and do not require parentheses. The 'Mixed' type uses a TextField for the user to insert parenthees. Jan 22, 2009 - Pete Cressman Conditionals now have two policies to trigger execution of their action lists. 1. the previous policy - Trigger on change of state only 2. the new default - Trigger on any enabled state calculation Jan 15, 2011 - Pete Cressman
| Nested Class Summary | |
|---|---|
class |
LogixTableAction.ActionTableModel
Table model for Actions in Edit Conditional window |
(package private) class |
LogixTableAction.ActionTypeListener
|
class |
LogixTableAction.ConditionalTableModel
Table model for Conditionals in Edit Logix window |
(package private) class |
LogixTableAction.RefDialog
|
class |
LogixTableAction.VariableTableModel
Table model for State Variables in Edit Conditional window |
| Fields inherited from class jmri.jmrit.beantable.AbstractTableAction |
|---|
f, includeAddButton, m, rb, rbean |
| Fields inherited from class javax.swing.AbstractAction |
|---|
changeSupport, enabled |
| Fields inherited from interface javax.swing.Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
LogixTableAction()
|
|
LogixTableAction(String s)
Create an action with a specific title. |
|
| Method Summary | |
|---|---|
(package private) void |
actionItemChanged(int type)
Responds to a change in an Action Type Box of Edit Action Window Set components visible for the selected type |
(package private) void |
addActionPressed(ActionEvent e)
|
protected void |
addPressed(ActionEvent e)
Responds to the Add button in Logix table Creates and/or initializes the Add Logix window |
(package private) void |
addVariablePressed(ActionEvent e)
Responds to the Add State Variable Button in the Edit Conditional window |
(package private) boolean |
alreadyEditingActionOrVariable()
Methods for Edit Variable Window |
(package private) void |
appendToAntecedent(ConditionalVariable variable)
|
(package private) void |
autoSystemName()
|
(package private) void |
calculatePressed(ActionEvent e)
Responds to the Calculate Button in the Edit Logix window |
(package private) void |
cancelAddPressed(ActionEvent e)
Responds to the Cancel button in Add Logix window Note: Also get there if the user closes the Add Logix window |
(package private) void |
cancelConditionalPressed(ActionEvent e)
Responds to the Cancel button in the Edit Conditional frame Does the cleanup from deleteConditionalPressed, updateConditionalPressed and editConditionalFrame window closer. |
(package private) void |
cancelEditActionPressed()
|
(package private) void |
cancelEditVariablePressed()
|
(package private) boolean |
checkConditionalSystemName(String sName)
|
(package private) boolean |
checkConditionalUserName(String uName,
Logix logix)
|
(package private) boolean |
checkEditConditional()
Checks if edit of a conditional is in progress Returns true after sending message if this is the case |
(package private) boolean |
checkFlags(String sName)
|
(package private) boolean |
checkLogixSysName()
|
(package private) boolean |
checkLogixUserName(String uName)
|
(package private) void |
checkVariablePressed(ActionEvent e)
Responds to the Check State Variable Button in the Edit Conditional window |
(package private) void |
cleanUpAction()
|
(package private) void |
cleanUpVariable()
|
(package private) void |
copyConditionalToLogix(String cSysName,
Logix srcLogix,
Logix targetLogix)
|
(package private) void |
copyLogixPressed(ActionEvent e)
|
(package private) void |
copyPressed(String sName)
|
protected void |
createModel()
Create the JTable DataModel, along with the changes (overrides of BeanTableDataModel) for the specific case of a Logix table. |
(package private) void |
createPressed(ActionEvent e)
Responds to the Create Logix button in Add Logix window |
(package private) void |
deleteActionPressed()
|
(package private) void |
deleteActionPressed(int row)
|
(package private) void |
deleteConditionalPressed(String sName)
Responds to the Delete Conditional Button in the Edit Conditional window |
(package private) void |
deletePressed(ActionEvent e)
Responds to the Delete button in the Edit Logix window |
(package private) void |
deletePressed(String sName)
Responds to the Delete combo selection Logix window |
(package private) void |
deleteVariablePressed()
|
(package private) void |
deleteVariablePressed(int row)
Responds to the Delete Button in the State Variable Table of the Edit Conditional window |
(package private) void |
displayBadIntegerReference(int actionType)
|
(package private) void |
donePressed(ActionEvent e)
Responds to the Done button in the Edit Logix window Note: 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. |
(package private) void |
editConditionalPressed(int rx)
Responds to Edit Button in the Conditional table of the Edit Logix Window |
(package private) void |
editPressed(String sName)
Responds to the Edit button pressed in Logix table |
(package private) void |
enableAll(boolean enable)
|
(package private) void |
findEmptyPressed(ActionEvent e)
|
(package private) void |
findOrphansPressed(ActionEvent e)
|
(package private) void |
finishDone()
|
static String |
formatTime(int hour,
int minute)
Formats time to hh:mm given integer hour and minute |
(package private) int |
getActionTypeFromBox(int itemType,
int actionTypeSelection)
|
String |
getClassDescription()
|
protected String |
getClassName()
|
(package private) Light |
getLight(String name)
get Light instance. |
(package private) void |
helpPressed(ActionEvent e)
|
protected String |
helpTarget()
Specify the JavaHelp target for this specific panel |
(package private) void |
initializeActionVariables()
|
(package private) void |
initializeStateVariables()
set display to show current state variable (curVariable) parameters |
(package private) void |
loadJComboBoxWithMastAspects(JComboBox box,
String mastName)
|
(package private) void |
loadJComboBoxWithSignalAspects(JComboBox box,
String signalName)
|
(package private) boolean |
logicTypeChanged(ActionEvent e)
|
(package private) JPanel |
makeAddLogixFrame(String titleId,
String messageId)
shared method for window to create or copy Logix Returns the button panel |
(package private) void |
makeAntecedent()
build the antecedent statement |
(package private) JPanel |
makeButtonPanel(ActionListener updateListener,
ActionListener cancelListener,
ActionListener deleteListener)
Utility for making Variable and Action editing Windows |
(package private) void |
makeEditActionWindow(int row)
Creates and/or initializes the Edit Action window Note: you can get here via the New Action button (addActionPressed) or via an Edit button in the Action table of the EditConditional window. |
(package private) void |
makeEditConditionalWindow()
Creates and/or initializes 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. |
(package private) void |
makeEditLogixWindow()
creates and/or initializes the Edit Logix window |
(package private) JPanel |
makeEditPanel(JComponent comp,
String label,
String hint)
Utility for making Variable and Action editing Windows |
(package private) void |
makeEditVariableWindow(int row)
Creates and/or initializes the Edit a Variable window Note: you can get here via the New Variable button (addVariablePressed) or via an Edit button in the Variable table of the EditConditional window. |
(package private) JPanel |
makeTopPanel(JFrame frame,
String title,
int width,
int height)
Utility for making Variable and Action editing Windows |
(package private) void |
messageDuplicateConditionalUserName(String svName)
Sends a duplicate Conditional user name message for Edit Logix window |
(package private) void |
messageInvalidActionItemName(String name,
String itemType)
|
(package private) void |
messageInvalidSignalHeadAppearance(String name,
String appearance)
Error Dialogs |
(package private) void |
newConditionalPressed(ActionEvent e)
Responds to the New Conditional Button in Edit Logix Window |
(package private) void |
OpenPickListTable()
|
(package private) int |
parseTime(String s)
|
(package private) void |
reorderActionPressed(ActionEvent e)
Responds to the Reorder Button in the Edit Conditional window |
(package private) void |
reorderPressed(ActionEvent e)
Responds to the Reorder Button in the Edit Logix window |
(package private) void |
setFileLocation(ActionEvent e)
Responds to the Set button in the Edit Action window action section. |
void |
setMenuBar(BeanTableFrame f)
Allow subclasses to add alter the frames Menubar without have to actually subclass the BeanTableDataFrame |
void |
setMessagePreferencesDetails()
|
protected void |
setTitle()
Include the correct title |
(package private) void |
showSaveReminder()
Display reminder to save |
(package private) void |
swapActions(int row)
Responds to the First/Next (Delete) Button in the Edit Conditional window |
(package private) void |
swapConditional(int row)
Responds to the First/Next (Delete) Button in the Edit Logix window |
(package private) void |
updateActionPressed()
Responses for Edit Action and Edit Variable Buttons |
(package private) void |
updateConditionalPressed(ActionEvent e)
Responds to the Update Conditional Button in the Edit Conditional window |
(package private) void |
updateVariablePressed()
|
(package private) boolean |
validateAction()
Validates Action data from Edit Action Window, and transfers it to current action object as appropriate Returns true if all data checks out OK, otherwise false. |
(package private) boolean |
validateAntecedent()
Check the antecedent and logic type |
(package private) String |
validateAudioReference(String name)
|
(package private) String |
validateConditionalReference(String name)
Checks Conditional reference of text. |
(package private) String |
validateEntryExitReference(String name)
|
(package private) boolean |
validateInteger(int actionType,
int time)
Checks text represents an integer suitable for timing throws NumberFormatException |
(package private) boolean |
validateIntegerReference(int actionType,
String intReference)
Checks if String is an integer or references an integer |
(package private) String |
validateLightReference(String name)
Checks Light reference of text. |
(package private) String |
validateLogixReference(String name)
Checks Logix reference of text. |
(package private) String |
validateMemoryReference(String name)
Checks Memory reference of text. |
(package private) String |
validateOBlockReference(String name)
|
(package private) String |
validateRouteReference(String name)
Checks Route reference of text. |
(package private) String |
validateSensorReference(String name)
Checks Sensor reference of text. |
(package private) String |
validateSignalHeadReference(String name)
Checks SignalHead reference of text. |
(package private) String |
validateSignalMastReference(String name)
Checks SignalMast reference of text. |
(package private) String |
validateTurnoutReference(String name)
Checks Turnout reference of text. |
(package private) boolean |
validateVariable()
Validates Variable data from Edit Variable Window, and transfers it to current action object as appropriate Returns true if all data checks out OK, otherwise false. |
(package private) String |
validateWarrantReference(String name)
|
(package private) void |
variableNegationChanged(int row,
String oper)
Responds to the Negation column in the Edit Conditional window |
(package private) void |
variableOperatorChanged(int row,
String oper)
Responds to the Operator column in the Edit Conditional window |
| Methods inherited from class jmri.jmrit.beantable.AbstractTableAction |
|---|
actionPerformed, addToFrame, addToPanel, dispose, getPanel, getTableDataModel, includeAddButton, print, setFrame, setManager |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final ResourceBundle rbx
ConditionalManager _conditionalManager
LogixManager _logixManager
boolean _showReminder
boolean _suppressReminder
boolean _suppressIndirectRef
PickFrame _pickTables
Logix _curLogix
int numConditionals
int conditionalRowNumber
Conditional _curConditional
JmriJFrame addLogixFrame
JTextField _systemName
JTextField _addUserName
JCheckBox _autoSystemName
JLabel _sysNameLabel
JLabel _userNameLabel
UserPreferencesManager prefMgr
String systemNameAuto
JButton create
JmriJFrame editLogixFrame
boolean inEditMode
boolean inCopyMode
boolean _inReorderMode
int _nextInOrder
JTextField editUserName
LogixTableAction.ConditionalTableModel conditionalTableModel
JLabel status
boolean inEditConditionalMode
JmriJFrame editConditionalFrame
JTextField conditionalUserName
JmriJFrame _editVariableFrame
JComboBox _variableTypeBox
JTextField _variableNameField
JComboBox _variableStateBox
JComboBox _variableCompareOpBox
JComboBox _variableSignalBox
JComboBox _variableCompareTypeBox
JTextField _variableData1Field
JTextField _variableData2Field
JPanel _variableNamePanel
JPanel _variableStatePanel
JPanel _variableComparePanel
JPanel _variableSignalPanel
JPanel _variableData1Panel
JPanel _variableData2Panel
JmriJFrame _editActionFrame
JComboBox _actionItemTypeBox
JComboBox _actionTypeBox
JComboBox _actionBox
JTextField _actionNameField
JTextField _longActionString
JTextField _shortActionString
JComboBox _actionOptionBox
JPanel _actionPanel
JPanel _actionTypePanel
JPanel _namePanel
JPanel _shortTextPanel
JPanel _optionPanel
JButton _actionSetButton
JPanel _setPanel
JPanel _textPanel
LogixTableAction.ActionTypeListener _actionTypeListener
static final int STRUT
String _logixSysName
JFileChooser sndFileChooser
JFileChooser scriptFileChooser
JFileChooser defaultFileChooser
transient ActionListener variableSignalTestStateListener
transient ActionListener variableSignalHeadNameListener
transient ActionListener actionSignalHeadNameListener
transient ActionListener variableSignalMastNameListener
transient ActionListener actionSignalMastNameListener
static final org.slf4j.Logger log
| Constructor Detail |
|---|
public LogixTableAction(String s)
Note that the argument is the Action title, not the title of the resulting frame. Perhaps this should be changed?
s - public LogixTableAction()
| Method Detail |
|---|
protected void createModel()
createModel in class AbstractTableActionprotected void setTitle()
AbstractTableAction
setTitle in class AbstractTableActionpublic void setMenuBar(BeanTableFrame f)
AbstractTableAction
setMenuBar in class AbstractTableActionvoid OpenPickListTable()
void findEmptyPressed(ActionEvent e)
void findOrphansPressed(ActionEvent e)
void enableAll(boolean enable)
protected String helpTarget()
AbstractTableAction
helpTarget in class AbstractTableActionprotected void addPressed(ActionEvent e)
addPressed in class AbstractTableAction
JPanel makeAddLogixFrame(String titleId,
String messageId)
void autoSystemName()
void cancelAddPressed(ActionEvent e)
void copyPressed(String sName)
void copyLogixPressed(ActionEvent e)
void copyConditionalToLogix(String cSysName,
Logix srcLogix,
Logix targetLogix)
boolean checkLogixUserName(String uName)
boolean checkLogixSysName()
boolean checkFlags(String sName)
void createPressed(ActionEvent e)
void editPressed(String sName)
void makeEditLogixWindow()
void showSaveReminder()
void reorderPressed(ActionEvent e)
void swapConditional(int row)
void calculatePressed(ActionEvent e)
void donePressed(ActionEvent e)
void finishDone()
public void setMessagePreferencesDetails()
setMessagePreferencesDetails in class AbstractTableActionvoid deletePressed(String sName)
void deletePressed(ActionEvent e)
void newConditionalPressed(ActionEvent e)
void editConditionalPressed(int rx)
boolean checkEditConditional()
boolean checkConditionalUserName(String uName,
Logix logix)
boolean checkConditionalSystemName(String sName)
void makeEditConditionalWindow()
void addVariablePressed(ActionEvent e)
void checkVariablePressed(ActionEvent e)
void variableNegationChanged(int row,
String oper)
void variableOperatorChanged(int row,
String oper)
void addActionPressed(ActionEvent e)
void reorderActionPressed(ActionEvent e)
void swapActions(int row)
void updateConditionalPressed(ActionEvent e)
void cancelConditionalPressed(ActionEvent e)
void deleteConditionalPressed(String sName)
boolean logicTypeChanged(ActionEvent e)
void helpPressed(ActionEvent e)
void makeAntecedent()
void appendToAntecedent(ConditionalVariable variable)
boolean validateAntecedent()
boolean alreadyEditingActionOrVariable()
void makeEditVariableWindow(int row)
void makeEditActionWindow(int row)
JPanel makeTopPanel(JFrame frame,
String title,
int width,
int height)
JPanel makeEditPanel(JComponent comp,
String label,
String hint)
JPanel makeButtonPanel(ActionListener updateListener,
ActionListener cancelListener,
ActionListener deleteListener)
void updateActionPressed()
void updateVariablePressed()
void cancelEditActionPressed()
void cleanUpAction()
void cancelEditVariablePressed()
void cleanUpVariable()
void deleteActionPressed()
void deleteActionPressed(int row)
void deleteVariablePressed()
void deleteVariablePressed(int row)
void initializeStateVariables()
void initializeActionVariables()
void setFileLocation(ActionEvent e)
void actionItemChanged(int type)
void loadJComboBoxWithSignalAspects(JComboBox box,
String signalName)
void loadJComboBoxWithMastAspects(JComboBox box,
String mastName)
boolean validateVariable()
Returns true if all data checks out OK, otherwise false.
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.
boolean validateAction()
Returns true if all data checks out OK, otherwise false.
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.
int getActionTypeFromBox(int itemType,
int actionTypeSelection)
boolean validateIntegerReference(int actionType,
String intReference)
boolean validateInteger(int actionType,
int time)
void displayBadIntegerReference(int actionType)
String validateMemoryReference(String name)
String validateTurnoutReference(String name)
String validateSignalHeadReference(String name)
String validateSignalMastReference(String name)
String validateWarrantReference(String name)
String validateOBlockReference(String name)
String validateSensorReference(String name)
String validateLightReference(String name)
String validateConditionalReference(String name)
String validateLogixReference(String name)
String validateRouteReference(String name)
String validateAudioReference(String name)
String validateEntryExitReference(String name)
Light getLight(String name)
int parseTime(String s)
public static String formatTime(int hour,
int minute)
void messageInvalidSignalHeadAppearance(String name,
String appearance)
void messageInvalidActionItemName(String name,
String itemType)
void messageDuplicateConditionalUserName(String svName)
public String getClassDescription()
getClassDescription in class AbstractTableActionprotected String getClassName()
getClassName in class AbstractTableAction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||