org.opensourcephysics.cabrillo.tracker
Class TrackerPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.opensourcephysics.display.DrawingPanel
                      extended by org.opensourcephysics.display.InteractivePanel
                          extended by org.opensourcephysics.media.core.VideoPanel
                              extended by org.opensourcephysics.cabrillo.tracker.TrackerPanel
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.Scrollable, InteractiveMouseHandler, Renderable
Direct Known Subclasses:
WorldTView

public class TrackerPanel
extends VideoPanel
implements javax.swing.Scrollable

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:
Serialized Form

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.ZoomBox
 
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
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.lang.String alphabet
           
protected  java.lang.String author
           
protected  AutoTracker autoTracker
           
protected  javax.swing.JLabel badNameLabel
           
static java.lang.String CALIBRATION
          Calibration tool types
protected  java.util.ArrayList<TTrack> calibrationTools
           
protected  java.lang.String contact
           
protected  XMLControl currentCoords
           
protected  XMLControl currentState
           
protected  FunctionTool dataBuilder
           
protected  boolean dataToolVisible
           
protected  double defaultImageBorder
           
protected  java.lang.String defaultSavePath
           
protected  java.lang.String description
           
protected  java.awt.Rectangle dirty
           
protected  double[] dividerLocs
           
protected  java.util.Set<java.lang.String> enabled
           
protected  javax.swing.JLabel endFrameLabel
           
protected  org.opensourcephysics.cabrillo.tracker.TrackerPanel.ModelFrameSpinner endFrameSpinner
           
protected  TFrame frame
           
protected  int infoX
           
protected  int infoY
           
protected  boolean isControlKeyDown
           
protected  boolean isEmpty
           
protected  boolean isModelBuilderVisible
           
protected  boolean isShiftKeyDown
           
protected  java.awt.image.BufferedImage matImage
           
static double MAX_ZOOM
          The maximum zoom level
protected  java.awt.event.MouseEvent mEvent
           
static double MIN_ZOOM
          The minimum zoom level
protected  FunctionTool modelBuilder
           
protected  javax.swing.JPanel noData
           
protected  javax.swing.JLabel[] noDataLabels
           
static java.lang.String OFFSET
          Calibration tool types
protected  java.lang.String openedFromPath
           
protected  TPoint pointState
           
protected  javax.swing.JPopupMenu popup
           
protected  PrefsDialog prefsDialog
           
protected  java.awt.geom.AffineTransform prevPixelTransform
           
protected  java.awt.image.BufferedImage renderedImage
           
protected  javax.swing.JScrollPane scrollPane
           
protected  TPoint selectedPoint
           
protected  Step selectedStep
           
protected  TTrack selectedTrack
           
protected  XMLProperty selectedViewsProperty
           
protected  TrackerPanel selectingPanel
           
protected  TPoint snapPoint
           
protected  javax.swing.JLabel startFrameLabel
           
protected  org.opensourcephysics.cabrillo.tracker.TrackerPanel.ModelFrameSpinner startFrameSpinner
           
static java.lang.String STICK
          Calibration tool types
static java.lang.String TAPE
          Calibration tool types
protected  TrackControl trackControl
           
protected  int trackControlX
           
protected  int trackControlY
           
protected  XMLProperty viewsProperty
           
protected  java.util.Map<Filter,java.awt.Point> visibleFilters
           
protected  java.util.Set<TTrack> visibleTools
           
protected  double zoom
           
static double[] ZOOM_LEVELS
          The fixed zoom levels
static double ZOOM_STEP
          The zoom step size
