org.jfree.chart.annotations
public class XYPointerAnnotation extends XYTextAnnotation implements Cloneable, PublicCloneable, Serializable
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.
Field Summary | |
---|---|
static double | DEFAULT_ARROW_LENGTH The default arrow length (in Java2D units). |
static double | DEFAULT_ARROW_WIDTH The default arrow width (in Java2D units). |
static double | DEFAULT_BASE_RADIUS The default base radius (in Java2D units). |
static double | DEFAULT_LABEL_OFFSET The default label offset (in Java2D units). |
static double | DEFAULT_TIP_RADIUS The default tip radius (in Java2D units). |
Constructor Summary | |
---|---|
XYPointerAnnotation(String label, double x, double y, double angle)
Creates a new label and arrow annotation.
|
Method Summary | |
---|---|
Object | clone()
Returns a clone of the annotation.
|
void | draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, int rendererIndex, PlotRenderingInfo info)
Draws the annotation.
|
boolean | equals(Object obj)
Tests this annotation for equality with an arbitrary object.
|
double | getAngle()
Returns the angle of the arrow.
|
double | getArrowLength()
Returns the arrow length.
|
Paint | getArrowPaint()
Returns the paint used for the arrow.
|
Stroke | getArrowStroke()
Returns the stroke used to draw the arrow line.
|
double | getArrowWidth()
Returns the arrow width.
|
double | getBaseRadius()
Returns the base radius.
|
double | getLabelOffset()
Returns the label offset.
|
double | getTipRadius()
Returns the tip radius.
|
int | hashCode()
Returns a hash code for this instance.
|
void | setAngle(double angle)
Sets the angle of the arrow.
|
void | setArrowLength(double length)
Sets the arrow length.
|
void | setArrowPaint(Paint paint)
Sets the paint used for the arrow.
|
void | setArrowStroke(Stroke stroke)
Sets the stroke used to draw the arrow line.
|
void | setArrowWidth(double width)
Sets the arrow width.
|
void | setBaseRadius(double radius)
Sets the base radius.
|
void | setLabelOffset(double offset)
Sets the label offset (from the arrow base, continuing in a straight
line, in Java2D units).
|
void | setTipRadius(double radius)
Sets the tip radius.
|
Parameters: label the label (null
permitted). 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).
Returns: A clone.
Throws: CloneNotSupportedException if the annotation can't be cloned.
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.
Parameters: obj the object (null
permitted).
Returns: true
or false
.
Returns: The angle (in radians).
See Also: XYPointerAnnotation
Returns: The arrow length.
See Also: XYPointerAnnotation
Returns: The arrow paint (never null
).
See Also: setArrowPaint
Returns: The arrow stroke (never null
).
See Also: setArrowStroke
Returns: The arrow width (in Java2D units).
See Also: XYPointerAnnotation
Returns: The base radius (in Java2D units).
See Also: XYPointerAnnotation
Returns: The label offset (in Java2D units).
See Also: XYPointerAnnotation
Returns: The tip radius (in Java2D units).
See Also: XYPointerAnnotation
Returns: A hash code.
Parameters: angle the angle (in radians).
See Also: getAngle
Parameters: length the length.
See Also: getArrowLength
Parameters: paint the arrow paint (null
not permitted).
See Also: getArrowPaint
Parameters: stroke the stroke (null
not permitted).
See Also: getArrowStroke
Parameters: width the width (in Java2D units).
See Also: getArrowWidth
Parameters: radius the radius (in Java2D units).
See Also: getBaseRadius
Parameters: offset the offset (in Java2D units).
See Also: getLabelOffset
Parameters: radius the radius (in Java2D units).
See Also: getTipRadius