|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JInternalFrame
jmri.jmrit.throttle.ControlPanel
public class ControlPanel
A JInternalFrame that contains a JSlider to control loco speed, and buttons for forward, reverse and STOP.
TODO: fix speed increments (14, 28)
| Nested Class Summary | |
|---|---|
(package private) class |
ControlPanel.ControlPadKeyListener
A KeyAdapter that listens for the keys that work the control pad buttons |
(package private) static class |
ControlPanel.PopupListener
A PopupListener to handle mouse clicks and releases. |
| Nested classes/interfaces inherited from class javax.swing.JInternalFrame |
|---|
JInternalFrame.AccessibleJInternalFrame, JInternalFrame.JDesktopIcon |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
int |
accelerateKey
|
int |
accelerateKey1
|
int |
accelerateKey2
|
static int |
BUTTON_SIZE
|
int |
decelerateKey
|
int |
decelerateKey1
|
int |
decelerateKey2
|
int |
forwardKey
|
int |
idleKey
|
(package private) static org.slf4j.Logger |
log
|
int |
reverseKey
|
static int |
SLIDERDISPLAY
|
static int |
SLIDERDISPLAYCONTINUOUS
|
static int |
STEPDISPLAY
|
int |
stopKey
|
| Fields inherited from class javax.swing.JInternalFrame |
|---|
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ControlPanel()
Constructor. |
|
| Method Summary | |
|---|---|
void |
accelerate1()
|
void |
accelerate10()
|
void |
actionPerformed(ActionEvent e)
Handle the selection from the popup menu. |
void |
decelerate1()
|
void |
decelerate10()
|
void |
destroy()
|
int |
getDisplaySlider()
Get the value indicating what speed input we're displaying |
boolean |
getIsForward()
Deprecated. You should not directly manipulate the UI. Use a throttle object instead. |
JSlider |
getSpeedSlider()
Deprecated. You should not directly manipulate the UI. Use a throttle object instead. |
String |
getSwitchSliderFunction()
|
boolean |
getTrackSlider()
Get status of real-time speed slider tracking |
org.jdom.Element |
getXml()
Collect the prefs of this object into XML Element Window prefs |
boolean |
isSpeedControllerAvailable(int displaySlider)
Is this Speed Control selection method possible? |
void |
notifyAddressChosen(LocoAddress l)
Receive notification that a new address has been selected. |
void |
notifyAddressReleased(LocoAddress la)
Receive notification that an address has been released/dispatched |
void |
notifyAddressThrottleFound(DccThrottle t)
Receive notification that a throttle has been found |
void |
notifyConsistAddressChosen(int newAddress,
boolean isLong)
Receive notification that a new Consist address has been selected. |
void |
notifyConsistAddressReleased(int address,
boolean isLong)
Receive notification that a consist address has been released/dispatched |
void |
notifyConsistAddressThrottleFound(DccThrottle throttle)
Receive notification that a throttle has been found |
void |
propertyChange(PropertyChangeEvent e)
|
void |
saveToRoster(RosterEntry re)
|
void |
setAddressPanel(AddressPanel addressPanel)
|
void |
setEnabled(boolean isEnabled)
Enable/Disable all buttons and slider. |
void |
setForwardDirection(boolean isForward)
Deprecated. You should not directly manipulate the UI. Use a throttle object instead. |
void |
setIsForward(boolean isForward)
Deprecated. You should not directly manipulate the UI. Use a throttle object instead. |
void |
setSpeedController(int displaySlider)
Deprecated. You should not directly manipulate the UI. Use a throttle object instead. |
void |
setSpeedStepsMode(int speedStepMode)
Deprecated. You should not directly manipulate the UI. Use a throttle object instead. |
void |
setSpeedValues(float speedIncrement,
float speed)
Deprecated. You should not directly manipulate the UI. Use a throttle object instead. |
void |
setSwitchSliderFunction(String fn)
|
void |
setTrackSlider(boolean track)
Set real-time tracking of speed slider, or not |
void |
setXml(org.jdom.Element e)
Set the preferences based on the XML Element. |
void |
stop()
Deprecated. You should not directly manipulate the UI. Use a throttle object instead. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SLIDERDISPLAY
public static final int STEPDISPLAY
public static final int SLIDERDISPLAYCONTINUOUS
public static final int BUTTON_SIZE
public int accelerateKey
public int decelerateKey
public int accelerateKey1
public int decelerateKey1
public int accelerateKey2
public int decelerateKey2
public int reverseKey
public int forwardKey
public int stopKey
public int idleKey
static org.slf4j.Logger log
| Constructor Detail |
|---|
public ControlPanel()
| Method Detail |
|---|
public void setAddressPanel(AddressPanel addressPanel)
public void destroy()
public void setEnabled(boolean isEnabled)
setEnabled in class JComponentisEnabled - True if the buttons/slider should be enabled, false
otherwise.public void setIsForward(boolean isForward)
isForward - True if the loco is set to forward, false otherwise.public boolean getIsForward()
public void setForwardDirection(boolean isForward)
public void setSpeedStepsMode(int speedStepMode)
speedStepMode - Desired speed step mode. One of:
DccThrottle.SpeedStepMode128, DccThrottle.SpeedStepMode28,
DccThrottle.SpeedStepMode27, DccThrottle.SpeedStepMode14
step modepublic boolean isSpeedControllerAvailable(int displaySlider)
displaySlider - integer value. possible values:
SLIDERDISPLAY = use speed slider display
STEPDISPLAY = use speed step displaypublic void setSpeedController(int displaySlider)
displaySlider - integer value. possible values:
SLIDERDISPLAY = use speed slider display
STEPDISPLAY = use speed step displaypublic int getDisplaySlider()
public void setTrackSlider(boolean track)
track - boolean value, true to track, false to set speed on unclickpublic boolean getTrackSlider()
public void setSpeedValues(float speedIncrement,
float speed)
speedIncrement - The throttle back end's speed increment
value - % increase for each speed step.speed - The speed value of the loco.public JSlider getSpeedSlider()
public void stop()
public void accelerate1()
public void accelerate10()
public void decelerate1()
public void decelerate10()
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenere - The ActionEvent causing the action.public org.jdom.Element getXml()
public void setXml(org.jdom.Element e)
e - The Element for this object.public void notifyAddressChosen(LocoAddress l)
AddressListener
notifyAddressChosen in interface AddressListenerl - The address that is now selected.public void notifyAddressReleased(LocoAddress la)
AddressListener
notifyAddressReleased in interface AddressListenerla - The address released/dispatchedpublic void notifyAddressThrottleFound(DccThrottle t)
AddressListener
notifyAddressThrottleFound in interface AddressListenert - The throttle
public void notifyConsistAddressChosen(int newAddress,
boolean isLong)
AddressListener
notifyConsistAddressChosen in interface AddressListenernewAddress - The address that is now selected.
public void notifyConsistAddressReleased(int address,
boolean isLong)
AddressListener
notifyConsistAddressReleased in interface AddressListeneraddress - The address released/dispatchedpublic void notifyConsistAddressThrottleFound(DccThrottle throttle)
AddressListener
notifyConsistAddressThrottleFound in interface AddressListenerthrottle - The throttlepublic void setSwitchSliderFunction(String fn)
public String getSwitchSliderFunction()
public void saveToRoster(RosterEntry re)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||