Class TrackerPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.opensourcephysics.display.DrawingPanel
org.opensourcephysics.display.InteractivePanel
org.opensourcephysics.media.core.VideoPanel
org.opensourcephysics.cabrillo.tracker.TrackerPanel
- All Implemented Interfaces:
ActionListener
,ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
,Scrollable
,InteractiveMouseHandler
,OSPRuntime.Disposable
,Renderable
This extends VideoPanel to manage and draw TTracks. It is Tracker's main view
and repository of a video and its associated tracks.
- Author:
- Douglas Brown
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.display.InteractivePanel
InteractivePanel.IADMouseController
Nested classes/interfaces inherited from class org.opensourcephysics.display.DrawingPanel
DrawingPanel.PopupmenuListener, DrawingPanel.ZoomBox
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DerivativeAlgorithmDialog
protected AttachmentDialog
protected String
protected AutoTracker
protected JLabel
static final String
Calibration tool typeschangeable TapeMeasure, Calibration, OffsetOriginprotected String
protected TCoordinateStringBuilder
protected XMLControl
protected XMLControl
protected XMLControl
protected XMLProperty
protected TrackDataBuilder
protected boolean
protected String
protected Rectangle
protected double[]
protected double[]
protected TFrame
protected PlotGuestDialog
protected boolean
protected int
protected int
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected String
protected PropertyChangeListener
protected PropertyChangeListener
protected String
static final double
The maximum zoom levelstatic final double
The minimum zoom levelprotected ModelBuilder
protected TMouseHandler
protected TPoint
static final String
Calibration tool typesprotected String
protected Integer
a unique identifier for this TrackerPanelprotected PasteDataDialog
protected TPoint
protected JPopupMenu
protected AffineTransform
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected JScrollPane
protected TPoint
protected Step
protected StepSet
protected TTrack
protected XMLProperty
protected XMLProperty
protected XMLProperty
protected Integer
protected TPoint
static final String
Calibration tool typesstatic final String
Calibration tool typesprotected String
protected TrackControl
protected int
protected int
protected UnitsDialog
protected boolean
protected double
static final double[]
The fixed zoom levelsstatic final double
The zoom step sizeprotected Point
Fields inherited from class org.opensourcephysics.media.core.VideoPanel
changed, coords, dataFile, defaultFileName, defaultHeight, defaultWidth, drawingInImageSpace, filterClasses, framesLoaded, imageBorder, imageHeight, imageWidth, loader, player, playerVisible, progress, PROPERTY_VIDEOPANEL_DATAFILE, PROPERTY_VIDEOPANEL_IMAGESPACE, pt, timeUnit, video, xOffset, yOffset
Fields inherited from class org.opensourcephysics.display.InteractivePanel
containsInteractive, interactive, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, mouseAction, mouseEvent
Fields inherited from class org.opensourcephysics.display.DrawingPanel
adjustableGutter, antialiasShapeOn, antialiasTextOn, autoscaleItem, autoscaleMargin, autoscaleX, autoscaleXMax, autoscaleXMin, autoscaleY, autoscaleYMax, autoscaleYMin, bgColor, BOTTOM_LEFT, BOTTOM_RIGHT, bottomGutter, bottomGutterPreferred, clipAtGutter, coordinateStrBuilder, currentTime, customInspector, decimalFormat, dimensionSetter, displayCoordsOnMouseMoved, drawableList, dxmax, dxmin, dymax, dymin, enableZoom, fixedPixelPerUnit, fixedScale, guiChangeListener, imageRatio, isDisposed, isInteractive, lastHeight, lastWidth, leftGutter, leftGutterPreferred, logScaleX, logScaleY, messages, messagesAsJLabels, mouseController, offscreenImage, optionController, paintDrawables, pixelMatrix, pixelTransform, popupmenu, propertiesItem, RECORD_PAINT_TIMES, refreshDelay, refreshTimer, rightGutter, rightGutterPreferred, scaleItem, scientificFormat, showCoordinates, snapshotItem, squareAspect, TOP_LEFT, TOP_RIGHT, topGutter, topGutterPreferred, vidCap, viewRect, workingImage, xceil, xfloor, xLeftMarginPercentage, xmax, xmaxPreferred, xmin, xminPreferred, xPixPerUnit, xRightMarginPercentage, yBottomMarginPercentage, yceil, yfloor, ymax, ymaxPreferred, ymin, yminPreferred, yPixPerUnit, yTopMarginPercentage, zoomBox, zoomCount, zoomDelay, zoomInItem, zoomOutItem, zoomTimer
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
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface org.opensourcephysics.display.OSPRuntime.Disposable
allocated
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a blank TrackerPanel with a player.TrackerPanel
(boolean ignored) TrackerPanel
(TFrame frame) Constructs a blank TrackerPanel with a player and GUI.TrackerPanel
(TFrame frame, TrackerPanel panel) TrackerPanel
(TFrame frame, Video video) Constructs a TrackerPanel with a video and player.TrackerPanel
(TFrame frame, Video video, TrackerPanel panel) load with video -- not supported -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDirtyRegion
(Rectangle dirtyRect) Adds the specified rectangle to the dirty region.void
addDrawable
(Drawable drawable) Overrides VideoPanel addDrawable method.void
addListeners
(String[] names, PropertyChangeListener listener) void
void
Adds a track.void
addVideoFilter
(String type) protected void
void
askSaveIfChanged
(Function<Boolean, Void> whenClosed, Runnable whenCanceled) Saves this TrackerPanel if changed, then runs the appropriate Runnablevoid
Check for locked tracks and get list of xml strings for undoableEdit.void
clear()
Overrides VideoPanel clear method.void
void
void
Clears all tracks.void
cloneNamed
(String name) boolean
containsTrack
(TTrack track) Determines if the specified track is in this tracker panel.protected FunctionPanel
createFunctionPanel
(TTrack track) Creates a new FunctionPanel for a track.protected void
deletePoint
(TPoint pt) Deletes a point.protected void
Deletes the selected steps, if any.void
dispose()
Disposes of this panel permanently.void
doAutoPaste
(String dataString) Pastes a string and reloads external models (DataTracks).void
Pastes a string and imports any objects or data.void
eraseAll()
Erases all tracks in this tracker panel.void
finalize()
protected DerivativeAlgorithmDialog
Gets the Algorithms dialog.getAttachmentDialog
(TTrack track) Gets the attachment dialog for attaching measuring tool points to point masses.protected AutoTracker
getAutoTracker
(boolean forceNew) Gets the autotracker for this panelgetAxes()
Gets the coordinate axes.protected FunctionTool
Gets the data builder for defining custom data functions.protected static double
Gets the default image height for new empty panelsprotected static double
Gets the default image width for new empty panelsGets the description of this panel.Overrides VideoPanel getDrawables method.getDrawablesTemp
(Class<T> type) Gets the enabled property set.int
Gets the list of TTracks with exportable data on this panel.Overrides VideoPanel getFilePath method.getFormatPatterns
(int ttype) Gets the default format patterns for a specified track typegetID()
Overrides InteractivePanel getInteractive method.Gets the length unit.static XML.ObjectLoader
Returns an XML.ObjectLoader to save and load object data.double
Gets the magnification.Return the actual panel, which in the case of WorldTView is not this, rather the TrackerPanel it was initialized with.Gets the mass unit.getMat()
Gets the mat.protected BufferedImage
getMenuBar
(boolean forceNew) Gets the model builder.protected MouseEvent
Gets the most recent mouse event.protected String
getNextName
(String name, String connector) Gets the next available name (and color, based on the attached suffix) for a track.Gets the PasteDataDialog for pasting data into TrackerJS.Gets the plot guest dialog for comparing multiple track data in a single plot.protected JPopupMenu
getPopup()
Gets the popup menu.Gets the preferred scrollable viewport size.int
getScrollableBlockIncrement
(Rectangle visibleRect, int orientation, int direction) Gets the scrollable block increment.boolean
Gets whether this tracks the viewport height.boolean
Gets whether this tracks the viewport width in a scrollpane.int
getScrollableUnitIncrement
(Rectangle visibleRect, int orientation, int direction) Gets the scrollable unit increment.Gets the selected point.Gets the selected step.Gets the selected track.Returns pointID if this panel is actively selecting.Gets the origin snap point.Gets the list of system Drawables.Gets the TFrame parent of this panelgetTitle()
Gets the title for tabs, menus, etc.getToolBar
(boolean forceNew) Gets the path used as tooltip for the tab.Gets the first track with the specified namegetTrackBar
(boolean forceNew) <T extends TTrack>
TgetTrackByName
(Class<T> type, String name) Gets a list of TTracks being drawn on this panel.Gets a list of TTracks being drawn on this panel.Gets the list of TTracks to save with this panel.Gets the units for a given track and variable.Gets the units dialog.Gets the list of user-controlled TTracks on this panel.Gets a XYCoordinateStringBuilder for a TPoint to display its coordinates.protected void
Handles keypress events for selected points.protected void
importData
(String dataString, Object source) Deprecated.void
importDataAsync
(String dataString, Object source, Runnable whenDone) Imports Data from a data string (delimited fields) into a DataTrack.void
initialize
(FileDropHandler fileDropHandler) boolean
boolean
REturns true if any new.trackType is enabled.boolean
Gets the enabled state for the specified key.boolean
boolean
Returns true if mouse coordinates are displayed.protected boolean
protected boolean
isTrackViewDisplayed
(TTrack track) Determines if the specified track is currently displayed in a table or plot view.boolean
Gets the units visibility.boolean
boolean
Returns true if an event starts or ends a zoom operation.static void
void
moveToBack
(Drawable drawable) Moves a drawable behind all others except the video.void
protected void
offerReloadVM
(String ext, String message) void
void
onLoaded()
void
void
void
Paints this component.void
Responds to property change events.Identifying only for debugging purposes.protected void
Refreshes the decimal separators.void
refreshMenus
(String why) void
protected void
refreshTrackData
(int mode) Refreshes all data in tracks and views.protected void
reload()
Reload tracks from datafile.void
removeDrawable
(Drawable drawable) Overrides VideoPanel removeDrawable method.void
removeListeners
(String[] names, PropertyChangeListener listener) <T extends Drawable>
voidremoveObjectsOfClass
(Class<T> c) Overrides VideoPanel removeObjectsOfClass method.void
removePointMassListeners
(PointMass pointMass) void
removeTrack
(TTrack track) Removes a track.void
repaint()
void
repaint
(long time, int x, int y, int w, int h) All repaints funnel through this methodvoid
Repaints the dirty region.protected void
Restores the views to a non-maximized state.void
scale()
Overrides DrawingPanel scale method.protected void
Overrides VideoPanel scale method to handle zoomvoid
setAutoRefresh
(boolean b) Sets the visibility of the clip settings dialog.void
setCoords
(ImageCoordSystem _coords) Overrides VideoPanel setCoords method.void
protected boolean
setCursorForMarking
(boolean invert, InputEvent e) Sets the cursor to a crosshair when the selected track is marking and is unmarked on the current frame.void
setDescription
(String desc) Sets the description of this panel.void
setEnabled
(String key, boolean enable) Sets the enabled state for the specified key.void
setEnabled
(Set<String> enable) Sets the enabled property set.void
setFontLevel
(int level) Sets the font level.protected void
setGUI()
void
setImageBorder
(double borderFraction) Overrides VideoPanel setImageBorder method to set the image border.void
setImageHeight
(double h) Sets the image height in image units.void
setImageSize
(double w, double h) Sets the image size in image units.void
setImageWidth
(double w) Sets the image width in image units.protected void
Sets the initial default format patterns for all track types and existing tracksboolean
setLengthUnit
(String unit) Sets the length unit.void
setMagnification
(double magnification) Sets the magnification.boolean
setMassUnit
(String unit) Sets the mass unit.void
setMessage
(String msg) Shows a message in BR corner.void
setMouseCursor
(Cursor cursor) Overrides DrawingPanel setMouseCursor method.protected void
void
setReferenceFrame
(String trackName) Sets the reference frame by name.void
setScrollPane
(JScrollPane scroller) Sets the scroll pane.void
setSelectedPoint
(TPoint point) Sets the selected point.void
setSelectedTrack
(TTrack track) Sets the selected track.void
boolean
setTimeUnit
(String unit) Sets the time unit.protected void
setTrackName
(TTrack track, String newName, boolean postEdit) Sets the name of a track.void
setUnitsVisible
(boolean visible) Sets the units visibility.void
Overrides VideoPanel setVideo method.void
setVideoVisible
(boolean visible) void
setVisible
(boolean b) Makes the component visible or invisible.protected void
Shows the visible filter inspectors, if any.void
void
toString()
protected boolean
Methods inherited from class org.opensourcephysics.media.core.VideoPanel
addFilter, checkImage, clearFilters, getCoords, getDataFile, getDrawablesNoClone, getFilters, getFrameNumber, getImageBorder, getImageHeight, getImageWidth, getPlayer, getProgress, getStepNumber, getTimeUnit, getVideo, getWorldMousePoint, hideMouseBox, importData, isDrawingInImageSpace, isPlayerVisible, paintEverything, releaseResources, removeFilter, setDataFile, setDrawingInImageSpace, setLoader, setPlayerVisible, setProgress, setResourceLoading, setVideo
Methods inherited from class org.opensourcephysics.display.InteractivePanel
getCurrentDraggable, getMouseAction, getMouseButton, getMouseClickCount, getMouseIntX, getMouseIntY, getMouseX, getMouseY, handleMouseAction, saveMouseEvent, scaleX, scaleY, setInteractiveMouseHandler, setShowCoordinates
Methods inherited from class org.opensourcephysics.display.DrawingPanel
actionPerformed, addDrawableAtIndex, addDrawables, addMessageLabel, addOptionController, buildPopupMenu, checkWorkingImage, computeGutters, displayCoordinates, dref, enableInspector, findViewRect, firePropertyChange, getAspectRatio, getBottomGutter, getCoordinateStringBuilder, getDimensionSetter, getDrawables, getDrawables, getDrawablesExcept, getDrawablesExcept, getFirstDrawable, getGlassPane, getGutters, getHeight, getImageRatio, getLeftGutter, getMaxPixPerUnit, getMeasure, getObjectOfClass, getPixelMatrix, getPixelTransform, getPixelTransform, getPreferredXMax, getPreferredXMin, getPreferredYMax, getPreferredYMin, getRightGutter, getScale, getSnapshotItem, getTopGutter, getVideoTool, getViewRect, getWidth, getXMax, getXMin, getXPixPerUnit, getYMax, getYMin, getYPixPerUnit, getZoomBox, hasInspector, hideInspector, invalidateImage, isAdjustableGutter, isAntialiasShapeOn, isAntialiasTextOn, isAutoscaleX, isAutoscaleXMax, isAutoscaleXMin, isAutoscaleY, isAutoscaleYMax, isAutoscaleYMin, isBuffered, isClipAtGutter, isFixedScale, isIconified, isLogScaleX, isLogScaleY, isPointInside, isSquareAspect, isValidImage, isZoom, limitAutoscaleX, limitAutoscaleY, measure, paintDrawableList, paintFirst, paintLast, pixToX, pixToY, project, receiveToolReply, recomputeTransform, refreshGUI, removeDrawables, removeOptionController, render, render, repaint, repaintForZoom, repaintIfNecessary, replaceDrawable, resetGutters, scaleX, scaleY, setAdjustableGutter, setAntialiasShapeOn, setAntialiasTextOn, setAutoscaleMargin, setAutoscaleX, setAutoscaleY, setBounds, setBounds, setBuffered, setClipAtGutter, setCoordinateStringBuilder, setCustomInspector, setFixedScale, setFontFactor, setGutters, setGutters, setMessage, setPaintDrawables, setPixelScale, setPixelsPerUnit, setPopupMenu, setPreferredGutters, setPreferredMinMax, setPreferredMinMax, setPreferredMinMaxX, setPreferredMinMaxY, setSquareAspect, setVideoTool, setXLeftMarginPercentage, setXMarginPercentage, setXMarginPercentage, setXRightMarginPercentage, setYBottomMarginPercentage, setYMarginPercentage, setYMarginPercentage, setYTopMarginPercentage, setZoom, showInspector, snapshot, transformPath, transformShape, validateImage, xToGraphics, xToPix, yToGraphics, yToPix, zoomIn, zoomOut
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, 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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
PROPERTY_TRACKERPANEL_CLEAR
- See Also:
-
PROPERTY_TRACKERPANEL_IMAGE
- See Also:
-
PROPERTY_TRACKERPANEL_LOADED
- See Also:
-
PROPERTY_TRACKERPANEL_MAGNIFICATION
- See Also:
-
PROPERTY_TRACKERPANEL_SELECTEDPOINT
- See Also:
-
PROPERTY_TRACKERPANEL_SELECTEDTRACK
- See Also:
-
PROPERTY_TRACKERPANEL_SIZE
- See Also:
-
PROPERTY_TRACKERPANEL_STEPNUMBER
- See Also:
-
PROPERTY_TRACKERPANEL_TRACK
- See Also:
-
PROPERTY_TRACKERPANEL_UNITS
- See Also:
-
PROPERTY_TRACKERPANEL_VIDEO
- See Also:
-
PROPERTY_TRACKERPANEL_VIDEOVISIBLE
- See Also:
-
MIN_ZOOM
public static final double MIN_ZOOMThe minimum zoom level- See Also:
-
MAX_ZOOM
public static final double MAX_ZOOMThe maximum zoom level- See Also:
-
ZOOM_STEP
public static final double ZOOM_STEPThe zoom step size -
ZOOM_LEVELS
public static final double[] ZOOM_LEVELSThe fixed zoom levels -
STICK
Calibration tool types- See Also:
-
TAPE
Calibration tool types- See Also:
-
CALIBRATION
Calibration tool types- See Also:
-
OFFSET
Calibration tool types- See Also:
-
frame
-
panelID
a unique identifier for this TrackerPanel -
selectedPoint
-
selectedStep
-
selectingPanelID
-
selectedTrack
-
newlyMarkedPoint
-
dirty
-
prevPixelTransform
-
zoom
protected double zoom -
scrollPane
-
popup
-
enabled
-
snapPoint
-
currentState
-
currentCoords
-
currentSteps
-
pointState
-
mouseHandler
-
badNameLabel
-
dataBuilder
-
dataToolVisible
protected boolean dataToolVisible -
customViewsProperty
-
selectedViewsProperty
-
selectedViewTypesProperty
-
selectedTrackViewsProperty
-
dividerLocs
protected double[] dividerLocs -
zoomCenter
-
visibleFilters
-
trackControlX
protected int trackControlX -
trackControlY
protected int trackControlY -
infoX
protected int infoX -
infoY
protected int infoY -
defaultSavePath
-
openedFromPath
-
modelBuilder
-
trackControl
-
isModelBuilderVisible
protected boolean isModelBuilderVisible -
isShiftKeyDown
protected boolean isShiftKeyDown -
isControlKeyDown
protected boolean isControlKeyDown -
isEnterKeyDown
protected boolean isEnterKeyDown -
isAutoPaste
protected boolean isAutoPaste -
calibrationTools
changeable TapeMeasure, Calibration, OffsetOrigin -
visibleCalibrationTools
-
measuringTools
-
visibleMeasuringTools
-
author
-
contact
-
autoTracker
-
algorithmDialog
-
attachmentDialog
-
guestsDialog
-
unitsDialog
-
pasteDataDialog
-
isNotesVisible
protected boolean isNotesVisible -
supplementalFilePaths
-
pageViewFilePaths
-
selectedSteps
-
hideDescriptionWhenLoaded
protected boolean hideDescriptionWhenLoaded -
massParamListener
-
massChangeListener
-
formatPatterns
-
lengthUnit
-
massUnit
-
unitsVisible
protected boolean unitsVisible -
coordStringBuilder
-
andWorld
-
dividerFractions
protected double[] dividerFractions -
numberFormatDialog
-
title
-
-
Constructor Details
-
TrackerPanel
public TrackerPanel()Constructs a blank TrackerPanel with a player. We need a frame - at the very least, new TFrame() -
TrackerPanel
public TrackerPanel(boolean ignored) -
TrackerPanel
Constructs a blank TrackerPanel with a player and GUI. -
TrackerPanel
Constructs a TrackerPanel with a video and player.- Parameters:
video
- the video
-
TrackerPanel
-
TrackerPanel
load with video -- not supported- Parameters:
frame
-video
-panel
-
-
-
Method Details
-
getID
-
setTFrame
-
isWorldPanel
public boolean isWorldPanel() -
getActions
-
setGUI
protected void setGUI() -
addVideoPlayer
protected void addVideoPlayer()- Overrides:
addVideoPlayer
in classVideoPanel
-
setMouseListeners
protected void setMouseListeners()- Overrides:
setMouseListeners
in classInteractivePanel
-
setVideo
Overrides VideoPanel setVideo method.- Overrides:
setVideo
in classVideoPanel
- Parameters:
newVideo
- the video; may be null
-
getTitle
Gets the title for tabs, menus, etc.- Returns:
- the title
-
getToolTipPath
Gets the path used as tooltip for the tab.- Returns:
- the path
-
getDescription
Gets the description of this panel.- Returns:
- the description
-
setDescription
Sets the description of this panel.- Parameters:
desc
- a description
-
getModelBuilder
Gets the model builder.- Returns:
- the model builder
-
addDirtyRegion
Adds the specified rectangle to the dirty region. The dirty region is repainted when repaintDirtyRegion is called. A null dirtyRect argument is ignored.- Parameters:
dirtyRect
- the dirty rectangle
-
repaintDirtyRegion
public void repaintDirtyRegion()Repaints the dirty region. -
getTracks
Gets a list of TTracks being drawn on this panel.- Returns:
- a list of tracks
-
getTracksTemp
Gets a list of TTracks being drawn on this panel.- Returns:
- a list of tracks
-
getUserTracks
Gets the list of user-controlled TTracks on this panel.- Returns:
- a list of tracks under direct user control
-
getExportableTracks
Gets the list of TTracks with exportable data on this panel.- Returns:
- a list of tracks with exportable data
-
getTracksToSave
Gets the list of TTracks to save with this panel.- Returns:
- a list of tracks to save
-
getTrack
-
getTrack
Gets the first track with the specified name- Parameters:
name
- the name of the track- Returns:
- the track
-
addTrack
Adds a track.- Parameters:
track
- the track to add
-
isTrackViewDisplayed
Determines if the specified track is currently displayed in a table or plot view.- Parameters:
track
- the track- Returns:
- true if displayed in a plot or table view
-
createFunctionPanel
Creates a new FunctionPanel for a track.- Parameters:
track
- the track- Returns:
- the FunctionPanel
-
removePointMassListeners
-
removeTrack
Removes a track.- Parameters:
track
- the track to remove
-
containsTrack
Determines if the specified track is in this tracker panel.- Parameters:
track
- the track to look for- Returns:
true
if this contains the track
-
eraseAll
public void eraseAll()Erases all tracks in this tracker panel. -
askSaveIfChanged
Saves this TrackerPanel if changed, then runs the appropriate Runnable -
getDrawables
Overrides VideoPanel getDrawables method.- Overrides:
getDrawables
in classVideoPanel
- Returns:
- a list of Drawable objects
-
getSystemDrawables
Gets the list of system Drawables.- Returns:
- a list of Drawable objects
-
addDrawable
Overrides VideoPanel addDrawable method.- Overrides:
addDrawable
in classVideoPanel
- Parameters:
drawable
- the drawable object
-
moveToBack
Moves a drawable behind all others except the video.- Parameters:
drawable
- the drawable object
-
removeDrawable
Overrides VideoPanel removeDrawable method.- Overrides:
removeDrawable
in classVideoPanel
- Parameters:
drawable
- the drawable object
-
removeObjectsOfClass
Overrides VideoPanel removeObjectsOfClass method.- Overrides:
removeObjectsOfClass
in classVideoPanel
- Parameters:
c
- the class to remove- See Also:
-
clear
public void clear()Overrides VideoPanel clear method.- Overrides:
clear
in classVideoPanel
-
clearTracks
public void clearTracks()Clears all tracks. -
setCoords
Overrides VideoPanel setCoords method.- Overrides:
setCoords
in classVideoPanel
- Parameters:
_coords
- the new image coordinate system
-
setReferenceFrame
Sets the reference frame by name. If the name is null or not found, the default reference frame is used.- Parameters:
trackName
- the name of a point mass
-
getAxes
Gets the coordinate axes.- Returns:
- the CoordAxes
-
getMat
Gets the mat.- Returns:
- the first TMat in the drawable list
-
getSnapPoint
Gets the origin snap point.- Returns:
- the snap point
-
setCursor
-
setSelectedTrack
Sets the selected track.- Parameters:
track
- the track to select
-
getSelectedTrack
Gets the selected track.- Returns:
- the selected track
-
setSelectedPoint
Sets the selected point. Also sets the selected step, track, and selecting panel.- Parameters:
point
- the point to receive actions
-
getSelectingPanelID
Returns pointID if this panel is actively selecting.- Returns:
-
getSelectedPoint
Gets the selected point.- Returns:
- the selected point
-
getSelectedStep
Gets the selected step.- Returns:
- the selected step
-
setMagnification
public void setMagnification(double magnification) Sets the magnification.- Parameters:
magnification
- the desired magnification
-
getMagnification
public double getMagnification()Gets the magnification.- Returns:
- the magnification
-
setImageWidth
public void setImageWidth(double w) Sets the image width in image units. Overrides VideoPanel method.- Overrides:
setImageWidth
in classVideoPanel
- Parameters:
w
- the width
-
setImageHeight
public void setImageHeight(double h) Sets the image height in image units. Overrides VideoPanel method.- Overrides:
setImageHeight
in classVideoPanel
- Parameters:
h
- the height
-
setImageSize
public void setImageSize(double w, double h) Sets the image size in image units.- Parameters:
w
- the widthh
- the height
-
setClipSettingsVisible
Sets the visibility of the clip settings dialog.- Parameters:
vis
- null to toggle visibility, otherwise usual true/false
-
setScrollPane
Sets the scroll pane.- Parameters:
scroller
- the scroll pane containing this panel
-
getPreferredScrollableViewportSize
Gets the preferred scrollable viewport size.- Specified by:
getPreferredScrollableViewportSize
in interfaceScrollable
- Returns:
- the preferred scrollable viewport size
-
getScrollableUnitIncrement
Gets the scrollable unit increment.- Specified by:
getScrollableUnitIncrement
in interfaceScrollable
- Parameters:
visibleRect
- the rectangle currently visible in the scrollpaneorientation
- the orientation of the scrollbardirection
- the direction of movement of the scrollbar- Returns:
- the scrollable unit increment
-
getScrollableBlockIncrement
Gets the scrollable block increment.- Specified by:
getScrollableBlockIncrement
in interfaceScrollable
- Parameters:
visibleRect
- the rectangle currently visible in the scrollpaneorientation
- the orientation of the scrollbardirection
- the direction of movement of the scrollbar- Returns:
- the scrollable block increment
-
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()Gets whether this tracks the viewport width in a scrollpane.- Specified by:
getScrollableTracksViewportWidth
in interfaceScrollable
- Returns:
true
if this tracks the width
-
getScrollableTracksViewportHeight
public boolean getScrollableTracksViewportHeight()Gets whether this tracks the viewport height.- Specified by:
getScrollableTracksViewportHeight
in interfaceScrollable
- Returns:
true
if this tracks the height
-
isUnitsVisible
public boolean isUnitsVisible()Gets the units visibility.- Returns:
true
if units are displayed
-
setUnitsVisible
public void setUnitsVisible(boolean visible) Sets the units visibility.- Parameters:
visible
-true
to display units
-
getMassUnit
Gets the mass unit.- Returns:
- the mass unit
-
setMassUnit
Sets the mass unit.- Parameters:
unit
- the mass unit- Returns:
- true if unit was changed
-
getLengthUnit
Gets the length unit.- Returns:
- the length unit
-
setLengthUnit
Sets the length unit.- Parameters:
unit
- the length unit- Returns:
- true if unit was changed
-
setTimeUnit
Description copied from class:VideoPanel
Sets the time unit.- Overrides:
setTimeUnit
in classVideoPanel
- Parameters:
unit
- the time unit- Returns:
- true if unit was changed
-
getUnits
Gets the units for a given track and variable.- Parameters:
track
- the trackvar
- the variable- Returns:
- the units
-
isShowCoordinates
public boolean isShowCoordinates()Returns true if mouse coordinates are displayed. Overrides DrawingPanel method to report false if a point is selected.- Overrides:
isShowCoordinates
in classDrawingPanel
- Returns:
true
if mouse coordinates are displayed
-
setMessage
Shows a message in BR corner. Overrides DrawingPanel method.- Overrides:
setMessage
in classDrawingPanel
- Parameters:
msg
- the message
-
importData
Deprecated.See importDataAsync- Parameters:
dataString
-source
-
-
importDataAsync
Imports Data from a data string (delimited fields) into a DataTrack. The data string must be parsable by DataTool. If the string is a path, an attempt is made to get the data string with ResourceLoader. Optionally asynchronous (required async for JavaScript) Source object (model) may be String path, JPanel controlPanel, Tool tool, etc- Parameters:
dataString
- delimited fields parsable by DataTool, or a path to a Resourcesource
- the data source (may be null)whenDone
- Runnable to run when complete
-
refreshTrackData
protected void refreshTrackData(int mode) Refreshes all data in tracks and views. -
refreshDecimalSeparators
protected void refreshDecimalSeparators()Description copied from class:DrawingPanel
Refreshes the decimal separators.- Overrides:
refreshDecimalSeparators
in classDrawingPanel
-
getMouseEvent
Gets the most recent mouse event.- Returns:
- the MouseEvent
-
getPopupMenu
Gets the popup menu. Overrides DrawingPanel method.- Overrides:
getPopupMenu
in classDrawingPanel
-
getPopup
-
getUnitsDialog
Gets the units dialog.- Returns:
- the units dialog
-
getAttachmentDialog
Gets the attachment dialog for attaching measuring tool points to point masses.- Parameters:
track
- a measuring tool- Returns:
- the attachment dialog
-
getPasteDataDialog
Gets the PasteDataDialog for pasting data into TrackerJS.- Returns:
- the PasteDataDialog
-
getPlotGuestDialog
Gets the plot guest dialog for comparing multiple track data in a single plot.- Parameters:
plot
- a TrackPlottingPanel- Returns:
- the plot guest dialog
-
getDataBuilder
Gets the data builder for defining custom data functions.- Returns:
- the data builder
-
getAlgorithmDialog
Gets the Algorithms dialog.- Returns:
- the properties dialog
-
getNextName
Gets the next available name (and color, based on the attached suffix) for a track.- Parameters:
name
- the default name with no letter suffixconnector
- the string connecting the name and letter- Returns:
- name + connector + letter or null
-
restoreViews
protected void restoreViews()Restores the views to a non-maximized state. -
setCursorForMarking
Sets the cursor to a crosshair when the selected track is marking and is unmarked on the current frame. Also displays hints as a side effect.- Parameters:
invert
- true to invert the normal statee
- an input event- Returns:
- true if marking (ie next mouse click will mark a TPoint)
-
handleKeyPress
Handles keypress events for selected points.- Parameters:
e
- the key event
-
getEnabled
Gets the enabled property set.- Returns:
- the set of enabled properties
-
setEnabled
Sets the enabled property set.- Parameters:
enable
- the set of enabled properties
-
isEnabled
Gets the enabled state for the specified key.- Parameters:
key
- the string key- Returns:
- true if enabled
-
setEnabled
Sets the enabled state for the specified key.- Parameters:
key
- the string keyenable
- true to enable the key
-
isCreateTracksEnabled
public boolean isCreateTracksEnabled()REturns true if any new.trackType is enabled.- Returns:
- true if enabled
-
propertyChange
Responds to property change events.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classVideoPanel
- Parameters:
e
- the property change event
-
setImageBorder
public void setImageBorder(double borderFraction) Overrides VideoPanel setImageBorder method to set the image border.- Overrides:
setImageBorder
in classVideoPanel
- Parameters:
borderFraction
- the border fraction
-
getFilePath
Overrides VideoPanel getFilePath method.- Overrides:
getFilePath
in classVideoPanel
- Returns:
- the relative path to the file
-
scale
public void scale()Overrides DrawingPanel scale method.- Overrides:
scale
in classDrawingPanel
-
setMouseCursor
Overrides DrawingPanel setMouseCursor method. This blocks the crosshair cursor (from iad mouse controller) so that Tracker can set cursors for marking tracks.- Overrides:
setMouseCursor
in classDrawingPanel
- Parameters:
cursor
- the requested cursor
-
setFontLevel
public void setFontLevel(int level) Sets the font level.- Overrides:
setFontLevel
in classDrawingPanel
- Parameters:
level
- the desired font level
-
isZoomEvent
Returns true if an event starts or ends a zoom operation. Used by OptionController. Overrides DrawingPanel method.- Overrides:
isZoomEvent
in classDrawingPanel
- Parameters:
e
- a mouse event- Returns:
- true if a zoom event
-
getInteractive
Overrides InteractivePanel getInteractive method. This checks the selected track (if any) first.- Overrides:
getInteractive
in classInteractivePanel
- Returns:
- the interactive drawable identified by the most recent mouse event
-
getXYCoordinateStringBuilder
Description copied from class:VideoPanel
Gets a XYCoordinateStringBuilder for a TPoint to display its coordinates. This default implementation returns the static TPoint string builder.- Overrides:
getXYCoordinateStringBuilder
in classVideoPanel
- Parameters:
point
- the TPoint- Returns:
- the XYCoordinateStringBuilder
-
getMattedImage
-
deletePoint
Deletes a point.- Parameters:
pt
- the point to delete
-
deleteSelectedSteps
protected void deleteSelectedSteps()Deletes the selected steps, if any. -
scale
Overrides VideoPanel scale method to handle zoom- Overrides:
scale
in classVideoPanel
- Parameters:
drawables
- the list of drawable objects
-
paintComponent
Paints this component. Overrides DrawingPanel method to log times- Overrides:
paintComponent
in classDrawingPanel
- Parameters:
g
- the graphics context
-
getDefaultImageWidth
protected static double getDefaultImageWidth()Gets the default image width for new empty panels- Returns:
- width
-
getDefaultImageHeight
protected static double getDefaultImageHeight()Gets the default image height for new empty panels- Returns:
- height
-
getTFrame
Gets the TFrame parent of this panel- Returns:
- the TFrame, if any
-
getAutoTracker
Gets the autotracker for this panel- Returns:
- the autotracker, if any
-
getFormatPatterns
Gets the default format patterns for a specified track type- Parameters:
trackType
- the track type- Returns:
- a map of variable name to pattern
-
setInitialFormatPatterns
protected void setInitialFormatPatterns()Sets the initial default format patterns for all track types and existing tracks -
dispose
public void dispose()Disposes of this panel permanently. Only to be used upon tab removal, and only to be run once.- Specified by:
dispose
in interfaceOSPRuntime.Disposable
- Overrides:
dispose
in classVideoPanel
-
setTrackName
Sets the name of a track. This checks the name against those of existing tracks and prompts the user for a new name if a duplicate is found. After three failed attempts, a unique name is formed by appending a number.- Parameters:
track
- the track to namenewName
- the proposed namepostEdit
- true to post an undoable edit
-
showFilterInspectors
protected void showFilterInspectors()Shows the visible filter inspectors, if any. -
getLoader
Returns an XML.ObjectLoader to save and load object data.- Returns:
- the XML.ObjectLoader
-
isAutoRefresh
public boolean isAutoRefresh() -
setAutoRefresh
public void setAutoRefresh(boolean b) -
updateMainPopup
-
isStepsInZoomBox
protected boolean isStepsInZoomBox() -
setVideoVisible
public void setVideoVisible(boolean visible) -
isPaintable
public boolean isPaintable() -
repaint
public void repaint()- Overrides:
repaint
in classDrawingPanel
-
repaint
public void repaint(long time, int x, int y, int w, int h) All repaints funnel through this method- Overrides:
repaint
in classJComponent
-
setVisible
public void setVisible(boolean b) Description copied from class:DrawingPanel
Makes the component visible or invisible. OverridesJComponent.setVisible
.- Overrides:
setVisible
in classDrawingPanel
- Parameters:
b
- true to make the component visible; false to make it invisible
-
notifyLoadingComplete
public void notifyLoadingComplete() -
taintEnabled
public void taintEnabled() -
getEnabledCount
public int getEnabledCount() -
clearTainted
public void clearTainted() -
doPaste
Pastes a string and imports any objects or data. Called by pasteXML menu item- Parameters:
data
- the data string
-
doAutoPaste
Pastes a string and reloads external models (DataTracks). Called by clipboard listener when auto-pasting- Parameters:
dataString
- the data string- Throws:
Exception
-
initialize
-
getDrawablesTemp
-
getTrackByName
-
clearTemp
public void clearTemp() -
addNotify
public void addNotify()- Overrides:
addNotify
in classJComponent
-
paint
- Overrides:
paint
in classDrawingPanel
-
cloneNamed
-
checkAndClearTracks
public void checkAndClearTracks()Check for locked tracks and get list of xml strings for undoableEdit. From clearTracks action. -
reload
protected void reload()Reload tracks from datafile. This may be useful if a user edits track data directly in the xml file. -
openURLFromDialog
public void openURLFromDialog() -
toggleAxesVisible
public void toggleAxesVisible() -
addVideoFilter
-
offerReloadVM
- Overrides:
offerReloadVM
in classVideoPanel
-
onLoaded
public void onLoaded() -
getTabName
-
onBlocked
public void onBlocked() -
addListeners
-
removeListeners
-
refreshNotesDialog
public void refreshNotesDialog() -
main
-
ref
Identifying only for debugging purposes. Currently just TTrack.- Parameters:
o
-- Returns:
-
getMainPanel
Return the actual panel, which in the case of WorldTView is not this, rather the TrackerPanel it was initialized with.- Returns:
-
refreshMenus
-
unTracked
protected boolean unTracked() -
getMenuBar
-
getToolBar
-
getTrackBar
-
toString
-
finalize
public void finalize() -
getMatBounds
-