Save This Page
Home » jcommon-1.0.13 » org.jfree » chart » annotations » [javadoc | source]
org.jfree.chart.annotations
public class: XYPointerAnnotation [javadoc | source]
java.lang.Object
   org.jfree.chart.annotations.AbstractXYAnnotation
      org.jfree.chart.annotations.XYTextAnnotation
         org.jfree.chart.annotations.XYPointerAnnotation

All Implemented Interfaces:
    PublicCloneable, Cloneable, Serializable, XYAnnotation

An arrow and label that can be placed on an org.jfree.chart.plot.XYPlot . The arrow is drawn at a user-definable angle so that it points towards the (x, y) location for 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.
Field Summary
public static final  double DEFAULT_TIP_RADIUS    The default tip radius (in Java2D units). 
public static final  double DEFAULT_BASE_RADIUS    The default base radius (in Java2D units). 
public static final  double DEFAULT_LABEL_OFFSET    The default label offset (in Java2D units). 
public static final  double DEFAULT_ARROW_LENGTH    The default arrow length (in Java2D units). 
public static final  double DEFAULT_ARROW_WIDTH    The default arrow width (in Java2D units). 
Fields inherited from org.jfree.chart.annotations.XYTextAnnotation:
DEFAULT_FONT,  DEFAULT_PAINT,  DEFAULT_TEXT_ANCHOR,  DEFAULT_ROTATION_ANCHOR,  DEFAULT_ROTATION_ANGLE
Constructor:
 public XYPointerAnnotation(String label,
    double x,
    double y,
    double angle) 
    Creates a new label and arrow annotation.
    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).
Method from org.jfree.chart.annotations.XYPointerAnnotation Summary:
clone,   draw,   equals,   getAngle,   getArrowLength,   getArrowPaint,   getArrowStroke,   getArrowWidth,   getBaseRadius,   getLabelOffset,   getTipRadius,   hashCode,   setAngle,   setArrowLength,   setArrowPaint,   setArrowStroke,   setArrowWidth,   setBaseRadius,   setLabelOffset,   setTipRadius
Methods from org.jfree.chart.annotations.XYTextAnnotation:
clone,   draw,   equals,   getFont,   getPaint,   getRotationAnchor,   getRotationAngle,   getText,   getTextAnchor,   getX,   getY,   hashCode,   setFont,   setPaint,   setRotationAnchor,   setRotationAngle,   setText,   setTextAnchor,   setX,   setY
Methods from org.jfree.chart.annotations.AbstractXYAnnotation:
addEntity,   draw,   equals,   getToolTipText,   getURL,   hashCode,   setToolTipText,   setURL
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.chart.annotations.XYPointerAnnotation Detail:
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the annotation.
 public  void draw(Graphics2D g2,
    XYPlot plot,
    Rectangle2D dataArea,
    ValueAxis domainAxis,
    ValueAxis rangeAxis,
    int rendererIndex,
    PlotRenderingInfo info) 
    Draws the annotation.
 public boolean equals(Object obj) 
    Tests this annotation for equality with an arbitrary object.
 public double getAngle() 
    Returns the angle of the arrow.
 public double getArrowLength() 
    Returns the arrow length.
 public Paint getArrowPaint() 
    Returns the paint used for the arrow.
 public Stroke getArrowStroke() 
    Returns the stroke used to draw the arrow line.
 public double getArrowWidth() 
    Returns the arrow width.
 public double getBaseRadius() 
    Returns the base radius.
 public double getLabelOffset() 
    Returns the label offset.
 public double getTipRadius() 
    Returns the tip radius.
 public int hashCode() 
    Returns a hash code for this instance.
 public  void setAngle(double angle) 
    Sets the angle of the arrow.
 public  void setArrowLength(double length) 
    Sets the arrow length.
 public  void setArrowPaint(Paint paint) 
    Sets the paint used for the arrow.
 public  void setArrowStroke(Stroke stroke) 
    Sets the stroke used to draw the arrow line.
 public  void setArrowWidth(double width) 
    Sets the arrow width.
 public  void setBaseRadius(double radius) 
    Sets the base radius.
 public  void setLabelOffset(double offset) 
    Sets the label offset (from the arrow base, continuing in a straight line, in Java2D units).
 public  void setTipRadius(double radius) 
    Sets the tip radius.