Package jmri.jmrit.beantable
Class SignalGroupSubTableAction
java.lang.Object
jmri.jmrit.beantable.SignalGroupSubTableAction
Swing action to create and register a SignalGroup - Signal Head Edit Table.
Based in part on RouteTableAction.java and SignalGroupTableAction.java by Bob Jacobsen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassBase table model for selecting Signal Group Head control Conditionals(package private) classSet up a table for selecting Sensors and Sensor On State as Conditionals for a Signal Group Signal Head member.(package private) classTable model for selecting Turnouts and their On State as Conditionals for a Signal Group Signal Head member. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) SignalGroupSubTableAction.SignalGroupSensorModel(package private) JScrollPane(package private) SignalGroupSubTableAction.SignalGroupTurnoutModel(package private) JScrollPane(package private) JLabel(package private) JmriJFrame(package private) JRadioButton(package private) JButton(package private) String(package private) SignalGroup(package private) SignalHead(package private) JRadioButton(package private) JLabel(package private) JPanel(package private) JPanel(package private) ButtonGroup(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) static String(package private) JButton(package private) JLabel -
Constructor Summary
ConstructorsConstructorDescriptionCreate an action with a specific title. -
Method Summary
Modifier and TypeMethodDescription(package private) voidCancel included Turnouts and Sensors only option(package private) voidCancel edit mode(package private) voidRespond to the Cancel button - clean up.(package private) voideditHead(SignalGroup g, String headName) Open an editor to set the details of a Signal Head as part of a Signal Group.(package private) voidClean up the interface and reset Included radio button to All for next use(package private) intheadStateFromBox(JComboBox<String> box) Get the user choice for a Signal Group Signal Head's On and Off Appearance from a comboBox at the top of the Edit Head sub pane.(package private) String(package private) voidInitialize the list of included turnouts and sensors for a Signal Head item on the sub pane.(package private) booleanoperFromBox(JComboBox<String> box) Get the user choice for conditional evaluation.(package private) intsensorModeFromBox(JComboBox<String> box) Get the user choice for a Sensor conditional's On state from the comboBox on the Edit Head sub pane.(package private) voidsetoperBox(boolean mode, JComboBox<String> box) Set choice for conditional evaluation.(package private) intSet the Sensor information for adding or editing.(package private) voidsetSensorModeBox(int mode, JComboBox<String> box) Set selected item for a Sensor conditional's On state in the comboBox on the Edit Head sub pane.(package private) voidsetSignalHeadStateBox(int mode, JComboBox<String> box) Set selected item in a Signal Group Signal Head's On and Off Appearance in a comboBox at the top of the Edit Head sub pane.(package private) intSet the Turnout information for adding or editing.(package private) voidsetTurnoutModeBox(int mode, JComboBox<String> box) Set selected item for a Control Turnout conditional's On state in the comboBox on the Edit Head sub pane.(package private) intGet the user choice for a Control Turnout conditional's On state from the comboBox on the Edit Head sub pane.(package private) voidupdateSubPressed(ActionEvent e, boolean newSignalGroup) Respond to the Update button on the Edit Head sub pane - update to SignalGroup.
-
Field Details
-
_systemName
-
_OnAppearance
-
_OffAppearance
-
spacer
-
_SensorTurnoutOper
-
addSubFrame
-
_SignalGroupTurnoutModel
-
_SignalGroupTurnoutScrollPane
-
_SignalGroupSensorModel
-
_SignalGroupSensorScrollPane
-
selGroup
-
allButton
-
includedButton
-
nameLabel
-
signalOnStateLabel
-
signalOffStateLabel
-
userLabel
-
cancelButton
-
updateSubButton
-
updateInst
-
status1
-
p2xt
-
p2xs
-
curSignalGroup
-
curHeadName
-
curSignalHead
-
-
Constructor Details
-
SignalGroupSubTableAction
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
-
SignalGroupSubTableAction
public SignalGroupSubTableAction()
-
-
Method Details
-
helpTarget
-
setoperBox
Set choice for conditional evaluation.Set to AND when you want all conditionals to be met for the Signal Head to turn On when an included Aspect is shown on the main Mast. Set to OR when you at least one of the conditionals to be met for the Signal Head to turn On when an included Aspect is shown. See
operFromBox(javax.swing.JComboBox<java.lang.String>)- Parameters:
mode- True for ANDbox- the comboBox object to set
-
operFromBox
Get the user choice for conditional evaluation. SeesetoperBox(boolean, javax.swing.JComboBox<java.lang.String>)- Parameters:
box- the comboBox object containing the user choice- Returns:
- True for AND, False for OR
-
headStateFromBox
Get the user choice for a Signal Group Signal Head's On and Off Appearance from a comboBox at the top of the Edit Head sub pane.- Parameters:
box- the comboBox object containing the user choice- Returns:
- Value for the Appearance (color) set i.e. 0 for DARK
- Throws:
IllegalArgumentException- when needed
-
setSignalHeadStateBox
Set selected item in a Signal Group Signal Head's On and Off Appearance in a comboBox at the top of the Edit Head sub pane.- Parameters:
mode- Value for an Appearance (color) i.e. 0 for DARKbox- the comboBox object to set
-
sensorModeFromBox
Get the user choice for a Sensor conditional's On state from the comboBox on the Edit Head sub pane. SeeturnoutModeFromBox(javax.swing.JComboBox<java.lang.String>)- Parameters:
box- the comboBox object containing the user choice- Returns:
- Value for ACTIVE/INACTIVE
-
setSensorModeBox
Set selected item for a Sensor conditional's On state in the comboBox on the Edit Head sub pane. SeeturnoutModeFromBox(javax.swing.JComboBox<java.lang.String>)- Parameters:
mode- Value for ACTIVE/INACTIVEbox- the comboBox object to set
-
turnoutModeFromBox
Get the user choice for a Control Turnout conditional's On state from the comboBox on the Edit Head sub pane. SeesensorModeFromBox(javax.swing.JComboBox<java.lang.String>)- Parameters:
box- the comboBox object containing the user choice- Returns:
- Value for CLOSED/THROWN
-
setTurnoutModeBox
Set selected item for a Control Turnout conditional's On state in the comboBox on the Edit Head sub pane. SeeturnoutModeFromBox(javax.swing.JComboBox<java.lang.String>)- Parameters:
mode- Value for CLOSED/THROWNbox- the comboBox object to set
-
editHead
Open an editor to set the details of a Signal Head as part of a Signal Group. Called when user clicks the Edit button for a Head in the Add/Edit Signal Group pane.- Parameters:
g- Parent Signal HeadheadName- System or User Name of this Signal Head- See Also:
-
initializeIncludedList
void initializeIncludedList()Initialize the list of included turnouts and sensors for a Signal Head item on the sub pane. -
setTurnoutInformation
Set the Turnout information for adding or editing.- Parameters:
g- The Signal Group being configured- Returns:
- total number of turnouts included in group
-
setSensorInformation
Set the Sensor information for adding or editing.- Parameters:
g- The Signal Group being configured- Returns:
- total number of sensors included in group
-
cancelSubPressed
Respond to the Cancel button - clean up.- Parameters:
e- the event heard
-
updateSubPressed
Respond to the Update button on the Edit Head sub pane - update to SignalGroup.- Parameters:
e- the event heardnewSignalGroup- True if this is a newly created Signal Group for which additional actions are required
-
finishUpdate
void finishUpdate()Clean up the interface and reset Included radio button to All for next use -
cancelSubEdit
void cancelSubEdit()Cancel edit mode -
cancelIncludedOnly
void cancelIncludedOnly()Cancel included Turnouts and Sensors only option
-