Class PositionStep

java.lang.Object
org.opensourcephysics.cabrillo.tracker.Step
org.opensourcephysics.cabrillo.tracker.PositionStep
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
MultiPositionStep

public class PositionStep extends Step
This is a Step that represents a position. It is used by PointMass tracks.
Author:
Douglas Brown
  • Field Details

  • Constructor Details

    • 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 Details

    • 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, 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
    • clone

      public Object clone()
      Clones this Step.
      Overrides:
      clone in class Step
      Returns:
      a cloned step
    • toString

      public String toString()
      Returns a String describing this.
      Overrides:
      toString in class Step
      Returns:
      a descriptive string
    • getLayoutPosition

      protected 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