protected  java.awt.Point zoomCenter
           
 
Fields inherited from class org.opensourcephysics.media.core.VideoPanel
changed, coords, dataFile, defaultFileName, defaultHeight, defaultWidth, drawingInImageSpace, filterClasses, imageBorder, imageHeight, imageWidth, messagePanel, mousePanel, player, playerVisible, pt, 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, blMessageBox, BOTTOM_LEFT, BOTTOM_RIGHT, bottomGutter, bottomGutterPreferred, brMessageBox, clipAtGutter, coordinateStrBuilder, customInspector, decimalFormat, dimensionSetter, drawableList, enableZoom, fixedPixelPerUnit, fixedScale, glassPanel, glassPanelLayout, height, leftGutter, leftGutterPreferred, mouseController, offscreenImage, optionController, pixelMatrix, pixelTransform, popupmenu, propertiesItem, rightGutter, rightGutterPreferred, scaleItem, scientificFormat, showCoordinates, snapshotItem, squareAspect, tlMessageBox, TOP_LEFT, TOP_RIGHT, topGutter, topGutterPreferred, trMessageBox, viewRect, width, workingImage, xceil, xfloor, xLeftMarginPercentage, xmax, xmaxPreferred, xmin, xminPreferred, xPixPerUnit, xRightMarginPercentage, yBottomMarginPercentage, yceil, yfloor, ymax, ymaxPreferred, ymin, yminPreferred, yPixPerUnit, yTopMarginPercentage, zoomBox, zoomInItem, zoomOutItem
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
 
Constructor Summary
TrackerPanel()
          Constructs a blank TrackerPanel with a player.
TrackerPanel(Video video)
          Constructs a TrackerPanel with a video and player.
 
Method Summary
protected  void addCalibrationTool(java.lang.String name, TTrack tool)
           
 void addDirtyRegion(java.awt.Rectangle dirtyRect)
          Adds the specified rectangle to the dirty region.
 void addDrawable(Drawable drawable)
          Overrides VideoPanel addDrawable method.
 void addTrack(TTrack track)
          Adds a track.
 void clear()
          Overrides VideoPanel clear method.
 void clearTracks()
          Clears all tracks.
protected  void configure()
          Configures this panel.
 boolean containsTrack(TTrack track)
          Determines if the specified track is in this tracker panel.
protected  void deletePoint(TPoint pt)
          Deletes a point.
 void eraseAll()
          Erases all tracks in this tracker panel.
protected  int getAlphabetIndex(java.lang.String name, java.lang.String connector)
          Gets the alphabet index for setting the name letter suffix and color of a track.
protected  AutoTracker getAutoTracker()
           
 CoordAxes getAxes()
          Gets the coordinate axes.
protected  FunctionTool getDataBuilder()
          Gets the DataFunction tool for defining custom data functions.
protected static double getDefaultImageHeight()
           
protected static double getDefaultImageWidth()
           
 java.lang.String getDescription()
          Gets the description of this panel.
 java.util.ArrayList<Drawable> getDrawables()
          Overrides VideoPanel getDrawables method.
 java.util.Set<java.lang.String> getEnabled()
          Gets the enabled property set.
 java.lang.String getFilePath()
          Overrides VideoPanel getFilePath method.
 Interactive getInteractive()
          Overrides InteractivePanel getInteractive method.
static XML.ObjectLoader getLoader()
          Returns an XML.ObjectLoader to save and load object data.
 double getMagnification()
          Gets the magnification.
 TMat getMat()
          Gets the mat.
 FunctionTool getModelBuilder()
          Gets the model builder.
protected  java.awt.event.MouseEvent getMouseEvent()
          Gets the most recent mouse event.
 javax.swing.JPopupMenu getPopupMenu()
          Gets the popup menu.
 java.awt.Dimension getPreferredScrollableViewportSize()
          Gets the preferred scrollable viewport size.
 int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
          Gets the scrollable block increment.
 boolean getScrollableTracksViewportHeight()
          Gets whether this tracks the viewport height.
 boolean getScrollableTracksViewportWidth()
          Gets whether this tracks the viewport width in a scrollpane.
 int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
          Gets the scrollable unit increment.
 TPoint getSelectedPoint()
          Gets the selected point.
 Step getSelectedStep()
          Gets the selected step.
 TTrack getSelectedTrack()
          Gets the selected track.
 TrackerPanel getSelectingPanel()
          Gets the selecting tracker panel.
 TPoint getSnapPoint()
          Gets the origin snap point.
 java.util.ArrayList<Drawable> getSystemDrawables()
          Gets the list of system Drawables.
