org.opensourcephysics.cabrillo.tracker
Class PositionStep

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

public class PositionStep
extends Step

This is a Step that represents a position. It is used by PointMass tracks.

Author:
Douglas Brown

Nested Class Summary
protected  class PositionStep.Position
           
 
Field Summary
protected  boolean labelVisible
           
protected  java.util.Map<TrackerPanel,java.awt.Rectangle> layoutBounds
           
protected  PositionStep.Position p
           
protected  boolean rolloverVisible
           
protected  java.util.Map<TrackerPanel,java.awt.font.TextLayout> textLayouts
           
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.Step
dataVisible, defaultIndex, footprint, format, frc, hitRect, marks, n, points, screenPoints, selectionShape, textLayoutFont, track, transform, valid
 
Constructor Summary
PositionStep(PointMass track, int n, double x, double y)
          Constructs a PositionStep with specified image coordinates.
 
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.
protected  java.awt.Point getLayoutPosition(TrackerPanel trackerPanel)
          Gets TextLayout screen position.
static XML.ObjectLoader getLoader()
          Returns an ObjectLoader to save and load data for this class.
protected  Mark getMark(TrackerPanel trackerPanel)
          Overrides Step getMark method.
 PositionStep.Position getPosition()
          Gets the position TPoint.
 boolean isLabelVisible()
          Gets the label visibility.
 boolean isRolloverVisible()
          Gets the rollover visibility.
 void setLabelVisible(boolean visible)
          Sets the label visibility.
 void setRolloverVisible(boolean visible)
          Sets the rollover visibility.
 java.lang.String toString()
          Returns a String describing this.
 
Methods inherited from class org.opensourcephysics.cabrillo.tracker.Step
erase, erase, getDefaultPoint, getFrameNumber, getLength, getPointIndex, 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
 

Field Detail

p

protected PositionStep.Position p

labelVisible

protected boolean labelVisible

rolloverVisible

protected boolean rolloverVisible

textLayouts

protected java.util.Map<TrackerPanel,java.awt.font.TextLayout> textLayouts

layoutBounds

protected java.util.Map<TrackerPanel,java.awt.Rectangle> layoutBounds
Constructor Detail

PositionStep

public PositionStep(PointMass track,
                    int n,
                    double x,
                    double y)
Constructs a PositionStep with specified image coordinates.

Parameters:
track - the PointMass track
n - the frame number
x - the x coordinate
y - the y coordinate
Method Detail

getPosition

public PositionStep.Position getPosition()
Gets the position TPoint.

Returns:
the position TPoint

isLabelVisible

public boolean isLabelVisible()
Gets the label visibility.

Returns:
true if label is visible

setLabelVisible

public void setLabelVisible(boolean visible)
Sets the label visibility.

Parameters:
visible - true to make label visible

isRolloverVisible

public boolean isRolloverVisible()
Gets the rollover visibility.

Returns:
true if labels are visible on rollover only

setRolloverVisible

public void setRolloverVisible(boolean visible)
Sets the rollover visibility.

Parameters:
visible - true to make labels visible on rollover only

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

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

getMark

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

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

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 cloned step

toString

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

Overrides:
toString in class Step
Returns:
a descriptive string

getLayoutPosition

protected java.awt.Point getLayoutPosition(TrackerPanel trackerPanel)
Gets TextLayout screen position.

Parameters:
trackerPanel - the tracker panel
Returns:
the screen position point

getLoader

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

Returns:
the object loader