Package jmri.jmrix.rfid.swing.tagcarwin
Class TagMonitorPane
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- jmri.util.swing.JmriPanel
-
- jmri.jmrix.rfid.swing.tagcarwin.TagMonitorPane
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,javax.swing.event.TableModelListener,AbstractMRListener,RfidListener,RfidPanelInterface
public class TagMonitorPane extends JmriPanel implements RfidListener, RfidPanelInterface, javax.swing.event.TableModelListener
A monitor for RFID tags which shows the tag, a car (if there is a car associated with that tag). If there is no car, a button allows the user to associate a car. For those tags with cars, the user can set the location or edit the car.- 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) CarManagercarManagerprotected javax.swing.JButtonclearButtonprotected java.lang.IntegercurrentRowCount(package private) TableDataModeldataModelprotected java.lang.StringdupeCheckprotected java.lang.StringforceSetprotected javax.swing.JCheckBoxforceSetCar(package private) LocationManagerlocationManager(package private) RfidSystemConnectionMemomemo(package private) javax.swing.JLabelpanelMessageprotected javax.swing.JTextFieldrowCountprotected java.lang.StringrowCountFieldprotected javax.swing.JLabelrowCountLabelprotected javax.swing.JButtonsetRowCountprotected javax.swing.JCheckBoxshowDuplicatesprotected javax.swing.JCheckBoxshowTimestampsprotected java.lang.StringtimeCheck-
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 TagMonitorPane()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Save the preferences for use later They will apply to all instances of this class (regardless of which connections use it)intgetCarTrainPosition(RollingStock thisCar, Train thisTrain)If this car (engine or car) is in a train, determine what the car position isbooleangetShowTimestamps()java.lang.StringgetTitle()If the System Prefix is available, append it to the title to identify which reader this belongs tovoidinitComponents()2nd stage of initialization, invoked after the constructor is complete.voidinitComponents(RfidSystemConnectionMemo memo)Save the connection identifier to use for the System Prefix and to get the tag protocol add this class as a listener to get the RFID repliesvoidmessage(RfidMessage m)RFID typically don't send messages, so this is ignoredvoidreply(RfidReply m)Process an RFID message (typically a tag was seen) Tags in JMRI are identified with the string "ID" + the tag number if this is the same tag as was last seen, suppress the display unless the option to display duplicates has been set (in that case, update the timestamp) Pass the tag to createNewItem to build the new displayvoidsetMessageError(java.lang.String newMessage)Set the message at the bottom of the panel and change the color to red to highlight it after an error has occurredvoidsetMessageNormal(java.lang.String newMessage)Replace the current message on the panel with a new one Also sets the color to black (in case it was set to read after an error)voidtableChanged(javax.swing.event.TableModelEvent e)-
Methods inherited from class jmri.util.swing.JmriPanel
getHelpTarget, getMenus, getMinimumDimension, getWindowInterface, initContext, 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
-
dataModel
TableDataModel dataModel
-
currentRowCount
protected java.lang.Integer currentRowCount
-
carManager
CarManager carManager
-
locationManager
LocationManager locationManager
-
showTimestamps
protected javax.swing.JCheckBox showTimestamps
-
showDuplicates
protected javax.swing.JCheckBox showDuplicates
-
forceSetCar
protected javax.swing.JCheckBox forceSetCar
-
timeCheck
protected java.lang.String timeCheck
-
dupeCheck
protected java.lang.String dupeCheck
-
forceSet
protected java.lang.String forceSet
-
clearButton
protected javax.swing.JButton clearButton
-
rowCountLabel
protected javax.swing.JLabel rowCountLabel
-
rowCount
protected javax.swing.JTextField rowCount
-
setRowCount
protected javax.swing.JButton setRowCount
-
rowCountField
protected java.lang.String rowCountField
-
panelMessage
javax.swing.JLabel panelMessage
-
-
Constructor Detail
-
TagMonitorPane
public TagMonitorPane()
-
-
Method Detail
-
getTitle
public java.lang.String getTitle()
If the System Prefix is available, append it to the title to identify which reader this belongs to
-
message
public void message(RfidMessage m)
RFID typically don't send messages, so this is ignored- Specified by:
messagein interfaceRfidListener- Parameters:
m- the message received
-
reply
public void reply(RfidReply m)
Process an RFID message (typically a tag was seen) Tags in JMRI are identified with the string "ID" + the tag number if this is the same tag as was last seen, suppress the display unless the option to display duplicates has been set (in that case, update the timestamp) Pass the tag to createNewItem to build the new display- Specified by:
replyin interfaceRfidListener- Parameters:
m- the message
-
getCarTrainPosition
public int getCarTrainPosition(RollingStock thisCar, Train thisTrain)
If this car (engine or car) is in a train, determine what the car position is- Parameters:
thisCar- the car we are looking forthisTrain- the train to find it in- Returns:
- the position of car within the train
-
initComponents
public void initComponents(RfidSystemConnectionMemo memo)
Save the connection identifier to use for the System Prefix and to get the tag protocol add this class as a listener to get the RFID replies- Specified by:
initComponentsin interfaceRfidPanelInterface- Parameters:
memo- SystemConnectionMemo for configured RFID system
-
dispose
public void dispose()
Save the preferences for use later They will apply to all instances of this class (regardless of which connections use it)
-
setMessageNormal
public void setMessageNormal(java.lang.String newMessage)
Replace the current message on the panel with a new one Also sets the color to black (in case it was set to read after an error)- Parameters:
newMessage- the message to be displayed at the bottom of the panel
-
setMessageError
public void setMessageError(java.lang.String newMessage)
Set the message at the bottom of the panel and change the color to red to highlight it after an error has occurred- Parameters:
newMessage- the message to be displayed in RED
-
getShowTimestamps
public boolean getShowTimestamps()
-
initComponents
public void initComponents()
Description copied from class:JmriPanel2nd stage of initialization, invoked after the constructor is complete.- Overrides:
initComponentsin classJmriPanel
-
tableChanged
public void tableChanged(javax.swing.event.TableModelEvent e)
- Specified by:
tableChangedin interfacejavax.swing.event.TableModelListener
-
-