Java 类org.jfree.chart.annotations.XYAnnotation 实例源码

项目:parabuild-ci    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    if (annotation == null) {
        throw new IllegalArgumentException("Null 'annotation' argument.");
    }
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        notifyListeners(new RendererChangeEvent(this));
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        notifyListeners(new RendererChangeEvent(this));
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:parabuild-ci    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
public void drawAnnotations(Graphics2D g2,
                            Rectangle2D dataArea,
                            ValueAxis domainAxis,
                            ValueAxis rangeAxis,
                            Layer layer,
                            PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                0, info);
    }

}
项目:ccu-historian    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:ccu-historian    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:jfreechart    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation ({@code null} not permitted).
 * @param layer  the layer ({@code null} not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    Args.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:jfreechart    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:aya-lang    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:aya-lang    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:HTML5_WebSite    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    if (annotation == null) {
        throw new IllegalArgumentException("Null 'annotation' argument.");
    }
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:HTML5_WebSite    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
public void drawAnnotations(Graphics2D g2,
                            Rectangle2D dataArea,
                            ValueAxis domainAxis,
                            ValueAxis rangeAxis,
                            Layer layer,
                            PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                0, info);
    }

}
项目:populus    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:populus    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:PI    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    if (annotation == null) {
        throw new IllegalArgumentException("Null 'annotation' argument.");
    }
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:PI    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
public void drawAnnotations(Graphics2D g2,
                            Rectangle2D dataArea,
                            ValueAxis domainAxis,
                            ValueAxis rangeAxis,
                            Layer layer,
                            PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                0, info);
    }

}
项目:nabs    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    if (annotation == null) {
        throw new IllegalArgumentException("Null 'annotation' argument.");
    }
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        notifyListeners(new RendererChangeEvent(this));
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        notifyListeners(new RendererChangeEvent(this));
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:nabs    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
public void drawAnnotations(Graphics2D g2,
                            Rectangle2D dataArea,
                            ValueAxis domainAxis,
                            ValueAxis rangeAxis,
                            Layer layer,
                            PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                0, info);
    }

}
项目:ECG-Viewer    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:ECG-Viewer    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:astor    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    if (annotation == null) {
        throw new IllegalArgumentException("Null 'annotation' argument.");
    }
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:opensim-gui    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer.
 * 
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    if (annotation == null) {
        throw new IllegalArgumentException("Null 'annotation' argument.");
    }
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        notifyListeners(new RendererChangeEvent(this));
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        notifyListeners(new RendererChangeEvent(this));
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:opensim-gui    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 * 
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
public void drawAnnotations(Graphics2D g2, 
                            Rectangle2D dataArea, 
                            ValueAxis domainAxis, 
                            ValueAxis rangeAxis, 
                            Layer layer, 
                            PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis, 
                0, info);
    }

}
项目:group-five    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:group-five    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:manydesigns.cn    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:manydesigns.cn    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:snap-desktop    文件:TimeSeriesGraphModel.java   
void updateAnnotation(RasterDataNode raster) {
    removeAnnotation();

    final AbstractTimeSeries timeSeries = getTimeSeries();
    TimeCoding timeCoding = timeSeries.getRasterTimeMap().get(raster);
    if (timeCoding != null) {
        final ProductData.UTC startTime = timeCoding.getStartTime();
        final Millisecond timePeriod = new Millisecond(startTime.getAsDate(),
                ProductData.UTC.UTC_TIME_ZONE,
                Locale.getDefault());

        double millisecond = timePeriod.getFirstMillisecond();
        Range valueRange = null;
        for (int i = 0; i < timeSeriesPlot.getRangeAxisCount(); i++) {
            valueRange = Range.combine(valueRange, timeSeriesPlot.getRangeAxis(i).getRange());
        }
        if (valueRange != null) {
            XYAnnotation annotation = new XYLineAnnotation(millisecond, valueRange.getLowerBound(), millisecond,
                    valueRange.getUpperBound());
            timeSeriesPlot.addAnnotation(annotation, true);
        }
    }
}
项目:nmonvisualizer    文件:LineChartPanel.java   
@Override
public void addAnnotations(List<Annotation> annotations) {
    if (getChart() != null) {
        XYPlot plot = getChart().getXYPlot();

        plot.clearAnnotations();

        for (Annotation a : annotations) {
            if (a instanceof XYAnnotation) {
                XYAnnotation annotation = (XYAnnotation) a;
                plot.addAnnotation(annotation);

                firePropertyChange("annotation", null, annotation);
            }
        }
    }
}
项目:buffer_bci    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:buffer_bci    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:buffer_bci    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:buffer_bci    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:proyecto-teoria-control-utn-frro    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:proyecto-teoria-control-utn-frro    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:Memetic-Algorithm-for-TSP    文件:AbstractXYItemRenderer.java   
/**
 * Adds an annotation to the specified layer and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 * @param layer  the layer (<code>null</code> not permitted).
 */
