org.opensourcephysics.cabrillo.tracker
Class CoordAxesStep

java.lang.Object
  extended by org.opensourcephysics.cabrillo.tracker.Step
      extended by org.opensourcephysics.cabrillo.tracker.CoordAxesStep
All Implemented Interfaces:
java.lang.Cloneable

public class CoordAxesStep
extends Step

This is a Step for a CoordAxes. It is used for displaying the axes and for setting the origin, angle and/or scale of an ImageCoordSystem.

Author:
Douglas Brown

Field Summary
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.Step
dataVisible, defaultIndex, footprint, format, frc, hitRect, marks, n, points, screenPoints, selectionShape, track, transform, valid
 
Constructor Summary
CoordAxesStep(CoordAxes track, int n)
          Constructs an AxesStep.
 
Method Summary
 java.lang.Object clone()
          Clones this Step.
 void draw(DrawingPanel panel, java.awt.Graphics _g)
          Overrides Step draw method.
 Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
          Overrides Step findInteractive method.
 java.awt.Rectangle getBounds(TrackerPanel trackerPanel)
          Overrides Step getBounds method.
 TPoint getHandle()
          Gets the handle.
static int getLength()
          Gets the step length.
protected  Mark getMark(TrackerPanel trackerPanel)
          Overrides Step getMark method.
 TPoint getOrigin()
          Gets the origin.
 int getPointIndex(TPoint p)
          Overrides Step getPointIndex method.
 boolean isHandleEnabled()
          Gets whether the handle is enabled.
 boolean isOriginEnabled()
          Gets whether the origin is enabled.
 void setHandleEnabled(boolean enabled)
          Enables and disables the interactivity of the handle.
 void setOriginEnabled(boolean enabled)
          /** Enables and disables the interactivity of the origin.
 java.lang.String toString()
          Returns a String describing this.
 
Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step
erase, erase, getDefaultPoint, getFrameNumber, getPoints, getTrack, remark, remark, repaint, repaint, setDefaultPointIndex, setFootprint, setHitRectCenter
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoordAxesStep

public CoordAxesStep(CoordAxes track,
                     int n)
Constructs an AxesStep.

Parameters:
track - the track
n - the frame number
Method Detail

getOrigin

public TPoint getOrigin()
Gets the origin.

Returns:
the origin

getHandle

public TPoint getHandle()
Gets the handle.

Returns:
the origin

setOriginEnabled

public void setOriginEnabled(boolean enabled)
/** Enables and disables the interactivity of the origin.

Parameters:
enabled - true to enable the origin

isOriginEnabled

public boolean isOriginEnabled()
Gets whether the origin is enabled.

Returns:
true if the origin is enabled

setHandleEnabled

public void setHandleEnabled(boolean enabled)
Enables and disables the interactivity of the handle.

Parameters:
enabled - true to enable the handle

isHandleEnabled

public boolean isHandleEnabled()
Gets whether the handle is enabled.

Returns:
true if the handle is enabled

findInteractive

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

Overrides:
findInteractive in class Step
Parameters:
panel - the drawing panel
xpix - the x pixel position
ypix - the y pixel position
Returns:
the TPoint that is hit, or null

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics _g)
Overrides Step draw method.

Overrides:
draw in class Step
Parameters:
panel - the drawing panel requesting the drawing
_g - the graphics context on which to draw

getMark

protected Mark getMark(TrackerPanel trackerPanel)
Overrides Step getMark method.

Overrides:
getMark in class Step
Parameters:
trackerPanel - the tracker panel
Returns:
the mark

getPointIndex

public int getPointIndex(TPoint p)
Overrides Step getPointIndex method.

Overrides:
getPointIndex in class Step
Parameters:
p - the point
Returns:
the index, or -1 if not found

getBounds

public java.awt.Rectangle getBounds(TrackerPanel trackerPanel)
Overrides Step getBounds method.

Overrides:
getBounds in class Step
Parameters:
trackerPanel - the tracker panel drawing the step
Returns:
the bounding rectangle

clone

public java.lang.Object clone()
Clones this Step.

Overrides:
clone in class Step
Returns:
a clone of this step

toString

public java.lang.String toString()
Returns a String describing this.

Overrides:
toString in class Step
Returns:
a descriptive string

getLength

public static int getLength()
Gets the step length.

Returns:
the length of the points array