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 SummaryFieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected Footprintprotected static final NumberFormatprotected static final Rectangleprotected intprotected TPoint[]protected Point[]protected static Shapeprotected static Strokeprotected intprotected static final AffineTransformintstatic final intstatic final intstatic final intprotected boolean
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()Clones this Step.protected voiddispose()Disposes of this step.voiddraw(DrawingPanel panel, Graphics g) Draws this step.voiderase()Erases this on all tracker panels.voidErases 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.intGets the frame number.static intGets the step length.protected MarkgetMark(TrackerPanel trackerPanel) Gets the mark for the specified panel.intGets the index of a point in the points[] array.TPoint[]Gets the array of TPoints contained in this step.getTrack()Gets the track.voidremark()Remarks this on all tracker panels.voidErases and remarks this on the specified tracker panel.voidrepaint()Repaints this on all tracker panels.voidRepaints this on the specified tracker panel.voidsetDefaultPointIndex(int index) Sets the default point index.voidsetFootprint(Footprint footprint) Sets the footprint.protected voidsetHitRectCenter(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
- 
trackIDprotected int trackID
- 
nprotected int n
- 
footprint
- 
points
- 
screenPoints
- 
validprotected boolean valid
- 
panelMarks
- 
defaultIndexprotected int defaultIndex
- 
dataVisibleprotected boolean dataVisible
- 
typepublic int type
- 
TYPE_ACCELERATIONpublic static final int TYPE_ACCELERATION- See Also:
 
- 
TYPE_VELOCITYpublic static final int TYPE_VELOCITY- See Also:
 
- 
TYPE_UNKNOWNpublic static final int TYPE_UNKNOWN- See Also:
 
 
- 
- 
Constructor Details- 
StepConstructs a Step with the specified frame number.- Parameters:
- track- the track
- n- the frame number
 
 
- 
- 
Method Details- 
getFrameNumberpublic int getFrameNumber()Gets the frame number.- Returns:
- the frame number
 
- 
setFootprintSets the footprint.- Parameters:
- footprint- the footprint
 
- 
getTrackGets the track.- Returns:
- the track
 
- 
getPointsGets the array of TPoints contained in this step.- Returns:
- the TPoints array
 
- 
getPointIndexGets the index of a point in the points[] array.- Parameters:
- p- the point
- Returns:
- the index, or -1 if not found
 
- 
getDefaultPointGets the default point. The default point is the point initially selected when the step is created.- Returns:
- the default TPoint
 
- 
setDefaultPointIndexpublic 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
 
- 
eraseErases 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
 
- 
remarkErases 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
 
- 
repaintRepaints 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
 
- 
erasepublic void erase()Erases this on all tracker panels.
- 
remarkpublic void remark()Remarks this on all tracker panels.
- 
repaintpublic void repaint()Repaints this on all tracker panels.
- 
disposeprotected void dispose()Disposes of this step.
- 
drawDraws this step.- Parameters:
- panel- the drawing panel requesting the drawing
- g- the graphics context on which to draw
 
- 
findInteractiveFinds the Interactive located at the specified pixel position.- Parameters:
- panel- the drawing panel
- xpix- the x pixel position
- ypix- the y pixel position
- Returns:
- the TPoint that is hit, or null
 
- 
getMarkGets the mark for the specified panel.- Parameters:
- trackerPanel- the tracker panel
- Returns:
- the mark
 
- 
toStringReturns a String describing this step.
- 
cloneClones this Step.
- 
setHitRectCenterprotected void setHitRectCenter(int xpix, int ypix) Centers the hit testing rectangle on the specified screen point.- Parameters:
- xpix- the x pixel position
- ypix- the y pixel position
 
- 
getLengthpublic static int getLength()Gets the step length. Default length is 1.- Returns:
- the length of the points array
 
 
-