org.jfree.chart.annotations
Class CategoryLineAnnotation
java.lang.Object
org.jfree.chart.annotations.CategoryLineAnnotation
- CategoryAnnotation, Cloneable, Serializable
CategoryLineAnnotation(Comparable category1, double value1, Comparable category2, double value2, Paint paint, Stroke stroke) - Creates a new annotation that draws a line between (category1, value1)
and (category2, value2).
|
Object | clone() - Returns a clone of the annotation.
|
void | draw(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, CategoryAxis domainAxis, ValueAxis rangeAxis) - Draws the annotation.
|
boolean | equals(Object obj) - Tests this object for equality with another.
|
Comparable | getCategory1() - Returns the category for the start of the line.
|
Comparable | getCategory2() - Returns the category for the end of the line.
|
Paint | getPaint() - Returns the paint used to draw the connecting line.
|
Stroke | getStroke() - Returns the stroke used to draw the connecting line.
|
double | getValue1() - Returns the y-value for the start of the line.
|
double | getValue2() - Returns the y-value for the end of the line.
|
int | hashCode() - Returns a hash code for this instance.
|
void | setCategory1(Comparable category) - Sets the category for the start of the line.
|
void | setCategory2(Comparable category) - Sets the category for the end of the line.
|
void | setPaint(Paint paint) - Sets the paint used to draw the connecting line.
|
void | setStroke(Stroke stroke) - Sets the stroke used to draw the connecting line.
|
void | setValue1(double value) - Sets the y-value for the start of the line.
|
void | setValue2(double value) - Sets the y-value for the end of the line.
|
CategoryLineAnnotation
public CategoryLineAnnotation(Comparable category1,
double value1,
Comparable category2,
double value2,
Paint paint,
Stroke stroke)
Creates a new annotation that draws a line between (category1, value1)
and (category2, value2).
category1
- the category (null
not permitted).value1
- the value.category2
- the category (null
not permitted).value2
- the value.paint
- the line color (null
not permitted).stroke
- the line stroke (null
not permitted).
clone
public Object clone()
throws CloneNotSupportedException
Returns a clone of the annotation.
draw
public void draw(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea,
CategoryAxis domainAxis,
ValueAxis rangeAxis)
Draws the annotation.
- draw in interface CategoryAnnotation
g2
- the graphics device.plot
- the plot.dataArea
- the data area.domainAxis
- the domain axis.rangeAxis
- the range axis.
equals
public boolean equals(Object obj)
Tests this object for equality with another.
obj
- the object (null
permitted).
getCategory1
public Comparable getCategory1()
Returns the category for the start of the line.
- The category for the start of the line (never
null
).
getCategory2
public Comparable getCategory2()
Returns the category for the end of the line.
- The category for the end of the line (never
null
).
getPaint
public Paint getPaint()
Returns the paint used to draw the connecting line.
getStroke
public Stroke getStroke()
Returns the stroke used to draw the connecting line.
getValue1
public double getValue1()
Returns the y-value for the start of the line.
- The y-value for the start of the line.
getValue2
public double getValue2()
Returns the y-value for the end of the line.
- The y-value for the end of the line.
hashCode
public int hashCode()
Returns a hash code for this instance.
setCategory1
public void setCategory1(Comparable category)
Sets the category for the start of the line.
category
- the category (null
not permitted).
setCategory2
public void setCategory2(Comparable category)
Sets the category for the end of the line.
category
- the category (null
not permitted).
setPaint
public void setPaint(Paint paint)
Sets the paint used to draw the connecting line.
paint
- the paint (null
not permitted).
setStroke
public void setStroke(Stroke stroke)
Sets the stroke used to draw the connecting line.
stroke
- the stroke (null
not permitted).
setValue1
public void setValue1(double value)
Sets the y-value for the start of the line.
setValue2
public void setValue2(double value)
Sets the y-value for the end of the line.