Package org.jfree.chart.annotations
Class XYDataRangeAnnotation
- java.lang.Object
-
- org.jfree.chart.annotations.AbstractAnnotation
-
- org.jfree.chart.annotations.AbstractXYAnnotation
-
- org.jfree.chart.annotations.XYDataRangeAnnotation
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Annotation
,XYAnnotation
,XYAnnotationBoundsInfo
public class XYDataRangeAnnotation extends AbstractXYAnnotation implements XYAnnotationBoundsInfo
This annotation can be put on anXYPlot
to ensure a visible data range. The range values should be specified w.r.t. to the first (index 0) domain or range axis.
-
-
Field Summary
Fields Modifier and Type Field Description private Range
minimumDomainRange
private Range
minimumRangeRange
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description XYDataRangeAnnotation(Range minimumDomainRange, Range minimumRangeRange)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
draw(java.awt.Graphics2D g2, XYPlot plot, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)
Draws the annotation.boolean
equals(java.lang.Object obj)
Tests this annotation for equality with an arbitrary object.boolean
getIncludeInDataBounds()
Returns a flag that determines whether or not the annotation's bounds should be taken into account for auto-range calculations on the axes that the annotation is plotted against.Range
getXRange()
Returns the range of x-values (in data space) that the annotation uses.Range
getYRange()
Returns the range of y-values (in data space) that the annotation uses.int
hashCode()
Returns a hash code for this instance.-
Methods inherited from class org.jfree.chart.annotations.AbstractXYAnnotation
addEntity, canEqual, getToolTipText, getURL, setToolTipText, setURL
-
Methods inherited from class org.jfree.chart.annotations.AbstractAnnotation
addChangeListener, clone, fireAnnotationChanged, getNotify, hasListener, notifyListeners, removeChangeListener, setNotify
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.chart.annotations.Annotation
addChangeListener, removeChangeListener
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
minimumDomainRange
private final Range minimumDomainRange
-
minimumRangeRange
private final Range minimumRangeRange
-
-
Method Detail
-
getIncludeInDataBounds
public boolean getIncludeInDataBounds()
Description copied from interface:XYAnnotationBoundsInfo
Returns a flag that determines whether or not the annotation's bounds should be taken into account for auto-range calculations on the axes that the annotation is plotted against.- Specified by:
getIncludeInDataBounds
in interfaceXYAnnotationBoundsInfo
- Returns:
- A boolean.
-
getXRange
public Range getXRange()
Description copied from interface:XYAnnotationBoundsInfo
Returns the range of x-values (in data space) that the annotation uses.- Specified by:
getXRange
in interfaceXYAnnotationBoundsInfo
- Returns:
- The x-range.
-
getYRange
public Range getYRange()
Description copied from interface:XYAnnotationBoundsInfo
Returns the range of y-values (in data space) that the annotation uses.- Specified by:
getYRange
in interfaceXYAnnotationBoundsInfo
- Returns:
- The y-range.
-
draw
public void draw(java.awt.Graphics2D g2, XYPlot plot, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)
Description copied from class:AbstractXYAnnotation
Draws the annotation.- Specified by:
draw
in interfaceXYAnnotation
- Specified by:
draw
in classAbstractXYAnnotation
- Parameters:
g2
- the graphics device.plot
- the plot.dataArea
- the data area.domainAxis
- the domain axis.rangeAxis
- the range axis.rendererIndex
- the renderer index.info
- if supplied, this info object will be populated with entity information.
-
hashCode
public int hashCode()
Description copied from class:AbstractXYAnnotation
Returns a hash code for this instance.- Overrides:
hashCode
in classAbstractXYAnnotation
- Returns:
- A hash code.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:AbstractXYAnnotation
Tests this annotation for equality with an arbitrary object.- Overrides:
equals
in classAbstractXYAnnotation
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
-