protected  TFrame getTFrame()
           
 java.lang.String getTitle()
          Gets the title for tabs, menus, etc.
 TTrack getTrack(java.lang.String name)
          Gets the first track with the specified name
 java.util.ArrayList<TTrack> getTracks()
          Gets a list of TTracks being drawn on this panel.
 java.util.ArrayList<TTrack> getUserTracks()
          Gets the list of user-defined TTracks on this panel.
protected  void handleKeyPress(java.awt.event.KeyEvent e)
          Handles keypress events for selected points.
 boolean isDefaultConfiguration()
          Returns true if this is the default configuration.
 boolean isEnabled(java.lang.String key)
          Gets the enabled state for the specified key.
 boolean isShowCoordinates()
          Returns true if mouse coordinates are displayed.
 boolean isZoomEvent(java.awt.event.MouseEvent e)
          Returns true if an event starts or ends a zoom operation.
static void main(java.lang.String[] args)
          Main entry point when used as application.
 void moveToBack(Drawable drawable)
          Moves a drawable behind all others except the video.
 void paintComponent(java.awt.Graphics g)
          Paints this component.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Responds to property change events.
protected  void refreshModelBuilderSpinners()
          Refreshes the model builder spinners.
protected  void refreshNotesDialog()
          Refreshes the TFrame info dialog if visible.
protected  void refreshTrackData()
          Refreshes all data in tracks and views.
 void removeDrawable(Drawable drawable)
          Overrides VideoPanel removeDrawable method.
<T extends Drawable>
void
removeObjectsOfClass(java.lang.Class<T> c)
          Overrides VideoPanel removeObjectsOfClass method.
 void removeTrack(TTrack track)
          Removes a track.
protected  java.awt.image.BufferedImage renderMat()
           
 void repaintDirtyRegion()
          Repaints the dirty region.
protected  void restoreViews()
          Restores the views to a non-maximized state.
 boolean save()
          Gives the user an opportunity to save this to a trk file if changed.
 void scale()
          Overrides DrawingPanel scale method.
protected  void scale(java.util.ArrayList<Drawable> drawables)
          Overrides VideoPanel scale method to handle zoom
 void setCoords(ImageCoordSystem _coords)
          Overrides VideoPanel setCoords method.
protected  boolean setCursorForMarking(boolean invert, java.awt.event.InputEvent e)
          Sets the cursor to a crosshair when the selected track is marking and is unmarked on the current frame.
 void setDescription(java.lang.String desc)
          Sets the description of this panel.
 void setEnabled(java.util.Set<java.lang.String> enable)
          Sets the enabled property set.
 void setEnabled(java.lang.String key, boolean enable)
          Sets the enabled state for the specified key.
 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.
 void setMagnification(double magnification)
          Sets the magnification.
 void setMessage(java.lang.String msg)
          Shows a message in BR corner.
 void setMouseCursor(java.awt.Cursor cursor)
          Overrides DrawingPanel setMouseCursor method.
 void setScrollPane(javax.swing.JScrollPane scroller)
          Sets the scroll pane.
 void setSelectedPoint(TPoint point)
          Sets the selected point.
 void setSelectedTrack(TTrack track)
          Sets the selected track.
protected  void setTrackName(TTrack track, java.lang.String newName)
          Sets the name of a track.
 void setVideo(Video newVideo)
          Overrides VideoPanel setVideo method.
 
