Package org.jfree.chart.annotations
Class XYInversePointerAnnotation
- java.lang.Object
-
- org.jfree.chart.annotations.AbstractAnnotation
-
- org.jfree.chart.annotations.AbstractXYAnnotation
-
- org.jfree.chart.annotations.XYTextAnnotation
-
- org.jfree.chart.annotations.XYPointerAnnotation
-
- org.jfree.chart.annotations.XYInversePointerAnnotation
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Annotation,XYAnnotation,PublicCloneable
public class XYInversePointerAnnotation extends XYPointerAnnotation implements java.lang.Cloneable, PublicCloneable, java.io.Serializable
An arrow and label that can be placed on anXYPlot. The arrow is drawn at a user-definable angle but points towards the label of the annotation.The arrow length (and its offset from the (x, y) location) is controlled by the tip radius and the base radius attributes. Imagine two circles around the (x, y) coordinate: the inner circle defined by the tip radius, and the outer circle defined by the base radius. Now, draw the arrow starting at some point on the outer circle (the point is determined by the angle), with the arrow tip being drawn at a corresponding point on the inner circle.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_DOT_RADIUSThe default dot radius (in Java2D units).private doubledotRadiusThe radius of the dot at the start of the arrow.private static longserialVersionUIDFor serialization.-
Fields inherited from class org.jfree.chart.annotations.XYPointerAnnotation
DEFAULT_ARROW_LENGTH, DEFAULT_ARROW_WIDTH, DEFAULT_BASE_RADIUS, DEFAULT_LABEL_OFFSET, DEFAULT_TIP_RADIUS
-
Fields inherited from class org.jfree.chart.annotations.XYTextAnnotation
DEFAULT_FONT, DEFAULT_PAINT, DEFAULT_ROTATION_ANCHOR, DEFAULT_ROTATION_ANGLE, DEFAULT_TEXT_ANCHOR
-
-
Constructor Summary
Constructors Constructor Description XYInversePointerAnnotation(java.lang.String label, double x, double y, double angle)Creates a new label and arrow annotation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a clone of the annotation.voiddraw(java.awt.Graphics2D g2, XYPlot plot, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)Draws the annotation.booleanequals(java.lang.Object obj)Tests this annotation for equality with an arbitrary object.doublegetDotRadius()Returns the radius of the dot at the start of the arrow.inthashCode()Returns a hash code for this instance.voidsetDotRadius(double dotRadius)Sets the radius of the dot at the start of the arrow, ≤ 0 will omit the dot.-
Methods inherited from class org.jfree.chart.annotations.XYPointerAnnotation
canEqual, getAngle, getArrowLength, getArrowPaint, getArrowStroke, getArrowWidth, getBaseRadius, getLabelOffset, getTipRadius, setAngle, setArrowLength, setArrowPaint, setArrowStroke, setArrowWidth, setBaseRadius, setLabelOffset, setTipRadius
-
Methods inherited from class org.jfree.chart.annotations.XYTextAnnotation
getBackgroundPaint, getFont, getOutlinePaint, getOutlineStroke, getPaint, getRotationAnchor, getRotationAngle, getText, getTextAnchor, getX, getY, isOutlineVisible, setBackgroundPaint, setFont, setOutlinePaint, setOutlineStroke, setOutlineVisible, setPaint, setRotationAnchor, setRotationAngle, setText, setTextAnchor, setX, setY
-
Methods inherited from class org.jfree.chart.annotations.AbstractXYAnnotation
addEntity, getToolTipText, getURL, setToolTipText, setURL
-
Methods inherited from class org.jfree.chart.annotations.AbstractAnnotation
addChangeListener, 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
For serialization.- See Also:
- Constant Field Values
-
DEFAULT_DOT_RADIUS
public static final double DEFAULT_DOT_RADIUS
The default dot radius (in Java2D units).- See Also:
- Constant Field Values
-
dotRadius
private double dotRadius
The radius of the dot at the start of the arrow.
-
-
Constructor Detail
-
XYInversePointerAnnotation
public XYInversePointerAnnotation(java.lang.String label, double x, double y, double angle)Creates a new label and arrow annotation.- Parameters:
label- the label (nullpermitted).x- the x-coordinate (measured against the chart's domain axis).y- the y-coordinate (measured against the chart's range axis).angle- the angle of the arrow's line (in radians).
-
-
Method Detail
-
getDotRadius
public double getDotRadius()
Returns the radius of the dot at the start of the arrow.- Returns:
- the radius of the dot at the start of the arrow
- See Also:
setDotRadius(double)
-
setDotRadius
public void setDotRadius(double dotRadius)
Sets the radius of the dot at the start of the arrow, ≤ 0 will omit the dot.- Parameters:
dotRadius- the radius of the dot at the start of the arrow- See Also:
getDotRadius()
-
draw
public void draw(java.awt.Graphics2D g2, XYPlot plot, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)Draws the annotation.- Specified by:
drawin interfaceXYAnnotation- Overrides:
drawin classXYPointerAnnotation- 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- the plot rendering info.
-
hashCode
public int hashCode()
Description copied from class:XYPointerAnnotationReturns a hash code for this instance.- Overrides:
hashCodein classXYPointerAnnotation- Returns:
- A hash code.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:XYPointerAnnotationTests this annotation for equality with an arbitrary object.- Overrides:
equalsin classXYPointerAnnotation- Parameters:
obj- the object (nullpermitted).- Returns:
trueorfalse.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of the annotation.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classXYPointerAnnotation- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if the annotation can't be cloned.
-
-