Package jmri.jmrit.beantable
Class LightTableAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
public class LightTableAction extends AbstractTableAction<Light>
Swing action to create and register a LightTable GUI.
Based on SignalHeadTableAction.java
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description (package private) JmriJFrame
addFrame
(package private) JCheckBox
addRangeBox
(package private) JButton
cancel
(package private) PropertyChangeListener
colorChangeListener
(package private) Manager<Light>
connectionChoice
(package private) JButton
create
(package private) Light
curLight
(package private) JTextField
hardwareAddressTextField
(package private) SystemNameValidator
hardwareAddressValidator
(package private) JLabel
labelNumToAdd
static String
lightControlTitle
(package private) boolean
lightCreatedOrUpdated
protected LightManager
lightManager
(package private) boolean
noWarn
(package private) JSpinner
numberToAdd
(package private) ManagerComboBox<Light>
prefixBox
(package private) SpinnerNumberModel
rangeSpinner
(package private) JLabel
status1
(package private) JLabel
status2
(package private) JLabel
systemLabel
(package private) JLabel
systemNameLabel
(package private) String
systemSelectionCombo
(package private) JTextField
userName
(package private) JLabel
userNameLabel
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
Constructors Constructor Description LightTableAction()
LightTableAction(String s)
Create an action with a specific title. -
Method Summary
Modifier and Type Method Description protected void
addPressed(ActionEvent e)
protected void
addRangeChanged()
(package private) void
cancelPressed(ActionEvent e)
Respond to the Cancel/Close button on the Add/Edit Light pane.protected void
createModel()
Create the JTable DataModel, along with the changes for the specific case of Lights.(package private) void
createPressed(ActionEvent e)
Create lights when the Create New button on the Add/Create pane is pressed and entry is valid.String
getClassDescription()
protected String
getClassName()
static String
getDescriptionText(LightControl lc, int type)
Get the description of the type of Light Control.(package private) void
handleCreateException(Exception ex, String sysName)
protected String
helpTarget()
Specify the JavaHelp target for this specific panel.protected void
prefixChanged()
void
setManager(Manager<Light> man)
If the subClass is being included in a greater tabbed frame, then this is used to specify which manager the subclass should be using.protected void
setTitle()
Include the correct title.(package private) boolean
supportsVariableLights()
Check if LightManager supports variable Lights.boolean
validatePhysicalTurnout(String inTurnoutName, Component inOpenPane)
Validates that a physical turnout exists.Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addToFrame, addToPanel, columnsVisibleUpdated, configureManagerComboBox, configureTable, displayHwError, dispose, getFrame, getManager, getPanel, getTableDataModel, includeAddButton, nextName, print, removePrefixBoxListener, setFrame, setMenuBar, setMessagePreferencesDetails
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
lightManager
-
addFrame
-
curLight
-
lightCreatedOrUpdated
boolean lightCreatedOrUpdated -
noWarn
boolean noWarn -
systemLabel
-
prefixBox
-
addRangeBox
-
hardwareAddressTextField
-
hardwareAddressValidator
-
rangeSpinner
-
numberToAdd
-
labelNumToAdd
-
systemSelectionCombo
-
systemNameLabel
-
userName
-
userNameLabel
-
create
-
cancel
-
colorChangeListener
-
status1
-
status2
-
connectionChoice
-
lightControlTitle
-
-
Constructor Details
-
LightTableAction
Create an action with a specific title.Note that the argument is the Action title, not the title of the resulting frame. Perhaps this should be changed?
- Parameters:
s
- title of the action
-
LightTableAction
public LightTableAction()
-
-
Method Details
-
setManager
If the subClass is being included in a greater tabbed frame, then this is used to specify which manager the subclass should be using.- Overrides:
setManager
in classAbstractTableAction<Light>
- Parameters:
man
- Manager for this table tab
-
createModel
Create the JTable DataModel, along with the changes for the specific case of Lights.- Specified by:
createModel
in classAbstractTableAction<Light>
-
setTitle
Include the correct title.- Specified by:
setTitle
in classAbstractTableAction<Light>
-
helpTarget
Specify the JavaHelp target for this specific panel.- Overrides:
helpTarget
in classAbstractTableAction<Light>
- Returns:
- a fixed default string "index" pointing to to highest level in JMRI Help
-
addPressed
- Specified by:
addPressed
in classAbstractTableAction<Light>
-
prefixChanged
-
addRangeChanged
-
supportsVariableLights
boolean supportsVariableLights()Check if LightManager supports variable Lights. TODO: Will only verify against formats which accept "11" as a Hardware address.- Returns:
- true if system can support variable lights.
-
createPressed
Create lights when the Create New button on the Add/Create pane is pressed and entry is valid.- Parameters:
e
- the button press action
-
handleCreateException
-
cancelPressed
Respond to the Cancel/Close button on the Add/Edit Light pane.- Parameters:
e
- the button press action
-
getDescriptionText
Get the description of the type of Light Control.- Parameters:
lc
- the light controltype
- the type of lc- Returns:
- description of the type of lc or an empty string if type is not recognized
-
validatePhysicalTurnout
Validates that a physical turnout exists.- Parameters:
inTurnoutName
- the (system or user) name of the turnoutinOpenPane
- the pane over which to show dialogs (null to suppress dialogs)- Returns:
- true if valid turnout was entered, false otherwise
-
getClassDescription
- Overrides:
getClassDescription
in classAbstractTableAction<Light>
-
getClassName
- Specified by:
getClassName
in classAbstractTableAction<Light>
-