Methods inherited from class org.opensourcephysics.media.core.VideoPanel
addFilter, checkImage, getCoords, getDataFile, getFilters, getFrameNumber, getImageBorder, getImageHeight, getImageWidth, getPlayer, getStepNumber, getVideo, getWorldMousePoint, hideMouseBox, isDrawingInImageSpace, isPlayerVisible, paintEverything, removeFilter, setDataFile, setDrawingInImageSpace, setPlayerVisible, 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, addOptionController, buildPopupmenu, checkWorkingImage, computeGutters, enableInspector, findViewRect, getAspectRatio, getBottomGutter, getCoordinateStringBuilder, getDimensionSetter, getDrawables, getGlassPanel, getGutters, getHeight, getImageRatio, getLeftGutter, getMaxPixPerUnit, getMeasure, getObjectOfClass, getPixelMatrix, getPixelTransform, getPreferredXMax, getPreferredXMin, getPreferredYMax, getPreferredYMin, getRightGutter, getScale, 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, paint, paintDrawableList, paintFirst, paintLast, pixToX, pixToY, project, recomputeTransform, refreshGUI, removeDrawables, removeOptionController, render, render, replaceDrawable, resetGutters, scaleX, scaleY, setAdjustableGutter, setAntialiasShapeOn, setAntialiasTextOn, setAutoscaleMargin, setAutoscaleX, setAutoscaleY, setBounds, setBounds, setBuffered, setClipAtGutter, setCoordinateStringBuilder, setCustomInspector, setFixedScale, setFontLevel, setGutters, setGutters, setIgnoreRepaint, setMessage, setPixelScale, setPixelsPerUnit, setPopupMenu, setPreferredGutters, setPreferredMinMax, setPreferredMinMax, setPreferredMinMaxX, setPreferredMinMaxY, setSquareAspect, setVideoTool, setVisible, setXLeftMarginPercentage, setXMarginPercentage, setXMarginPercentage, setXRightMarginPercentage, setYBottomMarginPercentage, setYMarginPercentage, setYMarginPercentage, setYTopMarginPercentage, setZoom, showInspector, snapshot, 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, 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, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, 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, 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, transferFocusBackward, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_ZOOM

public static final double MIN_ZOOM
The minimum zoom level

See Also:
Constant Field Values

MAX_ZOOM

public static final double MAX_ZOOM
The maximum zoom level

See Also:
Constant Field Values

ZOOM_STEP

public static final double ZOOM_STEP
The zoom step size


ZOOM_LEVELS

public static final double[] ZOOM_LEVELS
The fixed zoom levels


STICK

public static final java.lang.String STICK
Calibration tool types

See Also:
Constant Field Values

TAPE

public static final java.lang.String TAPE
Calibration tool types

See Also:
Constant Field Values

CALIBRATION

public static final java.lang.String CALIBRATION
Calibration tool types

See Also:
Constant Field Values

OFFSET

public static final java.lang.String OFFSET
Calibration tool types

See Also:
Constant Field Values

alphabet

protected static java.lang.String alphabet

defaultImageBorder

protected double defaultImageBorder

description

protected java.lang.String description

selectedPoint

protected TPoint selectedPoint

selectedStep

protected Step selectedStep

selectingPanel

protected TrackerPanel selectingPanel

selectedTrack

protected TTrack selectedTrack

dirty

protected java.awt.Rectangle dirty

prevPixelTransform

protected java.awt.geom.AffineTransform prevPixelTransform

zoom

protected double zoom

scrollPane

protected javax.swing.JScrollPane scrollPane

popup

protected javax.swing.JPopupMenu popup

enabled

protected java.util.Set<java.lang.String> enabled

snapPoint

protected TPoint snapPoint

frame

protected TFrame frame

renderedImage

protected java.awt.image.BufferedImage renderedImage

matImage

protected java.awt.image.BufferedImage matImage

currentState

protected XMLControl currentState

currentCoords

protected XMLControl currentCoords

pointState

protected TPoint pointState

mEvent

protected java.awt.event.MouseEvent mEvent

badNameLabel

protected javax.swing.JLabel badNameLabel

dataBuilder

protected FunctionTool dataBuilder

dataToolVisible

protected boolean dataToolVisible

viewsProperty

protected XMLProperty viewsProperty

selectedViewsProperty

protected XMLProperty selectedViewsProperty

dividerLocs

protected double[] dividerLocs

zoomCenter

protected java.awt.Point zoomCenter

visibleFilters

protected java.util.Map<Filter,java.awt.Point> visibleFilters

trackControlX

protected int trackControlX

trackControlY

protected int trackControlY

infoX

protected int infoX

infoY

protected int infoY

noData

protected javax.swing.JPanel noData

noDataLabels

protected javax.swing.JLabel[] noDataLabels

isEmpty

protected boolean isEmpty

defaultSavePath

protected java.lang.String defaultSavePath

openedFromPath

protected java.lang.String openedFromPath

modelBuilder

protected FunctionTool modelBuilder

