Class SignalGroupSubTableAction


  • public class SignalGroupSubTableAction
    extends java.lang.Object
    Swing action to create and register a SignalGroup - Signal Head Edit Table.

    Based in part on RouteTableAction.java and SignalGroupTableAction.java by Bob Jacobsen

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void cancelIncludedOnly()
      Cancel included Turnouts and Sensors only option
      (package private) void cancelSubEdit()
      Cancel edit mode
      (package private) void cancelSubPressed​(java.awt.event.ActionEvent e)
      Respond to the Cancel button - clean up.
      (package private) void editHead​(SignalGroup g, java.lang.String headName)
      Open an editor to set the details of a Signal Head as part of a Signal Group.
      (package private) void finishUpdate()
      Clean up the interface and reset Included radio button to All for next use
      (package private) int headStateFromBox​(javax.swing.JComboBox<java.lang.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) java.lang.String helpTarget()  
      (package private) void initializeIncludedList()
      Initialize the list of included turnouts and sensors for a Signal Head item on the sub pane.
      (package private) boolean operFromBox​(javax.swing.JComboBox<java.lang.String> box)
      Get the user choice for conditional evaluation.
      (package private) int sensorModeFromBox​(javax.swing.JComboBox<java.lang.String> box)
      Get the user choice for a Sensor conditional's On state from the comboBox on the Edit Head sub pane.
      (package private) void setoperBox​(boolean mode, javax.swing.JComboBox<java.lang.String> box)
      Set choice for conditional evaluation.
      (package private) int setSensorInformation​(SignalGroup g)
      Set the Sensor information for adding or editing.
      (package private) void setSensorModeBox​(int mode, javax.swing.JComboBox<java.lang.String> box)
      Set selected item for a Sensor conditional's On state in the comboBox on the Edit Head sub pane.
      (package private) void setSignalHeadStateBox​(int mode, javax.swing.JComboBox<java.lang.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) int setTurnoutInformation​(SignalGroup g)
      Set the Turnout information for adding or editing.
      (package private) void setTurnoutModeBox​(int mode, javax.swing.JComboBox<java.lang.String> box)
      Set selected item for a Control Turnout conditional's On state in the comboBox on the Edit Head sub pane.
      (package private) int turnoutModeFromBox​(javax.swing.JComboBox<java.lang.String> box)
      Get the user choice for a Control Turnout conditional's On state from the comboBox on the Edit Head sub pane.
      (package private) void updateSubPressed​(java.awt.event.ActionEvent e, boolean newSignalGroup)
      Respond to the Update button on the Edit Head sub pane - update to SignalGroup.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SignalGroupSubTableAction

        public SignalGroupSubTableAction​(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
    • Method Detail

      • setoperBox

        void setoperBox​(boolean mode,
                        javax.swing.JComboBox<java.lang.String> box)
        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 AND
        box - the comboBox object to set
      • headStateFromBox

        int headStateFromBox​(javax.swing.JComboBox<java.lang.String> box)
                      throws java.lang.IllegalArgumentException
        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:
        java.lang.IllegalArgumentException
      • setSignalHeadStateBox

        void setSignalHeadStateBox​(int mode,
                                   javax.swing.JComboBox<java.lang.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.
        Parameters:
        mode - Value for an Appearance (color) i.e. 0 for DARK
        box - the comboBox object to set
      • editHead

        void editHead​(SignalGroup g,
                      java.lang.String headName)
        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 Head
        headName - System or User Name of this Signal Head
        See Also:
        SignalGroupTableAction.signalHeadEditPressed
      • initializeIncludedList

        void initializeIncludedList()
        Initialize the list of included turnouts and sensors for a Signal Head item on the sub pane.
      • setTurnoutInformation

        int setTurnoutInformation​(SignalGroup g)
        Set the Turnout information for adding or editing.
        Parameters:
        g - The Signal Group being configured
        Returns:
        total number of turnouts included in group
      • setSensorInformation

        int setSensorInformation​(SignalGroup g)
        Set the Sensor information for adding or editing.
        Parameters:
        g - The Signal Group being configured
        Returns:
        total number of sensors included in group
      • cancelSubPressed

        void cancelSubPressed​(java.awt.event.ActionEvent e)
        Respond to the Cancel button - clean up.
        Parameters:
        e - the event heard
      • updateSubPressed

        void updateSubPressed​(java.awt.event.ActionEvent e,
                              boolean newSignalGroup)
        Respond to the Update button on the Edit Head sub pane - update to SignalGroup.
        Parameters:
        e - the event heard
        newSignalGroup - 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
      • cancelIncludedOnly

        void cancelIncludedOnly()
        Cancel included Turnouts and Sensors only option