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) JmriJFrameaddFrame(package private) javax.swing.JCheckBoxaddRangeBox(package private) javax.swing.JButtoncancel(package private) java.beans.PropertyChangeListenercolorChangeListener(package private) Manager<Light>connectionChoice(package private) javax.swing.JButtoncreate(package private) LightcurLight(package private) javax.swing.JTextFieldhardwareAddressTextField(package private) SystemNameValidatorhardwareAddressValidator(package private) javax.swing.JLabellabelNumToAddstatic java.lang.StringlightControlTitle(package private) booleanlightCreatedOrUpdatedprotected LightManagerlightManager(package private) booleannoWarn(package private) javax.swing.JSpinnernumberToAdd(package private) ManagerComboBox<Light>prefixBox(package private) javax.swing.SpinnerNumberModelrangeSpinner(package private) javax.swing.JLabelstatus1(package private) javax.swing.JLabelstatus2(package private) javax.swing.JLabelsystemLabel(package private) javax.swing.JLabelsystemNameLabel(package private) java.lang.StringsystemSelectionCombo(package private) javax.swing.JTextFielduserName(package private) javax.swing.JLabeluserNameLabel-
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 voidaddPressed(java.awt.event.ActionEvent e)protected voidaddRangeChanged()(package private) voidcancelPressed(java.awt.event.ActionEvent e)Respond to the Cancel/Close button on the Add/Edit Light pane.protected voidcreateModel()Create the JTable DataModel, along with the changes for the specific case of Lights.(package private) voidcreatePressed(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.StringgetClassDescription()protected java.lang.StringgetClassName()static java.lang.StringgetDescriptionText(LightControl lc, int type)Get the description of the type of Light Control.(package private) voidhandleCreateException(java.lang.Exception ex, java.lang.String sysName)protected java.lang.StringhelpTarget()Specify the JavaHelp target for this specific panel.protected voidprefixChanged()voidsetManager(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.voidsetMessagePreferencesDetails()protected voidsetTitle()Include the correct title.(package private) booleansupportsVariableLights()Check if LightManager supports variable Lights.booleanvalidatePhysicalTurnout(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:
setManagerin 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:
createModelin classAbstractTableAction<Light>
-
setTitle
protected void setTitle()
Include the correct title.- Specified by:
setTitlein classAbstractTableAction<Light>
-
helpTarget
protected java.lang.String helpTarget()
Specify the JavaHelp target for this specific panel.- Overrides:
helpTargetin 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:
addPressedin 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:
getClassDescriptionin classAbstractTableAction<Light>
-
setMessagePreferencesDetails
public void setMessagePreferencesDetails()
- Overrides:
setMessagePreferencesDetailsin classAbstractTableAction<Light>
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassNamein classAbstractTableAction<Light>
-
-