startFrameLabel

protected javax.swing.JLabel startFrameLabel

endFrameLabel

protected javax.swing.JLabel endFrameLabel

startFrameSpinner

protected org.opensourcephysics.cabrillo.tracker.TrackerPanel.ModelFrameSpinner startFrameSpinner

endFrameSpinner

protected org.opensourcephysics.cabrillo.tracker.TrackerPanel.ModelFrameSpinner endFrameSpinner

trackControl

protected TrackControl trackControl

prefsDialog

protected PrefsDialog prefsDialog

isModelBuilderVisible

protected boolean isModelBuilderVisible

isShiftKeyDown

protected boolean isShiftKeyDown

isControlKeyDown

protected boolean isControlKeyDown

calibrationTools

protected java.util.ArrayList<TTrack> calibrationTools

visibleTools

protected java.util.Set<TTrack> visibleTools

author

protected java.lang.String author

contact

protected java.lang.String contact

autoTracker

protected AutoTracker autoTracker
Constructor Detail

TrackerPanel

public TrackerPanel()
Constructs a blank TrackerPanel with a player.


TrackerPanel

public TrackerPanel(Video video)
Constructs a TrackerPanel with a video and player.

Parameters:
video - the video
Method Detail

setVideo

public void setVideo(Video newVideo)
Overrides VideoPanel setVideo method.

Overrides:
setVideo in class VideoPanel
Parameters:
newVideo - the video

getTitle

public java.lang.String getTitle()
Gets the title for tabs, menus, etc.

Returns:
the title

getDescription

public java.lang.String getDescription()
Gets the description of this panel.

Returns:
the description

setDescription

public void setDescription(java.lang.String desc)
Sets the description of this panel.

Parameters:
desc - a description

getModelBuilder

public FunctionTool getModelBuilder()
Gets the model builder.

Returns:
the model builder

refreshModelBuilderSpinners

protected void refreshModelBuilderSpinners()
Refreshes the model builder spinners.


addDirtyRegion

public void addDirtyRegion(java.awt.Rectangle dirtyRect)
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

public java.util.ArrayList<TTrack> getTracks()
Gets a list of TTracks being drawn on this panel.

Returns:
a list of tracks

getUserTracks

public java.util.ArrayList<TTrack> getUserTracks()
Gets the list of user-defined TTracks on this panel.

Returns:
a list of tracks other than the axes and tape

getTrack

public TTrack getTrack(java.lang.String name)
Gets the first track with the specified name

Parameters:
name - the name of the track
Returns:
the track

addTrack

public void addTrack(TTrack track)
Adds a track.

Parameters:
track - the track to add

removeTrack

public void removeTrack(TTrack track)
Removes a track.

Parameters:
track - the track to remove

containsTrack

public boolean containsTrack(TTrack track)
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.


save

public boolean save()
Gives the user an opportunity to save this to a trk file if changed.

Returns:
false if the user cancels, otherwise true

getDrawables

public java.util.ArrayList<Drawable> getDrawables()
Overrides VideoPanel getDrawables method.

Overrides:
getDrawables in class VideoPanel
Returns:
a list of Drawable objects

getSystemDrawables

public java.util.ArrayList<Drawable> getSystemDrawables()
Gets the list of system Drawables.

Returns:
a list of Drawable objects

addDrawable

public void addDrawable(Drawable drawable)
Overrides VideoPanel addDrawable method.

Overrides:
addDrawable in class VideoPanel
Parameters:
drawable - the drawable object

moveToBack

public void moveToBack(Drawable drawable)
Moves a drawable behind all others except the video.

Parameters:
drawable - the drawable object

removeDrawable

public void removeDrawable(Drawable drawable)
Overrides VideoPanel removeDrawable method.

Overrides:
removeDrawable in class VideoPanel
Parameters:
drawable - the drawable object

removeObjectsOfClass

public <T extends Drawable> void removeObjectsOfClass(java.lang.Class<T> c)
Overrides VideoPanel removeObjectsOfClass method.

Overrides:
removeObjectsOfClass in class VideoPanel
Parameters:
c - the class to remove
See Also:
DrawingPanel.removeDrawables(Class c)

