Package jmri.jmrit.vsdecoder.swing
Class DieselPane
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- jmri.jmrit.vsdecoder.EnginePane
-
- jmri.jmrit.vsdecoder.swing.DieselPane
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
public class DieselPane extends EnginePane
Sound control buttons for the new GUI.
This file is part of JMRI.JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
dtime
(package private) float
lastSpeed
static java.lang.String
START
(package private) javax.swing.JToggleButton
start_button
static java.lang.String
THROTTLE
(package private) static int
THROTTLE_INIT
(package private) static int
THROTTLE_MAX
(package private) static int
THROTTLE_MIN
(package private) int
throttle_setting
(package private) javax.swing.JSpinner
throttle_spinner
static java.lang.String
VOLUME
javax.swing.JSlider
volume_slider
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description DieselPane()
Null constructorDieselPane(java.lang.String n)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
engineIsOn()
Get if Engine is On.void
initComponents()
Build the GUI componentsvoid
initContext(java.lang.Object context)
Init Context.protected javax.swing.Timer
newTimer(int time, boolean repeat, java.awt.event.ActionListener al)
void
setButtonDelay(long t)
void
setSpeed(float s)
void
setThrottle(int t)
Set the Throttle spinner value.void
startButtonChange(java.awt.event.ActionEvent e)
Respond to a start button press.void
startButtonClick()
void
startButtonStateChange(javax.swing.event.ChangeEvent ev)
(package private) void
startDelayTimer()
void
throttleChange(javax.swing.event.ChangeEvent e)
Respond to a throttle change.int
throttleNotch()
Get Throttle notch.protected void
volumeChange(javax.swing.event.ChangeEvent e)
-
Methods inherited from class jmri.jmrit.vsdecoder.EnginePane
addPropertyChangeListener, firePropertyChangeEvent, getEngine, getName, getStopOption, init, removePropertyChangeListener, setEngine, setName
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
THROTTLE_MIN
static final int THROTTLE_MIN
- See Also:
- Constant Field Values
-
THROTTLE_MAX
static final int THROTTLE_MAX
- See Also:
- Constant Field Values
-
THROTTLE_INIT
static final int THROTTLE_INIT
- See Also:
- Constant Field Values
-
THROTTLE
public static final java.lang.String THROTTLE
- See Also:
- Constant Field Values
-
START
public static final java.lang.String START
- See Also:
- Constant Field Values
-
VOLUME
public static final java.lang.String VOLUME
- See Also:
- Constant Field Values
-
throttle_spinner
javax.swing.JSpinner throttle_spinner
-
volume_slider
public javax.swing.JSlider volume_slider
-
start_button
javax.swing.JToggleButton start_button
-
throttle_setting
int throttle_setting
-
dtime
int dtime
-
lastSpeed
float lastSpeed
-
-
Constructor Detail
-
DieselPane
public DieselPane(java.lang.String n)
Constructor- Parameters:
n
- pane title
-
DieselPane
public DieselPane()
Null constructor
-
-
Method Detail
-
initContext
public void initContext(java.lang.Object context)
Init Context.- Overrides:
initContext
in classEnginePane
- Parameters:
context
- unused.
-
newTimer
protected javax.swing.Timer newTimer(int time, boolean repeat, java.awt.event.ActionListener al)
-
startDelayTimer
void startDelayTimer()
-
setButtonDelay
public void setButtonDelay(long t)
- Overrides:
setButtonDelay
in classEnginePane
-
initComponents
public void initComponents()
Build the GUI components- Overrides:
initComponents
in classEnginePane
-
startButtonStateChange
public void startButtonStateChange(javax.swing.event.ChangeEvent ev)
-
throttleChange
public void throttleChange(javax.swing.event.ChangeEvent e)
Respond to a throttle change. Basically, doesn't do anything.- Parameters:
e
- unused.
-
startButtonChange
public void startButtonChange(java.awt.event.ActionEvent e)
Respond to a start button press.- Parameters:
e
- unused.
-
volumeChange
protected void volumeChange(javax.swing.event.ChangeEvent e)
-
startButtonClick
public void startButtonClick()
- Overrides:
startButtonClick
in classEnginePane
-
engineIsOn
public boolean engineIsOn()
Get if Engine is On.- Returns:
- true if the start button is "on".
-
throttleNotch
public int throttleNotch()
Get Throttle notch.- Returns:
- current notch setting of the throttle slider.
-
setThrottle
public void setThrottle(int t)
Set the Throttle spinner value.- Overrides:
setThrottle
in classEnginePane
- Parameters:
t
- new value.
-
setSpeed
public void setSpeed(float s)
- Overrides:
setSpeed
in classEnginePane
-
-