Package jmri.jmrit.beantable
Class LightTableAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.beantable.AbstractTableAction<Light>
-
- jmri.jmrit.beantable.LightTableAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class LightTableAction extends AbstractTableAction<Light>
Swing action to create and register a LightTable GUI.Based on SignalHeadTableAction.java
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.AbstractTableAction
AbstractTableAction.TableItem<E extends NamedBean>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) JmriJFrame
addFrame
(package private) javax.swing.JCheckBox
addRangeBox
(package private) javax.swing.JButton
cancel
(package private) java.beans.PropertyChangeListener
colorChangeListener
(package private) Manager<Light>
connectionChoice
(package private) javax.swing.JButton
create
(package private) Light
curLight
(package private) javax.swing.JTextField
hardwareAddressTextField
(package private) SystemNameValidator
hardwareAddressValidator
(package private) javax.swing.JLabel
labelNumToAdd
static java.lang.String
lightControlTitle
(package private) boolean
lightCreatedOrUpdated
protected LightManager
lightManager
(package private) boolean
noWarn
(package private) javax.swing.JSpinner
numberToAdd
(package private) ManagerComboBox<Light>
prefixBox
(package private) javax.swing.SpinnerNumberModel
rangeSpinner
(package private) javax.swing.JLabel
status1
(package private) javax.swing.JLabel
status2
(package private) javax.swing.JLabel
systemLabel
(package private) javax.swing.JLabel
systemNameLabel
(package private) java.lang.String
systemSelectionCombo
(package private) javax.swing.JTextField
userName
(package private) javax.swing.JLabel
userNameLabel
-
Fields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, m
-
-
Constructor Summary
Constructors Constructor Description LightTableAction()
LightTableAction(java.lang.String s)
Create an action with a specific title.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPressed(java.awt.event.ActionEvent e)
protected void
addRangeChanged()
(package private) void
cancelPressed(java.awt.event.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(java.awt.event.ActionEvent e)
Create lights when the Create New button on the Add/Create pane is pressed and entry is valid.java.lang.String
getClassDescription()
protected java.lang.String
getClassName()
static java.lang.String
getDescriptionText(LightControl lc, int type)
Get the description of the type of Light Control.(package private) void
handleCreateException(java.lang.Exception ex, java.lang.String sysName)
protected java.lang.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.void
setMessagePreferencesDetails()
protected void
setTitle()
Include the correct title.(package private) boolean
supportsVariableLights()
Check if LightManager supports variable Lights.boolean
validatePhysicalTurnout(java.lang.String inTurnoutName, java.awt.Component inOpenPane)
Validates that a physical turnout exists.-
Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addBottomButtons, addToFrame, addToFrame, addToPanel, columnsVisibleUpdated, configureManagerComboBox, configureTable, displayHwError, dispose, getDataModel, getFrame, getManager, getPanel, getTableDataModel, includeAddButton, nextName, print, removePrefixBoxListener, setFrame, setMenuBar
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
lightManager
protected LightManager lightManager
-
addFrame
JmriJFrame addFrame
-
lightCreatedOrUpdated
boolean lightCreatedOrUpdated
-
noWarn
boolean noWarn
-
systemLabel
javax.swing.JLabel systemLabel
-
prefixBox
ManagerComboBox<Light> prefixBox
-
addRangeBox
javax.swing.JCheckBox addRangeBox
-
hardwareAddressTextField
javax.swing.JTextField hardwareAddressTextField
-
hardwareAddressValidator
SystemNameValidator hardwareAddressValidator
-
rangeSpinner
javax.swing.SpinnerNumberModel rangeSpinner
-
numberToAdd
javax.swing.JSpinner numberToAdd
-
labelNumToAdd
javax.swing.JLabel labelNumToAdd
-
systemSelectionCombo
java.lang.String systemSelectionCombo
-
systemNameLabel
javax.swing.JLabel systemNameLabel
-
userName
javax.swing.JTextField userName
-
userNameLabel
javax.swing.JLabel userNameLabel
-
create
javax.swing.JButton create
-
cancel
javax.swing.JButton cancel
-
colorChangeListener
java.beans.PropertyChangeListener colorChangeListener
-
status1
javax.swing.JLabel status1
-
status2
javax.swing.JLabel status2
-
connectionChoice
Manager<Light> connectionChoice
-
lightControlTitle
public static java.lang.String lightControlTitle
-
-
Constructor Detail
-
LightTableAction
public LightTableAction(java.lang.String s)
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 Detail
-
setManager
public void setManager(@Nonnull 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.- Overrides:
setManager
in classAbstractTableAction<Light>
- Parameters:
man
- Manager for this table tab
-
createModel
protected void createModel()
Create the JTable DataModel, along with the changes for the specific case of Lights.- Specified by:
createModel
in classAbstractTableAction<Light>
-
setTitle
protected void setTitle()
Include the correct title.- Specified by:
setTitle
in classAbstractTableAction<Light>
-
helpTarget
protected java.lang.String 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
protected void addPressed(java.awt.event.ActionEvent e)
- Specified by:
addPressed
in classAbstractTableAction<Light>
-
prefixChanged
protected void prefixChanged()
-
addRangeChanged
protected void 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
void createPressed(java.awt.event.ActionEvent e)
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
void handleCreateException(java.lang.Exception ex, java.lang.String sysName)
-
cancelPressed
void cancelPressed(java.awt.event.ActionEvent e)
Respond to the Cancel/Close button on the Add/Edit Light pane.- Parameters:
e
- the button press action
-
getDescriptionText
public static java.lang.String getDescriptionText(LightControl lc, int type)
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
public boolean validatePhysicalTurnout(java.lang.String inTurnoutName, java.awt.Component inOpenPane)
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
public java.lang.String getClassDescription()
- Overrides:
getClassDescription
in classAbstractTableAction<Light>
-
setMessagePreferencesDetails
public void setMessagePreferencesDetails()
- Overrides:
setMessagePreferencesDetails
in classAbstractTableAction<Light>
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassName
in classAbstractTableAction<Light>
-
-