Package edu.cnu.mdi.splot.plot
Class PlotLine
java.lang.Object
edu.cnu.mdi.splot.plot.PlotLine
- Direct Known Subclasses:
HorizontalLine,VerticalLine
Just a straight line to be drawn on the plot, e.g. a y = 0 line
- Author:
- heddle
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PlotCanvasprotected static Styledprotected Styledprotected Pointprotected Pointprotected Point2D.Double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D g2) Draw the line on the given graphics contextgetStyle()Get the line styleabstract doublegetX0()Get the starting x coordinateabstract doublegetX1()Get the ending x coordinateabstract doublegetY0()Get the starting y coordinateabstract doublegetY1()Get the ending y coordinatevoidSet the line drawing styletoString()
-
Field Details
-
_defaultStyle
-
_canvas
-
_style
-
p0
-
p1
-
wp
-
-
Constructor Details
-
PlotLine
Create a PlotLine- Parameters:
canvas- the owner canvas
-
-
Method Details
-
setStyle
Set the line drawing style- Parameters:
style- the new style
-
getStyle
Get the line style- Returns:
- the line style
-
draw
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
-