clear

public void clear()
Overrides VideoPanel clear method.

Overrides:
clear in class VideoPanel

clearTracks

public void clearTracks()
Clears all tracks.


setCoords

public void setCoords(ImageCoordSystem _coords)
Overrides VideoPanel setCoords method.

Overrides:
setCoords in class VideoPanel
Parameters:
_coords - the new image coordinate system

getAxes

public CoordAxes getAxes()
Gets the coordinate axes.

Returns:
the CoordAxes

getMat

public TMat getMat()
Gets the mat.

Returns:
the first TMat in the drawable list

getSnapPoint

public TPoint getSnapPoint()
Gets the origin snap point.

Returns:
the snap point

setSelectedTrack

public void setSelectedTrack(TTrack track)
Sets the selected track.

Parameters:
track - the track to select

getSelectedTrack

public TTrack getSelectedTrack()
Gets the selected track.

Returns:
the selected track

setSelectedPoint

public void setSelectedPoint(TPoint point)
Sets the selected point. Also sets the selected step, track, and selecting panel.

Parameters:
point - the point to receive actions

getSelectedPoint

public TPoint getSelectedPoint()
Gets the selected point.

Returns:
the selected point

getSelectedStep

public Step getSelectedStep()
Gets the selected step.

Returns:
the selected step

getSelectingPanel

public TrackerPanel getSelectingPanel()
Gets the selecting tracker panel.

Returns:
the selecting tracker panel

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 class VideoPanel
Parameters:
w - the width

setImageHeight

public void setImageHeight(double h)
Sets the image height in image units. Overrides VideoPanel method.

Overrides:
setImageHeight in class VideoPanel
Parameters:
h - the height

setImageSize

public void setImageSize(double w,
                         double h)
Sets the image size in image units.

Parameters:
w - the width
h - the height

setScrollPane

public void setScrollPane(javax.swing.JScrollPane scroller)
Sets the scroll pane.

Parameters:
scroller - the scroll pane containing this panel

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Gets the preferred scrollable viewport size.

Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable
Returns:
the preferred scrollable viewport size

getScrollableUnitIncrement

public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Gets the scrollable unit increment.

Specified by:
getScrollableUnitIncrement in interface javax.swing.Scrollable
Parameters:
visibleRect - the rectangle currently visible in the scrollpane
orientation - the orientation of the scrollbar
direction - the direction of movement of the scrollbar
Returns:
the scrollable unit increment

getScrollableBlockIncrement

public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Gets the scrollable block increment.

Specified by:
getScrollableBlockIncrement in interface javax.swing.Scrollable
Parameters:
visibleRect - the rectangle currently visible in the scrollpane
orientation - the orientation of the scrollbar
direction - 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 interface javax.swing.Scrollable
Returns:
true if this tracks the width

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Gets whether this tracks the viewport height.

Specified by:
getScrollableTracksViewportHeight in interface javax.swing.Scrollable
Returns:
true if this tracks the height

isShowCoordinates

public boolean isShowCoordinates()
Returns true if mouse coordinates are displayed. Overrides VideoPanel method to report false if a point is selected.

Overrides:
isShowCoordinates in class VideoPanel
Returns:
true if mouse coordinates are displayed

setMessage

public void setMessage(java.lang.String msg)
Shows a message in BR corner. Overrides DrawingPanel method.

Overrides:
setMessage in class DrawingPanel
Parameters:
msg - the message

refreshTrackData

protected void refreshTrackData()
Refreshes all data in tracks and views.


getMouseEvent

protected java.awt.event.MouseEvent getMouseEvent()
Gets the most recent mouse event.

Returns:
the MouseEvent

getPopupMenu

public javax.swing.JPopupMenu getPopupMenu()
Gets the popup menu. Overrides DrawingPanel method.

Overrides:
getPopupMenu in class DrawingPanel

getDataBuilder

protected FunctionTool getDataBuilder()
Gets the DataFunction tool for defining custom data functions.


refreshNotesDialog

protected void refreshNotesDialog()
Refreshes the TFrame info dialog if visible.


getAlphabetIndex

