Class SimpleTurnoutStateEntry


  • public class SimpleTurnoutStateEntry
    extends SimpleTurnout
    Provides a swing object, for use by the Ds64TabbedPanel tool, which allows display and configuration of turnout number and position.

    Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      ValidatedTextField addressField
      Tracks the "user-friendly" turnout address.
      javax.swing.JRadioButton closedRadioButton
      Tracks whether the associated turnout is "closed".
      javax.swing.JRadioButton thrownRadioButton
      Tracks whether the associated turnout is "thrown".
      javax.swing.JRadioButton unusedRadioButton
      Tracks whether the object is in-use or not, as seen in some aspects of DS64 configuration.
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleTurnoutStateEntry()
      Constructor used when the current address and position are not known.
      SimpleTurnoutStateEntry​(java.lang.Integer address, boolean isClosed)
      Constructor used when the current address and position are known.
      SimpleTurnoutStateEntry​(java.lang.Integer address, boolean closed, boolean unused)
      Constructor used when the current address, position, and "validity" state are known.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.swing.JPanel createEntryPanel​(java.lang.String label)
      Creates a GUI Panel for managing the address and position of a turnout, as used in configuring the turnout address of a DS64 output.
      ValidatedTextField getAddressField()
      Retrieve the GUI element which holds a turnout address
      javax.swing.JPanel getEntryPanel()  
      void setAddress​(java.lang.Integer addr)
      Sets the turnout address of the simpleTurnout object.
      void setAddressLastQueriedValue​(java.lang.Integer addr)
      Establish the most recent value known to be found in the hardware.
      void setIsClosed​(boolean isclosed)
      Sets an object field to show the current position of a simpleTurnout object.
      • Methods inherited from class java.lang.Object

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

      • addressField

        public ValidatedTextField addressField
        Tracks the "user-friendly" turnout address.

        Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

      • thrownRadioButton

        public javax.swing.JRadioButton thrownRadioButton
        Tracks whether the associated turnout is "thrown".
      • closedRadioButton

        public javax.swing.JRadioButton closedRadioButton
        Tracks whether the associated turnout is "closed".
      • unusedRadioButton

        public javax.swing.JRadioButton unusedRadioButton
        Tracks whether the object is in-use or not, as seen in some aspects of DS64 configuration.
    • Constructor Detail

      • SimpleTurnoutStateEntry

        public SimpleTurnoutStateEntry()
        Constructor used when the current address and position are not known. It is assumed that the turnout address is 1, that the turnout is "closed", and that the turnout is "valid".

        Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

      • SimpleTurnoutStateEntry

        public SimpleTurnoutStateEntry​(java.lang.Integer address,
                                       boolean isClosed)
        Constructor used when the current address and position are known. Turnout "validity" is assumed to be "valid".

        Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

        Parameters:
        address - turnout address
        isClosed - true if turnout is closed, else false
      • SimpleTurnoutStateEntry

        public SimpleTurnoutStateEntry​(java.lang.Integer address,
                                       boolean closed,
                                       boolean unused)
        Constructor used when the current address, position, and "validity" state are known.

        Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

        Parameters:
        address - turnout address
        closed - true if turnout is closed, else false
        unused - true if turnout is unused, else false
    • Method Detail

      • getEntryPanel

        public javax.swing.JPanel getEntryPanel()
        Returns:
        the JPanel related to this object
      • createEntryPanel

        public javax.swing.JPanel createEntryPanel​(java.lang.String label)
        Creates a GUI Panel for managing the address and position of a turnout, as used in configuring the turnout address of a DS64 output.
        Parameters:
        label - a text string to be displayed in the JPanel with the turnout address and position
        Returns:
        a JPanel containing the label, the turnout address text field, and position GUI elements
      • setAddress

        public void setAddress​(java.lang.Integer addr)
        Description copied from class: SimpleTurnout
        Sets the turnout address of the simpleTurnout object.
        Overrides:
        setAddress in class SimpleTurnout
        Parameters:
        addr - address value
      • setAddressLastQueriedValue

        public final void setAddressLastQueriedValue​(java.lang.Integer addr)
        Establish the most recent value known to be found in the hardware. Value is used to help determine colorization of the swing GUI text field.
        Parameters:
        addr - Turnout address
      • setIsClosed

        public void setIsClosed​(boolean isclosed)
        Description copied from class: SimpleTurnout
        Sets an object field to show the current position of a simpleTurnout object. This position does not necessarily reflect the actual position of an associated physical turnout.
        Overrides:
        setIsClosed in class SimpleTurnout
        Parameters:
        isclosed - true if the object is to be marked as closed.