Example usage for org.jfree.chart.annotations XYAnnotation draw

List of usage examples for org.jfree.chart.annotations XYAnnotation draw

Introduction

In this page you can find the example usage for org.jfree.chart.annotations XYAnnotation draw.

Prototype

public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis,
        int rendererIndex, PlotRenderingInfo info);

Source Link

Document

Draws the annotation.

Usage

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Draws the annotations for the plot.//from   w  w w  .j  av a 2  s .  c  om
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param info  the chart rendering info.
 */
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info) {

    Iterator iterator = this.annotations.iterator();
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        ValueAxis xAxis = getDomainAxis();
        ValueAxis yAxis = getRangeAxis();
        annotation.draw(g2, this, dataArea, xAxis, yAxis, 0, info);
    }

}