protected int getAlphabetIndex(java.lang.String name,
                               java.lang.String connector)
Gets the alphabet index for setting the name letter suffix and color of a track.

Parameters:
name - the default name with no letter suffix
connector - the string connecting the name and letter
Returns:
the index of the first available letter suffix

restoreViews

protected void restoreViews()
Restores the views to a non-maximized state.


configure

protected void configure()
Configures this panel.


setCursorForMarking

protected boolean setCursorForMarking(boolean invert,
                                      java.awt.event.InputEvent e)
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 state
Returns:
true if marking (ie next mouse click will mark a TPoint)

handleKeyPress

protected void handleKeyPress(java.awt.event.KeyEvent e)
Handles keypress events for selected points.

Parameters:
e - the key event

isDefaultConfiguration

public boolean isDefaultConfiguration()
Returns true if this is the default configuration.

Returns:
true if this is the default configuration

getEnabled

public java.util.Set<java.lang.String> getEnabled()
Gets the enabled property set.

Returns:
the set of enabled properties

setEnabled

public void setEnabled(java.util.Set<java.lang.String> enable)
Sets the enabled property set.

Parameters:
enable - the set of enabled properties

isEnabled

public boolean isEnabled(java.lang.String key)
Gets the enabled state for the specified key.

Parameters:
key - the string key
Returns:
true if enabled

setEnabled

public void setEnabled(java.lang.String key,
                       boolean enable)
Sets the enabled state for the specified key.

Parameters:
key - the string key
enable - true to enable the key

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class VideoPanel
Parameters:
e - the property change event

setImageBorder

public void setImageBorder(double borderFraction)
Overrides VideoPanel setImageBorder method to set the image border.

Overrides:
setImageBorder in class VideoPanel
Parameters:
borderFraction - the border fraction

getFilePath

public java.lang.String getFilePath()
Overrides VideoPanel getFilePath method.

Overrides:
getFilePath in class VideoPanel
Returns:
the relative path to the file

scale

public void scale()
Overrides DrawingPanel scale method.

Overrides:
scale in class DrawingPanel

setMouseCursor

public void setMouseCursor(java.awt.Cursor cursor)
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 class DrawingPanel
Parameters:
cursor - the requested cursor

isZoomEvent

public boolean isZoomEvent(java.awt.event.MouseEvent e)
Returns true if an event starts or ends a zoom operation. Used by OptionController. Overrides DrawingPanel method.

Overrides:
isZoomEvent in class DrawingPanel
Parameters:
e - a mouse event
Returns:
true if a zoom event

getInteractive

public Interactive getInteractive()
Overrides InteractivePanel getInteractive method. This checks the selected track (if any) first.

Overrides:
getInteractive in class InteractivePanel
Returns:
the interactive drawable identified by the most recent mouse event

main

public static void main(java.lang.String[] args)
Main entry point when used as application.

Parameters:
args - arg[0] may be an xml file

addCalibrationTool

protected void addCalibrationTool(java.lang.String name,
                                  TTrack tool)

renderMat

protected java.awt.image.BufferedImage renderMat()

deletePoint

protected void deletePoint(TPoint pt)
Deletes a point.

Parameters:
pt - the point to delete

scale

protected void scale(java.util.ArrayList<Drawable> drawables)
Overrides VideoPanel scale method to handle zoom

Overrides:
scale in class VideoPanel
Parameters:
drawables - the list of drawable objects

paintComponent

public void paintComponent(java.awt.Graphics g)
Paints this component. Overrides DrawingPanel method to log times

Overrides:
paintComponent in class DrawingPanel
Parameters:
g - the graphics context

getDefaultImageWidth

protected static double getDefaultImageWidth()

getDefaultImageHeight

protected static double getDefaultImageHeight()

getTFrame

protected TFrame getTFrame()

getAutoTracker

protected AutoTracker getAutoTracker()

setTrackName

protected void setTrackName(TTrack track,
                            java.lang.String newName)
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 name
newName - the proposed name

getLoader

public static XML.ObjectLoader getLoader()
Returns an XML.ObjectLoader to save and load object data.

Returns:
the XML.ObjectLoader