Interface ThrottleControllerUI

All Known Implementing Classes:
SimpleThrottlePanel, ThrottleFrame

public interface ThrottleControllerUI
An interface to abstract UI controllers of throttle (ThrottleFrame for Swing throttles for instance)
  • Method Details

    • getThrottleControllersContainer

      Return that throttle control container
      Returns:
      the throttle control container
    • setThrottleControllersContainer

      Set that throttle control container
      Parameters:
      tw - the throttle control container to set
    • setRosterEntry

      Set that throttle control roster entry
      Parameters:
      re - the roster entry
    • getRosterEntry

      Get that throttle control roster entry
      Returns:
      the roster entry or null
    • setAddress

      Set that throttle control address
      Parameters:
      la - locomotive DccLocoAddress
    • getAddress

      Get that throttle control address
      Returns:
      the throttle control address or null
    • setConsistAddress

      Set that throttle consist control address
      Parameters:
      la - consist DccLocoAddress
    • isUsingAddress

      Check if that throttle control is using that address
      Parameters:
      la - the DccLocoAddress to check
      Returns:
      true if that throttle control is using that address, false otherwise
    • dispatchAddress

      Dispatch that throttle UI, will dispatch for that throttle control UI only. Throttle will actully be released only if that throttle control UI is the only one using that address.
    • getThrottle

      Get that throttle control UI throttle object
      Returns:
      the throttle or null
    • getFunctionThrottle

      Get that throttle control function throttle object (for consists)
      Returns:
      the function throttle or null
    • getFunctionRosterEntry

      Get that throttle control roster entry for the function locomotive
      Returns:
      the roster entry or null
    • eStop

      void eStop()
      Emergency stop that throttle
    • isRunning

      boolean isRunning()
      Check if that throttle control is running (non null speed)
      Returns:
      true if that throttle control is running, false otherwise
    • isActive

      boolean isActive()
      Check if that throttle control is active (non null speed and at least one active function)
      Returns:
      true if that throttle control is active, false otherwise
    • toFront

      void toFront()
      Bring that throttle UI control to front (window will be activated and raised if it is not already the case).
    • isVisible

      boolean isVisible()
      Check if that throttle control UI is selected (active and visible)
      Returns:
      true if that throttle control UI is visible, false otherwise
    • updateFrameTitle

      Update that throttle control UI containing frame title (if any) with the current address and roster entry. Called by the throttle core UI when the controlled throttle address or roster entry is updated to update the frame title with the new information.
    • updateGUI

      void updateGUI()
      Update that throttle control UI. Called by the throttle core UI when the controlled throttle address or roster entry is updated
    • loadThrottleFile

      void loadThrottleFile(String sfile)
      Load that throttle control UI from a throttle file.
      Parameters:
      sfile - the throttle file to load, if null a file chooser will be prompted to select the throttle file to load
    • getLabel

      Get a copy of that throttle control UI label (a text or the roster entry icon, for consits a consist icon will be built from the locomotives in the consist). See SimpleThrottlePanel for an example implementation
      Returns:
      the label or null
    • isSpeedDisplayContinuous

      Check if that throttle control UI is using continuous speed display (a speed slider from -100 to 100) (Used by external controls like USB game controllers) See SimpleThrottlePanel for an example implementation
      Returns:
      true if that throttle control UI is using continuous speed display, false otherwise
    • getRosterEntrySelector

      Get that throttle control UI roster entry selector panel, or null if that throttle control UI does not have one. (Used by external controls like USB game controllers) See SimpleThrottlePanel for an example implementation
      Returns:
      the roster entry selector panel or null
    • addAddressListener

      Add an address listener to that throttle control UI. See SimpleThrottlePanel for an example implementation
      Parameters:
      l - the address listener to add
    • removeAddressListener

      Remove an address listener from that throttle control UI. See SimpleThrottlePanel for an example implementation
      Parameters:
      l - the address listener to remove