Class AbstractTrail

java.lang.Object
org.opensourcephysics.display.AbstractTrail
All Implemented Interfaces:
Drawable, Measurable
Direct Known Subclasses:
Trail, TrailBezier

public abstract class AbstractTrail extends Object implements Drawable, Measurable
AbstractTrail defines a trail of pixels on the screen. This object is often used to show the path of a moving object.
Version:
1.0
Author:
Wolfgang Christian
  • Field Details

    • color

      public Color color
    • enableMeasure

      protected boolean enableMeasure
    • xmin

      protected double xmin
    • xmax

      protected double xmax
    • ymin

      protected double ymin
    • ymax

      protected double ymax
    • xmaxLogscale

      protected double xmaxLogscale
    • ymaxLogscale

      protected double ymaxLogscale
    • xminLogscale

      protected double xminLogscale
    • yminLogscale

      protected double yminLogscale
    • numpts

      protected int numpts
    • closed

      protected boolean closed
    • drawingStroke

      protected Stroke drawingStroke
  • Constructor Details

    • AbstractTrail

      public AbstractTrail()
  • Method Details

    • addPoint

      public abstract void addPoint(double x, double y)
      Adds a point to the trail.
      Parameters:
      x - double
      y - double
    • closeTrail

      public abstract void closeTrail()
      Closes the path by connecting the first point to the last point. Points cannot be added to a closed path;
    • clear

      public abstract void clear()
      Clears all points from the trail.
    • setStroke

      public void setStroke(Stroke stroke)
      Sets the drawing stroke.
      Parameters:
      stroke - Stroke
    • setDashedStroke

      public void setDashedStroke(int dashPoint, int dashLength)
      Sets the the dash line stroke.
      Parameters:
      int - dashPoint
      int - dashLength
    • getStroke

      public Stroke getStroke()
      Gets the drawing stroke.
      Returns:
      Stroke
    • getNumberOfPoints

      public int getNumberOfPoints()
      Gets the number of points stored in the trail.
      Returns:
      int
    • setMeasured

      public void setMeasured(boolean _enableMeasure)
      Enables the measured flag so that this circle effects the scale of a drawing panel.
    • isMeasured

      public boolean isMeasured()
      Determines if this trail scales the drawing panel.
      Specified by:
      isMeasured in interface Measurable
      Returns:
      boolean
    • getXMin

      public double getXMin()
      Gets the minimum x value in the trail.
      Specified by:
      getXMin in interface Measurable
      Returns:
      double
    • getXMax

      public double getXMax()
      Gets the maximum x value in the trail.
      Specified by:
      getXMax in interface Measurable
      Returns:
      double
    • getYMin

      public double getYMin()
      Gets the minimum y value in the trail.
      Specified by:
      getYMin in interface Measurable
      Returns:
      double
    • getYMax

      public double getYMax()
      Gets the maximum y value in the trail.
      Specified by:
      getYMax in interface Measurable
      Returns:
      double
    • getXMinLogscale

      public double getXMinLogscale()
      Gets the minimum x needed to draw this object on a log scale.
      Returns:
      minimum
    • getXMaxLogscale

      public double getXMaxLogscale()
      Gets the maximum x needed to draw this object on a log scale.
      Returns:
      maximum
    • getYMinLogscale

      public double getYMinLogscale()
      Gets the minimum y needed to draw this object on a log scale.
      Returns:
      minimum
    • getYMaxLogscale

      public double getYMaxLogscale()
      Gets the maximum y needed to draw this object on a log scale on a log scale.
      Returns:
      maximum