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) intdtime(package private) floatlastSpeedstatic java.lang.StringSTART(package private) javax.swing.JToggleButtonstart_buttonstatic java.lang.StringTHROTTLE(package private) static intTHROTTLE_INIT(package private) static intTHROTTLE_MAX(package private) static intTHROTTLE_MIN(package private) intthrottle_setting(package private) javax.swing.JSpinnerthrottle_spinnerstatic java.lang.StringVOLUME- 
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 booleanengineIsOn()Get if Engine is On.javax.swing.JSlidergetVolumeSlider()Get Volume Slider.voidinitComponents()Build the GUI componentsvoidinitContext(java.lang.Object context)Init Context.protected javax.swing.TimernewTimer(int time, boolean repeat, java.awt.event.ActionListener al)voidsetButtonDelay(long t)voidsetSpeed(float s)voidsetThrottle(int t)Set the Throttle spinner value.voidstartButtonChange(java.awt.event.ActionEvent e)Respond to a start button press.voidstartButtonClick()voidstartButtonStateChange(javax.swing.event.ChangeEvent ev)(package private) voidstartDelayTimer()voidthrottleChange(javax.swing.event.ChangeEvent e)Respond to a throttle change.intthrottleNotch()Get Throttle notch.protected voidvolumeChange(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
 
- 
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:
 initContextin 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:
 setButtonDelayin classEnginePane
 
- 
initComponents
public void initComponents()
Build the GUI components- Overrides:
 initComponentsin 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:
 startButtonClickin 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:
 setThrottlein classEnginePane- Parameters:
 t- new value.
 
- 
setSpeed
public void setSpeed(float s)
- Overrides:
 setSpeedin classEnginePane
 
- 
getVolumeSlider
public javax.swing.JSlider getVolumeSlider()
Get Volume Slider.- Returns:
 - current volume slider.
 
 
 - 
 
 -