org.opensourcephysics.cabrillo.tracker
Class CoordAxes

java.lang.Object
  extended by org.opensourcephysics.cabrillo.tracker.TTrack
      extended by org.opensourcephysics.cabrillo.tracker.CoordAxes
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, Drawable, Interactive, Measurable, Trackable

public class CoordAxes
extends TTrack

A CoordAxes displays and controls the image coordinate system of a specified tracker panel.

Author:
Douglas Brown

Nested Class Summary
protected  class CoordAxes.AnglePoint
          A TPoint used by autotracker to check for manually marked angles.
protected  class CoordAxes.OriginPoint
          A TPoint used by autotracker to check for manually marked origins.
 
Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
TTrack.StepArray
 
Field Summary
protected  boolean notyetShown
           
protected  javax.swing.JLabel originLabel
           
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
alphabet, angleField, angleLabel, angleSeparator, attachments, autoAdvance, autoAdvanceItem, autoTrackerMarking, circleFootprintListener, clearStepsItem, closeButton, colorItem, constantsLoadedFromXML, data, dataBuilderItem, dataDescriptions, dataFrames, dataProp, dataValid, defaultColors, defaultFootprint, deleteStepItem, deleteTrackItem, description, descriptionItem, enabled, fieldBorder, footprint, footprintListener, footprintMenu, footprints, frc, hint, isMarking, keyFrames, labelFont, locked, lockedItem, magField, magLabel, magSeparator, markByDefault, markByDefaultItem, menu, name, nameAction, nameDialog, nameField, nameItem, panels, partName, point, preferredColumnOrder, properties, refreshDataLater, skippedStepWarningCheckbox, skippedStepWarningDialog, skippedStepWarningOn, skippedStepWarningTextpane, stepLabel, steps, stepSeparator, stepSizeWhenFirstMarked, stepValueLabel, support, targetIndex, tField, tLabel, toolbarPointComponents, toolbarTrackComponents, trackerPanel, trailLength, trailVisible, trailVisibleItem, tSeparator, tValueLabel, viewable, visible, visibleItem, worldBounds, xField, xLabel, xSeparator, xSpinner, yField, yLabel, ySeparator, ySpinner
 
Constructor Summary
CoordAxes()
          Constructs a CoordAxes for the specified tracker panel.
 
Method Summary
 TPoint autoMarkAt(int n, double x, double y)
          Used by autoTracker to mark a step at a match target position.
 Step createStep(int n, double x, double y)
          Mimics step creation by setting the origin position.
 Step deleteStep(int n)
          Overrides TTrack deleteStep method to prevent deletion.
 Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
          Implements findInteractive method.
 int getFootprintLength()
          Gets the length of the footprints required by this track.
static XML.ObjectLoader getLoader()
          Returns an ObjectLoader to save and load data for this class.
 TPoint getMarkedPoint(int n, int index)
          Used by autoTracker to get the marked point for a given frame and index.
 javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
          Overrides TTrack getMenu method.
 TPoint getOrigin()
          Gets the origin.
 Step getStep(int n)
          Overrides TTrack getStep method.
 int getStepLength()
          Gets the length of the steps created by this track.
protected  java.lang.String getTargetDescription(int pointIndex)
          Returns a description of the point at a given index.
 java.util.ArrayList<java.awt.Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
          Overrides TTrack getToolbarTrackComponents method.
protected  boolean isAutoTrackable()
          Determines if at least one point in this track is autotrackable.
protected  boolean isAutoTrackable(int pointIndex)
          Determines if the given point index is autotrackable.
 boolean isLocked()
          Overrides TTrack isLocked method.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Responds to property change events.
 void setTrailVisible(boolean visible)
          Overrides TTrack setTrailVisible method to keep trails hidden.
 void setVisible(boolean visible)
          Overrides TTrack setVisible method to change neverVisible flag.
 java.lang.String toString()
          Overrides Object toString method.
 
Methods inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
addFootprint, addPropertyChangeListener, addPropertyChangeListener, cleanup, createWarningDialog, delete, draw, erase, erase, firePropertyChange, getColor, getData, getDataDescription, getDataName, getDescription, getFootprint, getFootprint, getFootprints, getFootprints, getFrameForData, getMarkingCursor, getMessage, getName, getNextVisibleStep, getPreferredDataOrder, getPreviousVisibleStep, getProperty, getPropertyNames, getSkippedStepWarningDialog, getStep, getSteps, getStepSizeWarningDialog, getTargetIndex, getToolbarPointComponents, getTrailLength, getWorldBounds, getX, getXMax, getXMax, getXMin, getXMin, getY, getYMax, getYMax, getYMin, getYMin, isAutoAdvance, isDependent, isEmpty, isEnabled, isMarkByDefault, isMeasured, isStepComplete, isStepVisible, isTrailVisible, isViewable, isVisible, refreshData, refreshData, remark, remark, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, setAnglesInRadians, setAutoAdvance, setColor, setColorToDefault, setDefaultNameAndColor, setDescription, setEnabled, setFootprint, setFootprint, setFootprints, setFootprints, setLocked, setMarkByDefault, setMarking, setName, setProperty, setTargetIndex, setTargetIndex, setTargetIndex, setTrackerPanel, setTrailLength, setViewable, setX, setXY, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

