Package jmri.jmrit.beantable
Class TurnoutTableAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.beantable.AbstractTableAction<Turnout>
-
- jmri.jmrit.beantable.TurnoutTableAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action
public class TurnoutTableAction extends AbstractTableAction<Turnout>
Swing action to create and register a TurnoutTable GUI.- 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) javax.swing.JButtonaddButton(package private) JmriJFrameaddFrame(package private) javax.swing.JTextFieldhardwareAddressTextField(package private) SystemNameValidatorhardwareAddressValidator(package private) javax.swing.JSpinnernumberToAddSpinner(package private) UserPreferencesManagerpref(package private) ManagerComboBox<Turnout>prefixBox(package private) javax.swing.JCheckBoxrangeBox(package private) javax.swing.SpinnerNumberModelrangeSpinner(package private) javax.swing.JLabelstatusBarLabel(package private) java.lang.StringsystemSelectionComboprotected TurnoutManagerturnoutManager(package private) javax.swing.JTextFielduserNameTextField-
Fields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, m
-
-
Constructor Summary
Constructors Constructor Description TurnoutTableAction()TurnoutTableAction(java.lang.String actionName)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)voidaddToFrame(BeanTableFrame<Turnout> f)Add the check boxes to show/hide extra columns to the Turnout table frame.voidaddToPanel(AbstractTableTabAction<Turnout> f)Place the check boxes to show/hide extra columns to the tabbed Turnout table panel.(package private) voidcancelPressed(java.awt.event.ActionEvent e)protected voidcolumnsVisibleUpdated(boolean[] colsVisible)Override to update column select checkboxes.protected voidconfigureTable(javax.swing.JTable table)Perform configuration of the JTable as required by a specific TableAction.protected voidcreateModel()Create the JTable DataModel, along with the changes for the specific case of Turnouts.(package private) voidcreatePressed(java.awt.event.ActionEvent e)Respond to Create new item button pressed on Add Turnout pane.java.lang.StringgetClassDescription()protected java.lang.StringgetClassName()(package private) voidhandleCreateException(java.lang.Exception ex, java.lang.String sysName)protected java.lang.StringhelpTarget()Specify the JavaHelp target for this specific panel.protected voidsetDefaultSpeeds(javax.swing.JFrame _who)Show a pane to configure closed and thrown turnout speed defaults.voidsetManager(Manager<Turnout> 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.voidsetMenuBar(BeanTableFrame<Turnout> f)Insert table specific Automation and Speeds menus.voidsetMessagePreferencesDetails()protected voidsetTitle()Include the correct title.static voidupdateAutomationBox(Turnout t, javax.swing.JComboBox<java.lang.String> cb)Add the content and make the appropriate selection to a combo box for a turnout's automation choices.-
Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addBottomButtons, addToFrame, configureManagerComboBox, displayHwError, dispose, getDataModel, getFrame, getManager, getPanel, getTableDataModel, includeAddButton, nextName, print, removePrefixBoxListener, setFrame
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
turnoutManager
protected TurnoutManager turnoutManager
-
addFrame
JmriJFrame addFrame
-
hardwareAddressTextField
javax.swing.JTextField hardwareAddressTextField
-
userNameTextField
javax.swing.JTextField userNameTextField
-
prefixBox
ManagerComboBox<Turnout> prefixBox
-
rangeSpinner
javax.swing.SpinnerNumberModel rangeSpinner
-
numberToAddSpinner
javax.swing.JSpinner numberToAddSpinner
-
rangeBox
javax.swing.JCheckBox rangeBox
-
systemSelectionCombo
java.lang.String systemSelectionCombo
-
addButton
javax.swing.JButton addButton
-
statusBarLabel
javax.swing.JLabel statusBarLabel
-
hardwareAddressValidator
SystemNameValidator hardwareAddressValidator
-
-
Constructor Detail
-
TurnoutTableAction
public TurnoutTableAction(java.lang.String actionName)
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:
actionName- title of the action
-
TurnoutTableAction
public TurnoutTableAction()
-
-
Method Detail
-
setManager
public void setManager(@Nonnull Manager<Turnout> 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<Turnout>- Parameters:
man- Manager for this table tab
-
createModel
protected void createModel()
Create the JTable DataModel, along with the changes for the specific case of Turnouts.- Specified by:
createModelin classAbstractTableAction<Turnout>
-
setTitle
protected void setTitle()
Include the correct title.- Specified by:
setTitlein classAbstractTableAction<Turnout>
-
helpTarget
protected java.lang.String helpTarget()
Specify the JavaHelp target for this specific panel.- Overrides:
helpTargetin classAbstractTableAction<Turnout>- 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<Turnout>
-
updateAutomationBox
public static void updateAutomationBox(Turnout t, javax.swing.JComboBox<java.lang.String> cb)
Add the content and make the appropriate selection to a combo box for a turnout's automation choices.- Parameters:
t- turnoutcb- the JComboBox
-
setDefaultSpeeds
protected void setDefaultSpeeds(javax.swing.JFrame _who)
Show a pane to configure closed and thrown turnout speed defaults.- Parameters:
_who- parent JFrame to center the pane on
-
configureTable
protected void configureTable(javax.swing.JTable table)
Description copied from class:AbstractTableActionPerform configuration of the JTable as required by a specific TableAction.- Overrides:
configureTablein classAbstractTableAction<Turnout>- Parameters:
table- The table to configure.
-
addToFrame
public void addToFrame(BeanTableFrame<Turnout> f)
Add the check boxes to show/hide extra columns to the Turnout table frame.Keep contents synchronized with
addToPanel(AbstractTableTabAction)- Overrides:
addToFramein classAbstractTableAction<Turnout>- Parameters:
f- a Turnout table frame
-
addToPanel
public void addToPanel(AbstractTableTabAction<Turnout> f)
Place the check boxes to show/hide extra columns to the tabbed Turnout table panel.Keep contents synchronized with
addToFrame(BeanTableFrame)- Overrides:
addToPanelin classAbstractTableAction<Turnout>- Parameters:
f- a Turnout table action
-
columnsVisibleUpdated
protected void columnsVisibleUpdated(boolean[] colsVisible)
Override to update column select checkboxes. Notification that column visibility for the JTable has updated.This is overridden by classes which have column visibility Checkboxes on bottom bar.
Called on table startup and whenever a column goes hidden / visible.
- Overrides:
columnsVisibleUpdatedin classAbstractTableAction<Turnout>- Parameters:
colsVisible- array of ALL table columns and their visibility status in order of main Table Model, NOT XTableColumnModel.
-
setMenuBar
public void setMenuBar(BeanTableFrame<Turnout> f)
Insert table specific Automation and Speeds menus. Account for the Window and Help menus, which are already added to the menu bar as part of the creation of the JFrame, by adding the Automation menu 2 places earlier unless the table is part of the ListedTableFrame, that adds the Help menu later on.- Overrides:
setMenuBarin classAbstractTableAction<Turnout>- Parameters:
f- the JFrame of this table
-
cancelPressed
void cancelPressed(java.awt.event.ActionEvent e)
-
createPressed
void createPressed(java.awt.event.ActionEvent e)
Respond to Create new item button pressed on Add Turnout pane.- Parameters:
e- the click event
-
handleCreateException
void handleCreateException(java.lang.Exception ex, java.lang.String sysName)
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassNamein classAbstractTableAction<Turnout>
-
setMessagePreferencesDetails
public void setMessagePreferencesDetails()
- Overrides:
setMessagePreferencesDetailsin classAbstractTableAction<Turnout>
-
getClassDescription
public java.lang.String getClassDescription()
- Overrides:
getClassDescriptionin classAbstractTableAction<Turnout>
-
-