Package jmri.jmrit.throttle.interfaces
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 Summary
Modifier and TypeMethodDescriptionvoidAdd an address listener to that throttle control UI.voidDispatch that throttle UI, will dispatch for that throttle control UI only.voideStop()Emergency stop that throttleGet that throttle control addressGet that throttle control roster entry for the function locomotiveGet that throttle control function throttle object (for consists)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).Get that throttle control roster entryGet that throttle control UI roster entry selector panel, or null if that throttle control UI does not have one.Get that throttle control UI throttle objectReturn that throttle control containerbooleanisActive()Check if that throttle control is active (non null speed and at least one active function)booleanCheck if that throttle control is running (non null speed)booleanCheck 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) SeeSimpleThrottlePanelfor an example implementationbooleanCheck if that throttle control is using that addressbooleanCheck if that throttle control UI is selected (active and visible)voidloadThrottleFile(String sfile) Load that throttle control UI from a throttle file.voidRemove an address listener from that throttle control UI.voidSet that throttle control addressvoidSet that throttle consist control addressvoidSet that throttle control roster entryvoidSet that throttle control containervoidtoFront()Bring that throttle UI control to front (window will be activated and raised if it is not already the case).voidUpdate that throttle control UI containing frame title (if any) with the current address and roster entry.voidUpdate that throttle control UI.
-
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
void 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
void 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
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). SeeSimpleThrottlePanelfor an example implementation- Returns:
- the label or null
-
isSpeedDisplayContinuous
boolean 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) SeeSimpleThrottlePanelfor 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) SeeSimpleThrottlePanelfor an example implementation- Returns:
- the roster entry selector panel or null
-
addAddressListener
Add an address listener to that throttle control UI. SeeSimpleThrottlePanelfor an example implementation- Parameters:
l- the address listener to add
-
removeAddressListener
Remove an address listener from that throttle control UI. SeeSimpleThrottlePanelfor an example implementation- Parameters:
l- the address listener to remove
-