Class SimpleThrottlePanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jmri.jmrit.throttle.implementation.SimpleThrottlePanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,ThrottleControllerUI
A basic throttle panel, with control and function panels only
No addressPanel, setAddress() or setConsistAddress() or setRosterEntry() has to be called
to initiate a throttle request
This file is part of JMRI.
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionSimpleThrottlePanel(ThrottleControllersUIContainer stw, ThrottleManager tm, boolean isShowingCtrlPanel, boolean isShowingFnPanel, boolean isShowingIconPanel) -
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.voiddispose()Handle my own destruction.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 containerorg.jdom2.ElementbooleanisActive()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 addressvoidloadThrottleFile(String sfile) Load that throttle control UI from a throttle file.voidRemove an address listener from that throttle control UI.voidvoidSet that throttle control addressvoidSet that throttle consist control addressvoidsetLocation(int x, int y) Sets the location of a throttle frame on the screen according to x and y coordinatesvoidSet that throttle control roster entryvoidSet that throttle control containervoidsetXml(org.jdom2.Element e) voidtoFront()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.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, 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, validateTreeMethods 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, getName, 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, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrit.throttle.interfaces.ThrottleControllerUI
isVisible
-
Field Details
-
throuic
-
-
Constructor Details
-
SimpleThrottlePanel
public SimpleThrottlePanel(ThrottleControllersUIContainer stw, ThrottleManager tm, boolean isShowingCtrlPanel, boolean isShowingFnPanel, boolean isShowingIconPanel)
-
-
Method Details
-
updateGUI
Description copied from interface:ThrottleControllerUIUpdate that throttle control UI. Called by the throttle core UI when the controlled throttle address or roster entry is updated- Specified by:
updateGUIin interfaceThrottleControllerUI
-
updateFrameTitle
Description copied from interface:ThrottleControllerUIUpdate 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.- Specified by:
updateFrameTitlein interfaceThrottleControllerUI
-
dispose
Handle my own destruction.- dispose of sub windows.
- notify my manager of my demise.
-
getThrottleControllersContainer
Description copied from interface:ThrottleControllerUIReturn that throttle control container- Specified by:
getThrottleControllersContainerin interfaceThrottleControllerUI- Returns:
- the throttle control container
-
setThrottleControllersContainer
Description copied from interface:ThrottleControllerUISet that throttle control container- Specified by:
setThrottleControllersContainerin interfaceThrottleControllerUI- Parameters:
tw- the throttle control container to set
-
toFront
Description copied from interface:ThrottleControllerUIBring that throttle UI control to front (window will be activated and raised if it is not already the case).- Specified by:
toFrontin interfaceThrottleControllerUI
-
setRosterEntry
Description copied from interface:ThrottleControllerUISet that throttle control roster entry- Specified by:
setRosterEntryin interfaceThrottleControllerUI- Parameters:
re- the roster entry
-
getRosterEntry
Description copied from interface:ThrottleControllerUIGet that throttle control roster entry- Specified by:
getRosterEntryin interfaceThrottleControllerUI- Returns:
- the roster entry or null
-
setAddress
Description copied from interface:ThrottleControllerUISet that throttle control address- Specified by:
setAddressin interfaceThrottleControllerUI- Parameters:
la- locomotive DccLocoAddress
-
getAddress
Description copied from interface:ThrottleControllerUIGet that throttle control address- Specified by:
getAddressin interfaceThrottleControllerUI- Returns:
- the throttle control address or null
-
setConsistAddress
Description copied from interface:ThrottleControllerUISet that throttle consist control address- Specified by:
setConsistAddressin interfaceThrottleControllerUI- Parameters:
la- consist DccLocoAddress
-
isUsingAddress
Description copied from interface:ThrottleControllerUICheck if that throttle control is using that address- Specified by:
isUsingAddressin interfaceThrottleControllerUI- Parameters:
la- the DccLocoAddress to check- Returns:
- true if that throttle control is using that address, false otherwise
-
eStop
Description copied from interface:ThrottleControllerUIEmergency stop that throttle- Specified by:
eStopin interfaceThrottleControllerUI
-
isRunning
Description copied from interface:ThrottleControllerUICheck if that throttle control is running (non null speed)- Specified by:
isRunningin interfaceThrottleControllerUI- Returns:
- true if that throttle control is running, false otherwise
-
isActive
Description copied from interface:ThrottleControllerUICheck if that throttle control is active (non null speed and at least one active function)- Specified by:
isActivein interfaceThrottleControllerUI- Returns:
- true if that throttle control is active, false otherwise
-
getThrottle
Description copied from interface:ThrottleControllerUIGet that throttle control UI throttle object- Specified by:
getThrottlein interfaceThrottleControllerUI- Returns:
- the throttle or null
-
getFunctionThrottle
Description copied from interface:ThrottleControllerUIGet that throttle control function throttle object (for consists)- Specified by:
getFunctionThrottlein interfaceThrottleControllerUI- Returns:
- the function throttle or null
-
getFunctionRosterEntry
Description copied from interface:ThrottleControllerUIGet that throttle control roster entry for the function locomotive- Specified by:
getFunctionRosterEntryin interfaceThrottleControllerUI- Returns:
- the roster entry or null
-
getLabel
Description copied from interface:ThrottleControllerUIGet 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- Specified by:
getLabelin interfaceThrottleControllerUI- Returns:
- the label or null
-
isSpeedDisplayContinuous
Description copied from interface:ThrottleControllerUICheck 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- Specified by:
isSpeedDisplayContinuousin interfaceThrottleControllerUI- Returns:
- true if that throttle control UI is using continuous speed display, false otherwise
-
saveRosterChanges
-
getRosterEntrySelector
Description copied from interface:ThrottleControllerUIGet 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- Specified by:
getRosterEntrySelectorin interfaceThrottleControllerUI- Returns:
- the roster entry selector panel or null
-
addAddressListener
Description copied from interface:ThrottleControllerUIAdd an address listener to that throttle control UI. SeeSimpleThrottlePanelfor an example implementation- Specified by:
addAddressListenerin interfaceThrottleControllerUI- Parameters:
l- the address listener to add
-
removeAddressListener
Description copied from interface:ThrottleControllerUIRemove an address listener from that throttle control UI. SeeSimpleThrottlePanelfor an example implementation- Specified by:
removeAddressListenerin interfaceThrottleControllerUI- Parameters:
l- the address listener to remove
-
dispatchAddress
Description copied from interface:ThrottleControllerUIDispatch 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.- Specified by:
dispatchAddressin interfaceThrottleControllerUI
-
setLocation
Sets the location of a throttle frame on the screen according to x and y coordinates- Overrides:
setLocationin classComponent- See Also:
-
getXmlFile
-
setXml
-
loadThrottleFile
Description copied from interface:ThrottleControllerUILoad that throttle control UI from a throttle file.- Specified by:
loadThrottleFilein interfaceThrottleControllerUI- Parameters:
sfile- the throttle file to load, if null a file chooser will be prompted to select the throttle file to load
-