Class PlotLine

java.lang.Object
edu.cnu.mdi.splot.plot.PlotLine
Direct Known Subclasses:
HorizontalLine, VerticalLine

public abstract class PlotLine extends Object
Just a straight line to be drawn on the plot, e.g. a y = 0 line
Author:
heddle
  • Field Details

  • Constructor Details

    • PlotLine

      public PlotLine(PlotCanvas canvas)
      Create a PlotLine
      Parameters:
      canvas - the owner canvas
  • Method Details

    • setStyle

      public void setStyle(Styled style)
      Set the line drawing style
      Parameters:
      style - the new style
    • getStyle

      public Styled getStyle()
      Get the line style
      Returns:
      the line style
    • draw

      public void draw(Graphics2D g2)
      Draw the line on the given graphics context
      Parameters:
      g2 - the graphics context to draw on
    • getX0

      public abstract double getX0()
      Get the starting x coordinate
      Returns:
      the starting x coordinate
    • getX1

      public abstract double getX1()
      Get the ending x coordinate
      Returns:
      the ending x coordinate
    • getY0

      public abstract double getY0()
      Get the starting y coordinate
      Returns:
      the starting y coordinate
    • getY1

      public abstract double getY1()
      Get the ending y coordinate
      Returns:
      the ending y coordinate
    • toString

      public String toString()
      Overrides:
      toString in class Object