Class LocoStatsPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- jmri.util.swing.JmriPanel
-
- jmri.jmrix.loconet.swing.LnPanel
-
- jmri.jmrix.loconet.locostats.swing.LocoStatsPanel
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,LocoNetInterfaceStatsListener
,LnPanelInterface
public class LocoStatsPanel extends LnPanel implements LocoNetInterfaceStatsListener
Panel displaying LocoNet interface status information.The LocoBuffer family from RR-CirKits and the PRn family from Digitrax use different formats for the status message. This class detects this from the reply contents, and displays different panes depending on which message was received. If the format is not recognised, a raw display format is used.
Moved from loconet.locobuffer.LocoBufferStatsFrame
Some of the message formats used in this class are Copyright Digitrax, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact Digitrax Inc for separate permission.
- Since:
- 2.1.5
- 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) javax.swing.JTextField
badMsgCnt
(package private) javax.swing.JTextField
breaks
(package private) javax.swing.JTextField
current
(package private) javax.swing.JTextField
errors
(package private) javax.swing.JTextField
goodMsgCnt
(package private) javax.swing.JTextField
hardware
(package private) javax.swing.JPanel
lb2Panel
(package private) javax.swing.JPanel
ms100Panel
(package private) javax.swing.JTextField
ms100status
(package private) javax.swing.JPanel
pr2Panel
(package private) javax.swing.JTextField
r1
(package private) javax.swing.JTextField
r2
(package private) javax.swing.JTextField
r3
(package private) javax.swing.JTextField
r4
(package private) javax.swing.JTextField
r5
(package private) javax.swing.JTextField
r6
(package private) javax.swing.JTextField
r7
(package private) javax.swing.JTextField
r8
(package private) javax.swing.JPanel
rawPanel
(package private) javax.swing.JTextField
serial
(package private) javax.swing.JTextField
software
(package private) LocoStatsFunc
stats
(package private) javax.swing.JTextField
status
(package private) javax.swing.JButton
updateButton
(package private) boolean
updateRequestPending
(package private) javax.swing.JTextField
version
-
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 LocoStatsPanel()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Destructorjava.lang.String
getHelpTarget()
Provides a path to the help html for this tooljava.lang.String
getTitle()
Provides the string for the title of the window This is pulled from the properties file for the LocoNet menu entry for this tool, to ensure consistency between the menu and the window title.void
initComponents()
GUI initializationsvoid
initComponents(LocoNetSystemConnectionMemo memo)
Configure LocoNet connectionvoid
notifyChangedInterfaceStatus(java.lang.Object o)
Listener for LocoNet Interface Status changesvoid
requestUpdate()
Send LocoNet request for interface status.-
Methods inherited from class jmri.jmrix.loconet.swing.LnPanel
getTitle, getTitleHelper, initContext
-
Methods inherited from class jmri.util.swing.JmriPanel
getMenus, getMinimumDimension, getWindowInterface, isMultipleInstances, setWindowInterface
-
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, 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, 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, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
lb2Panel
javax.swing.JPanel lb2Panel
-
rawPanel
javax.swing.JPanel rawPanel
-
pr2Panel
javax.swing.JPanel pr2Panel
-
ms100Panel
javax.swing.JPanel ms100Panel
-
updateRequestPending
boolean updateRequestPending
-
stats
LocoStatsFunc stats
-
r1
javax.swing.JTextField r1
-
r2
javax.swing.JTextField r2
-
r3
javax.swing.JTextField r3
-
r4
javax.swing.JTextField r4
-
r5
javax.swing.JTextField r5
-
r6
javax.swing.JTextField r6
-
r7
javax.swing.JTextField r7
-
r8
javax.swing.JTextField r8
-
serial
javax.swing.JTextField serial
-
status
javax.swing.JTextField status
-
current
javax.swing.JTextField current
-
hardware
javax.swing.JTextField hardware
-
software
javax.swing.JTextField software
-
goodMsgCnt
javax.swing.JTextField goodMsgCnt
-
badMsgCnt
javax.swing.JTextField badMsgCnt
-
ms100status
javax.swing.JTextField ms100status
-
version
javax.swing.JTextField version
-
breaks
javax.swing.JTextField breaks
-
errors
javax.swing.JTextField errors
-
updateButton
javax.swing.JButton updateButton
-
-
Constructor Detail
-
LocoStatsPanel
public LocoStatsPanel()
Constructor
-
-
Method Detail
-
getHelpTarget
public java.lang.String getHelpTarget()
Provides a path to the help html for this tool- Overrides:
getHelpTarget
in classJmriPanel
- Returns:
- path
-
getTitle
public java.lang.String getTitle()
Provides the string for the title of the window This is pulled from the properties file for the LocoNet menu entry for this tool, to ensure consistency between the menu and the window title.
-
initComponents
public void initComponents()
GUI initializations- Overrides:
initComponents
in classJmriPanel
-
initComponents
public void initComponents(LocoNetSystemConnectionMemo memo)
Configure LocoNet connection- Specified by:
initComponents
in interfaceLnPanelInterface
- Overrides:
initComponents
in classLnPanel
- Parameters:
memo
- specifies which LocoNet connection is used by this tool
-
requestUpdate
public void requestUpdate()
Send LocoNet request for interface status. Performs the send from the "Layout" thread, to avoid GUI-related threading problems.
-
notifyChangedInterfaceStatus
public void notifyChangedInterfaceStatus(java.lang.Object o)
Listener for LocoNet Interface Status changes- Specified by:
notifyChangedInterfaceStatus
in interfaceLocoNetInterfaceStatsListener
- Parameters:
o
- a LocoNetStatus object
-
-