@Override
public void addAnnotation(XYAnnotation annotation, Layer layer) {
    ParamChecks.nullNotPermitted(annotation, "annotation");
    if (layer.equals(Layer.FOREGROUND)) {
        this.foregroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        this.backgroundAnnotations.add(annotation);
        annotation.addChangeListener(this);
        fireChangeEvent();
    }
    else {
        // should never get here
        throw new RuntimeException("Unknown layer.");
    }
}
项目:Memetic-Algorithm-for-TSP    文件:AbstractXYItemRenderer.java   
/**
 * Draws all the annotations for the specified layer.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param layer  the layer.
 * @param info  the plot rendering info.
 */
@Override
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea,
        ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer,
        PlotRenderingInfo info) {

    Iterator iterator = null;
    if (layer.equals(Layer.FOREGROUND)) {
        iterator = this.foregroundAnnotations.iterator();
    }
    else if (layer.equals(Layer.BACKGROUND)) {
        iterator = this.backgroundAnnotations.iterator();
    }
    else {
        // should not get here
        throw new RuntimeException("Unknown layer.");
    }
    while (iterator.hasNext()) {
        XYAnnotation annotation = (XYAnnotation) iterator.next();
        int index = this.plot.getIndexOf(this);
        annotation.draw(g2, this.plot, dataArea, domainAxis, rangeAxis,
                index, info);
    }

}
项目:parabuild-ci    文件:XYPlot.java   
/**
 * Adds an annotation to the plot and sends a {@link PlotChangeEvent} to all
 * registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 */
public void addAnnotation(XYAnnotation annotation) {
    if (annotation == null) {
        throw new IllegalArgumentException("Null 'annotation' argument.");      
    }
    if (this.annotations == null) {
        this.annotations = new java.util.ArrayList();
    }
    this.annotations.add(annotation);
    notifyListeners(new PlotChangeEvent(this));

}
项目:parabuild-ci    文件:XYPlot.java   
/**
* Removes an annotation from the plot and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param annotation  the annotation (<code>null</code> not permitted).
* 
* @return A boolean (indicates whether or not the annotation is removed).
*/
public boolean removeAnnotation(XYAnnotation annotation) {
    if (annotation == null) {
        throw new IllegalArgumentException("Null 'annotation' argument.");
    }
    if (this.annotations != null) {
        boolean removed = this.annotations.remove(annotation);
        notifyListeners(new PlotChangeEvent(this));
        return removed;
    }
    else {
        return false;
    }
}
项目:parabuild-ci    文件:XYPlot.java   
/**
 * Draws the annotations for the plot.
 *
 * @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) {

    // draw the annotations...
    if (this.annotations != null) {
        Iterator iterator = this.annotations.iterator();
        while (iterator.hasNext()) {
            XYAnnotation annotation = (XYAnnotation) iterator.next();
            annotation.draw(g2, this, dataArea, getDomainAxis(), getRangeAxis());
        }
    }

}
项目:parabuild-ci    文件:ContourPlot.java   
/**
 * Adds an annotation to the plot.
 *
 * @param annotation  the annotation.
 */
public void addAnnotation(XYAnnotation annotation) {

    if (this.annotations == null) {
        this.annotations = new java.util.ArrayList();
    }
    this.annotations.add(annotation);
    notifyListeners(new PlotChangeEvent(this));

}
项目:parabuild-ci    文件:XYPlot.java   
/**
 * Draws the annotations for the plot.
 *
 * @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);
    }

}