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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JLabel badNameLabel
           
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  TFrame frame
           
protected  java.awt.image.BufferedImage image
           
protected  int infoX
           
protected  int infoY
           
protected  boolean isEmpty
           
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
           
protected  TPoint pointState
           
protected  javax.swing.JPopupMenu popup
           
protected  java.awt.geom.AffineTransform prevPixelTransform
           
protected  javax.swing.JScrollPane scrollPane
           
protected  TPoint selectedPoint
           
protected  Step selectedStep
           
protected  TTrack selectedTrack
           
protected  XMLProperty selectedViewsProperty
           
protected  TrackerPanel selectingPanel
           
protected  TPoint snapPoint
           
protected  int trackControlX
           
protected  int trackControlY
           
protected  XMLProperty viewsProperty
           
protected  java.util.Map<Filter,java.awt.Point> visibleFilters
           
protected  double zoom
           
 
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
 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.
 Axes getAxes()
          Gets the coordinate axes.
 java.util.ArrayList<Drawable> getBackgroundDrawables()
          Gets the list of background Drawables.
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.
protected  TFrame getFrame()
           
 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.
 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.
 Tape getTape()
          Gets the tape.
 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.
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 propertyChange(java.beans.PropertyChangeEvent e)
          Responds to property change events.
protected  void refreshInfoDialog()
          Refreshes the TFrame info dialog if visible.
 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.
 void repaintDirtyRegion()
          Repaints the dirty region.
 boolean save()
          Gives the user an opportunity to save this to a text 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)
          Sets the cursor (if not inverted) to a crosshair when the selected track marks by default and is unmarked on the current frame.
 void setDescription(java.lang.String desc)
          Sets the description of this panel.
 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 sets 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)
           
 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
 
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, buildPopupmenu, checkWorkingImage, computeGutters, enableInspector, findViewRect, getAspectRatio, getBottomGutter, getCoordinateStringBuilder, getDimensionSetter, getDrawables, getGlassPanel, getGutters, getHeight, getImageRatio, getLeftGutter, getMaxPixPerUnit, getMeasure, getObjectOfClass, getPixelMatrix, getPixelTransform, getPopupMenu, 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, paintComponent, 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, 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, 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, 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

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

image

protected java.awt.image.BufferedImage image

currentState

protected XMLControl currentState

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

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

modelBuilder

protected FunctionTool modelBuilder
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

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 text 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

getBackgroundDrawables

public java.util.ArrayList<Drawable> getBackgroundDrawables()
Gets the list of background Drawables. Background drawables are normally not deleted but only replaced, though this is not enforced.

Returns:
a list of drawables

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 Axes getAxes()
Gets the coordinate axes.

Returns:
the first Axes in the drawable list

getMat

public TMat getMat()
Gets the mat.

Returns:
the first TMat in the drawable list

getTape

public Tape getTape()
Gets the tape.

Returns:
the first Tape 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

getDataBuilder

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


refreshInfoDialog

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


configure

protected void configure()
Configures this panel.


setCursorForMarking

protected boolean setCursorForMarking(boolean invert)
Sets the cursor (if not inverted) to a crosshair when the selected track marks by default 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

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 sets 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

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 selected by the most recent mouse click

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

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

getDefaultImageWidth

protected static double getDefaultImageWidth()

getDefaultImageHeight

protected static double getDefaultImageHeight()

getFrame

protected TFrame getFrame()

setTrackName

protected void setTrackName(TTrack track,
                            java.lang.String newName)

getLoader

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

Returns:
the XML.ObjectLoader