notyetShown

protected boolean notyetShown

originLabel

protected javax.swing.JLabel originLabel
Constructor Detail

CoordAxes

public CoordAxes()
Constructs a CoordAxes for the specified tracker panel.

Method Detail

getOrigin

public TPoint getOrigin()
Gets the origin.

Returns:
the current origin

isLocked

public boolean isLocked()
Overrides TTrack isLocked method.

Overrides:
isLocked in class TTrack
Returns:
true if this is locked

setVisible

public void setVisible(boolean visible)
Overrides TTrack setVisible method to change neverVisible flag.

Overrides:
setVisible in class TTrack
Parameters:
visible - true to show this track

setTrailVisible

public void setTrailVisible(boolean visible)
Overrides TTrack setTrailVisible method to keep trails hidden.

Overrides:
setTrailVisible in class TTrack
Parameters:
visible - ignored

createStep

public Step createStep(int n,
                       double x,
                       double y)
Mimics step creation by setting the origin position.

Specified by:
createStep in class TTrack
Parameters:
n - the frame number
x - the x coordinate in image space
y - the y coordinate in image space
Returns:
the step

deleteStep

public Step deleteStep(int n)
Overrides TTrack deleteStep method to prevent deletion.

Overrides:
deleteStep in class TTrack
Parameters:
n - the frame number
Returns:
the deleted step

getStep

public Step getStep(int n)
Overrides TTrack getStep method. Always return step 0.

Overrides:
getStep in class TTrack
Parameters:
n - the frame number (ignored)
Returns:
step 0

getStepLength

public int getStepLength()
Gets the length of the steps created by this track.

Specified by:
getStepLength in class TTrack
Returns:
the footprint length

isAutoTrackable

protected boolean isAutoTrackable()
Determines if at least one point in this track is autotrackable.

Overrides:
isAutoTrackable in class TTrack
Returns:
true if autotrackable

isAutoTrackable

protected boolean isAutoTrackable(int pointIndex)
Determines if the given point index is autotrackable.

Overrides:
isAutoTrackable in class TTrack
Parameters:
pointIndex - the points[] index
Returns:
true if autotrackable

getTargetDescription

protected java.lang.String getTargetDescription(int pointIndex)
Returns a description of the point at a given index. Used by AutoTracker.

Overrides:
getTargetDescription in class TTrack
Parameters:
pointIndex - the points[] index
Returns:
the description

autoMarkAt

public TPoint autoMarkAt(int n,
                         double x,
                         double y)
Used by autoTracker to mark a step at a match target position.

Overrides:
autoMarkAt in class TTrack
Parameters:
n - the frame number
x - the x target coordinate in image space
y - the y target coordinate in image space
Returns:
the TPoint that was automarked

getMarkedPoint

public TPoint getMarkedPoint(int n,
                             int index)
Used by autoTracker to get the marked point for a given frame and index. Overrides TTrack method.

Overrides:
getMarkedPoint in class TTrack
Parameters:
n - the frame number
index - the index
Returns:
a TPoint

getFootprintLength

public int getFootprintLength()
Gets the length of the footprints required by this track.

Specified by:
getFootprintLength in class TTrack
Returns:
the footprint length

findInteractive

public Interactive findInteractive(DrawingPanel panel,
                                   int xpix,
                                   int ypix)
Implements findInteractive method.

Specified by:
findInteractive in interface Interactive
Overrides:
findInteractive in class TTrack
Parameters:
panel - the drawing panel
xpix - the x pixel position on the panel
ypix - the y pixel position on the panel
Returns:
the first step that is hit

getMenu

public javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
Overrides TTrack getMenu method.

Overrides:
getMenu in class TTrack
Parameters:
trackerPanel - the tracker panel
Returns:
a menu

getToolbarTrackComponents

public java.util.ArrayList<java.awt.Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
Overrides TTrack getToolbarTrackComponents method.

Overrides:
getToolbarTrackComponents in class TTrack
Parameters:
trackerPanel - the tracker panel
Returns:
a list of components

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. This listens for the following events: "stepnumber" & "image" from TrackerPanel.

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

toString

public java.lang.String toString()
Overrides Object toString method.

Overrides:
toString in class TTrack
Returns:
the name of this track

getLoader

public static XML.ObjectLoader getLoader()
Returns an ObjectLoader to save and load data for this class.

Returns:
the object loader