Class Step
java.lang.Object
org.opensourcephysics.cabrillo.tracker.Step
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
CalibrationStep
,CircleFitterStep
,CoordAxesStep
,LineProfileStep
,OffsetOriginStep
,PerspectiveStep
,PositionStep
,ProtractorStep
,RGBStep
,TapeStep
,VectorStep
A Step is associated with a single frame of a TTrack. It contains an array of
TPoints that define its image data and a Footprint that determines its screen
appearance. This is an abstract class and cannot be instantiated directly.
- Author:
- Douglas Brown
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected int
protected Footprint
protected static final NumberFormat
protected static final Rectangle
protected int
protected TPoint[]
protected Point[]
protected static Shape
protected static Stroke
protected int
protected static final AffineTransform
int
static final int
static final int
static final int
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones this Step.protected void
dispose()
Disposes of this step.void
draw
(DrawingPanel panel, Graphics g) Draws this step.void
erase()
Erases this on all tracker panels.void
Erases this on the specified tracker panel.findInteractive
(DrawingPanel panel, int xpix, int ypix) Finds the Interactive located at the specified pixel position.Gets the default point.int
Gets the frame number.static int
Gets the step length.protected Mark
getMark
(TrackerPanel trackerPanel) Gets the mark for the specified panel.int
Gets the index of a point in the points[] array.TPoint[]
Gets the array of TPoints contained in this step.getTrack()
Gets the track.void
remark()
Remarks this on all tracker panels.void
Erases and remarks this on the specified tracker panel.void
repaint()
Repaints this on all tracker panels.void
Repaints this on the specified tracker panel.void
setDefaultPointIndex
(int index) Sets the default point index.void
setFootprint
(Footprint footprint) Sets the footprint.protected void
setHitRectCenter
(int xpix, int ypix) Centers the hit testing rectangle on the specified screen point.toString()
Returns a String describing this step.
-
Field Details
-
hitRect
-
selectionShape
-
selectionStroke
-
transform
-
format
-
trackID
protected int trackID -
n
protected int n -
footprint
-
points
-
screenPoints
-
valid
protected boolean valid -
panelMarks
-
defaultIndex
protected int defaultIndex -
dataVisible
protected boolean dataVisible -
type
public int type -
TYPE_ACCELERATION
public static final int TYPE_ACCELERATION- See Also:
-
TYPE_VELOCITY
public static final int TYPE_VELOCITY- See Also:
-
TYPE_UNKNOWN
public static final int TYPE_UNKNOWN- See Also:
-
-
Constructor Details
-
Step
Constructs a Step with the specified frame number.- Parameters:
track
- the trackn
- the frame number
-
-
Method Details
-
getFrameNumber
public int getFrameNumber()Gets the frame number.- Returns:
- the frame number
-
setFootprint
Sets the footprint.- Parameters:
footprint
- the footprint
-
getTrack
Gets the track.- Returns:
- the track
-
getPoints
Gets the array of TPoints contained in this step.- Returns:
- the TPoints array
-
getPointIndex
Gets the index of a point in the points[] array.- Parameters:
p
- the point- Returns:
- the index, or -1 if not found
-
getDefaultPoint
Gets the default point. The default point is the point initially selected when the step is created.- Returns:
- the default TPoint
-
setDefaultPointIndex
public void setDefaultPointIndex(int index) Sets the default point index. This defines the index of the points array used to get the point initially selected when the step is created.- Parameters:
index
- the index
-
erase
Erases this on the specified tracker panel. Erasing adds the current bounds to the dirty region and nulls the step's mark to trigger creation of a new one.- Parameters:
trackerPanel
- the tracker panel
-
remark
Erases and remarks this on the specified tracker panel. Remarking creates a new mark for the step and adds both the old and new bounds to the tracker panel's dirty region.- Parameters:
trackerPanel
- the tracker panel
-
repaint
Repaints this on the specified tracker panel. Repainting a step first remarks it and then requests a repaint of the panel's dirty region.- Parameters:
trackerPanel
- the tracker panel
-
erase
public void erase()Erases this on all tracker panels. -
remark
public void remark()Remarks this on all tracker panels. -
repaint
public void repaint()Repaints this on all tracker panels. -
dispose
protected void dispose()Disposes of this step. -
draw
Draws this step.- Parameters:
panel
- the drawing panel requesting the drawingg
- the graphics context on which to draw
-
findInteractive
Finds the Interactive located at the specified pixel position.- Parameters:
panel
- the drawing panelxpix
- the x pixel positionypix
- the y pixel position- Returns:
- the TPoint that is hit, or null
-
getMark
Gets the mark for the specified panel.- Parameters:
trackerPanel
- the tracker panel- Returns:
- the mark
-
toString
Returns a String describing this step. -
clone
Clones this Step. -
setHitRectCenter
protected void setHitRectCenter(int xpix, int ypix) Centers the hit testing rectangle on the specified screen point.- Parameters:
xpix
- the x pixel positionypix
- the y pixel position
-
getLength
public static int getLength()Gets the step length. Default length is 1.- Returns:
- the length of the points array
-