Package jmri.jmrit.beantable
Class SignalGroupTableAction
- All Implemented Interfaces:
ActionListener,PropertyChangeListener,Serializable,Cloneable,EventListener,Action
public class SignalGroupTableAction
extends AbstractTableAction<SignalGroup>
implements PropertyChangeListener
Swing action to create and register a Signal Group Table.
Based in part on RouteTableAction.java by Bob Jacobsen
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassBase table model for managing generic Signal Group outputs.(package private) classTable Model to manage Signal Head outputs in a Signal Group.classTable Model for masts and their "Set To" aspect.Nested classes/interfaces inherited from class jmri.jmrit.beantable.AbstractTableAction
AbstractTableAction.TableItem<E extends NamedBean> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) SignalGroupTableAction.SignalMastAspectModel(package private) JCheckBox(package private) JScrollPane(package private) SignalGroupTableAction.SignalGroupSignalHeadModel(package private) JScrollPane(package private) JTextField(package private) JTextField(package private) JmriJFrame(package private) JRadioButton(package private) JButton(package private) static final String(package private) JButton(package private) static final String(package private) SignalGroup(package private) JButton(package private) JLabel(package private) JRadioButton(package private) boolean(package private) NamedBeanComboBox<SignalMast>(package private) JLabel(package private) JPanel(package private) JPanel(package private) JPanel(package private) UserPreferencesManager(package private) ButtonGroup(package private) boolean(package private) JmriJFrame(package private) JLabel(package private) JLabel(package private) String(package private) JButton(package private) static final String(package private) JLabelFields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, mFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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
ConstructorsConstructorDescriptionCreate an action with a specific title. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRespond to click on Add... button below Signal Group Table.(package private) void(package private) voidCancels edit mode(package private) voidWhen user clicks Cancel during editing a Signal Group, close the Add/Edit pane and reset default entries.(package private) SignalGroupCheck name and return a new or existing SignalGroup object with the name as entered in the _systemName field on the addFrame pane.(package private) booleanCheck name for a new SignalGroup object using the _systemName field on the addFrame pane.(package private) booleanCheck selection in Main Mast comboBox and store object as mMast for further calculations.protected voidCreate the JTable DataModel, along with the changes for the specific case of SignalGroups.(package private) voidRespond to the Create button.(package private) voidRespond to the Delete button in the Add/Edit pane.(package private) voidRespond to the Edit button in the Signal Group Table after creating the Add/Edit pane with AddPressed supplying _SystemName.(package private) voidClean up the Edit Signal Group pane.protected Stringprotected StringSpecify the JavaHelp target for this specific panel.(package private) voidInitialize list of included signal head appearances for when "Included" is selected.void(package private) voidsetColumnToHoldButton(JTable table, int column, JButton sample) (package private) intCheck all available Single Output Signal Heads against the list of signal head items registered with the group.(package private) voidStore included Aspects for the selected main Signal Mast in the Signal Groupvoid(package private) voidsetSignalStateBox(int mode, JComboBox<String> box) Set Appearance in a Signal Group Signal Head state comboBox.protected voidsetTitle()Include the correct title.(package private) voidLook up the list of valid Aspects for the selected main Signal Mast in the comboBox and store them in a table on the addFrame using _AspectModel(package private) voidsignalHeadEditPressed(int row) Open an editor to set the details of a Signal Head as part of a Signal Group when user clicks the Edit button in the Signal Head table in the lower half of the Edit Signal Group pane.(package private) intRead Appearance for a Signal Group Signal Head from the state comboBox.(package private) voidupdatePressed(ActionEvent e, boolean newSignalGroup, boolean close) Respond to the Update button on the Edit Signal Group pane - store new properties in the Signal Group.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, setManager, setMenuBarMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
_systemName
-
_userName
-
_autoSystemName
-
systemNameAuto
-
pref
-
addFrame
-
_SignalGroupHeadModel
-
_SignalGroupHeadScrollPane
-
_AspectModel
-
_SignalAppearanceScrollPane
-
mainSignalComboBox
-
selGroup
-
allButton
-
includedButton
-
nameLabel
-
userLabel
-
fixedSystemName
-
deleteButton
-
createButton
-
updateButton
-
cancelButton
-
createInst
-
updateInst
-
cancelInst
-
status1
-
status2
-
p2xs
-
p2xsi
-
p3xsi
-
curSignalGroup
-
signalGroupDirty
boolean signalGroupDirty -
inEditMode
boolean inEditMode -
signalHeadEditFrame
-
-
Constructor Details
-
SignalGroupTableAction
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
-
SignalGroupTableAction
public SignalGroupTableAction()
-
-
Method Details
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
createModel
Create the JTable DataModel, along with the changes for the specific case of SignalGroups.- Specified by:
createModelin classAbstractTableAction<SignalGroup>
-
setTitle
Description copied from class:AbstractTableActionInclude the correct title.- Specified by:
setTitlein classAbstractTableAction<SignalGroup>
-
helpTarget
Description copied from class:AbstractTableActionSpecify the JavaHelp target for this specific panel.- Overrides:
helpTargetin classAbstractTableAction<SignalGroup>- Returns:
- a fixed default string "index" pointing to to highest level in JMRI Help
-
signalStateFromBox
Read Appearance for a Signal Group Signal Head from the state comboBox.Called from SignalGroupSubTableAction.
- Parameters:
box- comboBox to read from- Returns:
- index representing selected set to appearance for head
-
setSignalStateBox
Set Appearance in a Signal Group Signal Head state comboBox. Called from SignalGroupSubTableAction- Parameters:
mode- Value to be setbox- in which to enter mode
-
addPressed
Respond to click on Add... button below Signal Group Table.Create JPanel with options for configuration.
- Specified by:
addPressedin classAbstractTableAction<SignalGroup>- Parameters:
e- Event from origin; null when called from Edit button in Signal Group Table row
-
autoSystemName
void autoSystemName() -
setColumnToHoldButton
-
initializeIncludedList
void initializeIncludedList()Initialize list of included signal head appearances for when "Included" is selected. -
createPressed
Respond to the Create button.- Parameters:
e- the action event
-
checkNewNamesOK
boolean checkNewNamesOK()Check name for a new SignalGroup object using the _systemName field on the addFrame pane. Not used when autoSystemName is checked.- Returns:
- whether name entered is allowed
-
checkValidSignalMast
boolean checkValidSignalMast()Check selection in Main Mast comboBox and store object as mMast for further calculations.- Returns:
- The new/updated SignalGroup object
-
checkNamesOK
Check name and return a new or existing SignalGroup object with the name as entered in the _systemName field on the addFrame pane.- Returns:
- The new/updated SignalGroup object
-
setHeadInformation
Check all available Single Output Signal Heads against the list of signal head items registered with the group. Updates the list, which is stored in the field _includedSignalHeadsList.- Parameters:
g- Signal Group object- Returns:
- The number of Signal Heads included in the group
-
setMastAspectInformation
Store included Aspects for the selected main Signal Mast in the Signal Group- Parameters:
g- Signal Group object
-
setValidSignalMastAspects
void setValidSignalMastAspects()Look up the list of valid Aspects for the selected main Signal Mast in the comboBox and store them in a table on the addFrame using _AspectModel -
cancelPressed
When user clicks Cancel during editing a Signal Group, close the Add/Edit pane and reset default entries.- Parameters:
e- Event from origin
-
cancelEdit
void cancelEdit()Cancels edit mode -
editPressed
Respond to the Edit button in the Signal Group Table after creating the Add/Edit pane with AddPressed supplying _SystemName. Hides the editable _systemName field on the Add Group pane and displays the value as a label instead.- Parameters:
e- Event from origin, null if invoked by clicking the Edit button in a Signal Group Table row
-
deletePressed
Respond to the Delete button in the Add/Edit pane.- Parameters:
e- the event heard
-
updatePressed
Respond to the Update button on the Edit Signal Group pane - store new properties in the Signal Group.- Parameters:
e- Event from origin, null if invoked by clicking the Edit button in a Signal Group Table rownewSignalGroup- False when called as Update, True after editing Signal Head detailsclose- True if the pane is closing, False if it stays open
-
finishUpdate
void finishUpdate()Clean up the Edit Signal Group pane. -
signalHeadEditPressed
Open an editor to set the details of a Signal Head as part of a Signal Group when user clicks the Edit button in the Signal Head table in the lower half of the Edit Signal Group pane. (renamed from signalEditPressed in 4.7.1 to explain what's in here)- Parameters:
row- Index of line clicked in the displayed Signal Head table- See Also:
-
getClassName
- Specified by:
getClassNamein classAbstractTableAction<SignalGroup>
-
getClassDescription
- Overrides:
getClassDescriptionin classAbstractTableAction<SignalGroup>
-
setMessagePreferencesDetails
- Overrides:
setMessagePreferencesDetailsin classAbstractTableAction<SignalGroup>
-