Class TCoordAxes

All Implemented Interfaces:
Serializable, Cloneable, Drawable, Interactive, Measurable, Trackable

public class TCoordAxes extends TShape
This draws the worldspace origin and axes of an image coordinate system.
Version:
1.0
Author:
Douglas Brown
See Also:
  • Field Details

    • vidPanel

      protected VideoPanel vidPanel
    • axes

      protected GeneralPath axes
    • origin

      protected org.opensourcephysics.media.core.TCoordAxes.Origin origin
    • originEnabled

      protected boolean originEnabled
    • xaxisEnabled

      protected boolean xaxisEnabled
    • originShape

      protected GeneralPath originShape
    • xaxis

      protected GeneralPath xaxis
  • Constructor Details

    • TCoordAxes

      public TCoordAxes(VideoPanel panel)
      Constructs a TCoordAxes object for the specified video panel.
      Parameters:
      panel - the video panel
  • Method Details

    • getOrigin

      public TPoint getOrigin()
      Gets the origin.
      Returns:
      the origin
    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Overrides TShape draw method.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class TShape
      Parameters:
      panel - the drawing panel requesting the drawing
      g - the graphics context on which to draw
    • setXY

      public void setXY(double x, double y)
      Overrides TPoint setXY method. Sets the angle of the x axis.
      Specified by:
      setXY in interface Interactive
      Overrides:
      setXY in class TPoint
      Parameters:
      x - the x position
      y - the y position
    • setStroke

      public void setStroke(BasicStroke stroke)
      Overrides TShape setStroke method.
      Overrides:
      setStroke in class TShape
      Parameters:
      stroke - the desired stroke
    • setOriginEnabled

      public void setOriginEnabled(boolean enabled)
      Sets whether the origin responds to mouse hits.
      Parameters:
      enabled - true if origin responds to mouse hits.
    • isOriginEnabled

      public boolean isOriginEnabled()
      Gets whether the origin responds to mouse hits.
      Returns:
      true if the origin responds to mouse hits.
    • setXAxisEnabled

      public void setXAxisEnabled(boolean enabled)
      Sets whether the x-axis responds to mouse hits.
      Parameters:
      enabled - true if x-axis responds to mouse hits.
    • isXAxisEnabled

      public boolean isXAxisEnabled()
      Gets whether the x-axis responds to mouse hits.
      Returns:
      true if the x-axis responds to mouse hits.
    • findInteractive

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Overrides TShape findInteractive method.
      Specified by:
      findInteractive in interface Interactive
      Overrides:
      findInteractive in class TShape
      Parameters:
      panel - the drawing panel
      xpix - the x pixel position on the panel
      ypix - the y pixel position on the panel
      Returns:
      the interactive drawable object
    • toString

      public String toString()
      Returns a String describing this object.
      Overrides:
      toString in class TShape
      Returns:
      a descriptive string
    • getShape

      protected Shape getShape(VideoPanel vidPanel)
      Overrides TShape getShape method.
      Overrides:
      getShape in class TShape
      Parameters:
      vidPanel - the video panel
      Returns:
      the axes shape