Package jmri.jmrix.rps.trackingpanel
Class RpsTrackingPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- jmri.jmrix.rps.trackingpanel.RpsTrackingPanel
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,MeasurementListener
public class RpsTrackingPanel extends javax.swing.JPanel implements MeasurementListener
Pane to show a 2D representation of the RPS Model and Measurements.- See Also:
Model
,Measurement
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
RpsTrackingPanel.MeasurementRep
Store draw representation of a measurement (set)(package private) static class
RpsTrackingPanel.TransmitterStatus
Simple tuple class for storing information about a single transmitter being tracked-
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) java.awt.geom.AffineTransform
currentAT
(package private) static int
MAXREPLISTSIZE
(package private) static double
MEASUREMENT_ACCURACY
(package private) int
measurementColor
(package private) java.util.ArrayList<RpsTrackingPanel.MeasurementRep>
measurementRepList
(package private) RpsSystemConnectionMemo
memo
(package private) static double
RECEIVER_SIZE
(package private) static java.awt.Color
regionFillColor
(package private) static java.awt.Color
regionOutlineColor
(package private) boolean
showErrors
(package private) boolean
showReceivers
(package private) boolean
showRegions
(package private) java.util.HashMap<java.lang.String,RpsTrackingPanel.TransmitterStatus>
transmitters
(package private) double
xmax
(package private) double
xorigin
(package private) double
ymax
(package private) double
yorigin
-
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 RpsTrackingPanel(RpsSystemConnectionMemo _memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
clear()
Clear the measurement historyvoid
dispose()
java.lang.String
getToolTipText(java.awt.event.MouseEvent e)
Provide tool tip text that depends on what's under the cursor.(package private) java.awt.Color
nextColor()
Pick a color for the next set of measurement lines to drawvoid
notify(Measurement m)
void
paint(java.awt.Graphics g)
(package private) void
pruneMeasurementRepList()
void
setCoordMax(double x, double y)
Sets the coordinates of the upper-right corner of the screen/paper.void
setOrigin(double x, double y)
Sets the coordinates of the lower left corner of the screen/paper.(package private) void
setShowErrors(boolean show)
(package private) void
setShowReceivers(boolean show)
(package private) void
setShowRegions(boolean show)
-
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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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
-
showErrors
boolean showErrors
-
showReceivers
boolean showReceivers
-
showRegions
boolean showRegions
-
xorigin
double xorigin
-
yorigin
double yorigin
-
xmax
double xmax
-
ymax
double ymax
-
MEASUREMENT_ACCURACY
static final double MEASUREMENT_ACCURACY
- See Also:
- Constant Field Values
-
RECEIVER_SIZE
static final double RECEIVER_SIZE
- See Also:
- Constant Field Values
-
regionFillColor
static final java.awt.Color regionFillColor
-
regionOutlineColor
static final java.awt.Color regionOutlineColor
-
measurementColor
int measurementColor
-
currentAT
java.awt.geom.AffineTransform currentAT
-
measurementRepList
java.util.ArrayList<RpsTrackingPanel.MeasurementRep> measurementRepList
-
transmitters
java.util.HashMap<java.lang.String,RpsTrackingPanel.TransmitterStatus> transmitters
-
MAXREPLISTSIZE
static final int MAXREPLISTSIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RpsTrackingPanel
public RpsTrackingPanel(RpsSystemConnectionMemo _memo)
-
-
Method Detail
-
dispose
public void dispose()
-
getToolTipText
public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
Provide tool tip text that depends on what's under the cursor.Names either a measurement point or a region.
- Overrides:
getToolTipText
in classjavax.swing.JComponent
- Returns:
- null if no object under mouse; this suppresses ToolTip
-
setOrigin
public void setOrigin(double x, double y)
Sets the coordinates of the lower left corner of the screen/paper. Note this is different from the usual Swing coordinate system!- Parameters:
x
- distance from left.y
- distance from bottom.
-
setShowErrors
void setShowErrors(boolean show)
-
setShowReceivers
void setShowReceivers(boolean show)
-
setShowRegions
void setShowRegions(boolean show)
-
setCoordMax
public void setCoordMax(double x, double y)
Sets the coordinates of the upper-right corner of the screen/paper. Note this is different from the usual Swing coordinate system!- Parameters:
x
- distance from right.y
- distance from top.
-
paint
public void paint(java.awt.Graphics g)
- Overrides:
paint
in classjavax.swing.JComponent
-
nextColor
java.awt.Color nextColor()
Pick a color for the next set of measurement lines to draw- Returns:
- Color for next line chosen via algorithm
-
notify
public void notify(Measurement m)
- Specified by:
notify
in interfaceMeasurementListener
-
pruneMeasurementRepList
void pruneMeasurementRepList()
-
clear
void clear()
Clear the measurement history
-
-