Search in sources :

Example 11 with PublicCloneable

use of org.jfree.util.PublicCloneable in project SIMVA-SoS by SESoS.

the class XYLineAnnotationTest method testPublicCloneable.

/**
 * Checks that this class implements PublicCloneable.
 */
@Test
public void testPublicCloneable() {
    Stroke stroke = new BasicStroke(2.0f);
    XYLineAnnotation a1 = new XYLineAnnotation(10.0, 20.0, 100.0, 200.0, stroke, Color.blue);
    assertTrue(a1 instanceof PublicCloneable);
}
Also used : BasicStroke(java.awt.BasicStroke) Stroke(java.awt.Stroke) BasicStroke(java.awt.BasicStroke) PublicCloneable(org.jfree.util.PublicCloneable) Test(org.junit.Test)

Example 12 with PublicCloneable

use of org.jfree.util.PublicCloneable in project SIMVA-SoS by SESoS.

the class XYPolygonAnnotationTest method testPublicCloneable.

/**
 * Checks that this class implements PublicCloneable.
 */
@Test
public void testPublicCloneable() {
    Stroke stroke1 = new BasicStroke(2.0f);
    XYPolygonAnnotation a1 = new XYPolygonAnnotation(new double[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 }, stroke1, Color.red, Color.blue);
    assertTrue(a1 instanceof PublicCloneable);
}
Also used : BasicStroke(java.awt.BasicStroke) Stroke(java.awt.Stroke) BasicStroke(java.awt.BasicStroke) PublicCloneable(org.jfree.util.PublicCloneable) Test(org.junit.Test)

Example 13 with PublicCloneable

use of org.jfree.util.PublicCloneable in project SIMVA-SoS by SESoS.

the class AbstractBlock method clone.

/**
 * Returns a clone of this block.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException if there is a problem creating the
 *         clone.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    AbstractBlock clone = (AbstractBlock) super.clone();
    clone.bounds = (Rectangle2D) ShapeUtilities.clone(this.bounds);
    if (this.frame instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.frame;
        clone.frame = (BlockFrame) pc.clone();
    }
    return clone;
}
Also used : PublicCloneable(org.jfree.util.PublicCloneable)

Example 14 with PublicCloneable

use of org.jfree.util.PublicCloneable in project SIMVA-SoS by SESoS.

the class XYShapeRenderer method clone.

/**
 * Returns a clone of this renderer.
 *
 * @return A clone of this renderer.
 *
 * @throws CloneNotSupportedException if there is a problem creating the
 *     clone.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    XYShapeRenderer clone = (XYShapeRenderer) super.clone();
    if (this.paintScale instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.paintScale;
        clone.paintScale = (PaintScale) pc.clone();
    }
    return clone;
}
Also used : PublicCloneable(org.jfree.util.PublicCloneable)

Example 15 with PublicCloneable

use of org.jfree.util.PublicCloneable in project SIMVA-SoS by SESoS.

the class PolarPlot method clone.

/**
 * Returns a clone of the plot.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException  this can occur if some component of
 *         the plot cannot be cloned.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    PolarPlot clone = (PolarPlot) super.clone();
    clone.axes = (ObjectList) ObjectUtilities.clone(this.axes);
    for (int i = 0; i < this.axes.size(); i++) {
        ValueAxis axis = (ValueAxis) this.axes.get(i);
        if (axis != null) {
            ValueAxis clonedAxis = (ValueAxis) axis.clone();
            clone.axes.set(i, clonedAxis);
            clonedAxis.setPlot(clone);
            clonedAxis.addChangeListener(clone);
        }
    }
    // the datasets are not cloned, but listeners need to be added...
    clone.datasets = (ObjectList) ObjectUtilities.clone(this.datasets);
    for (int i = 0; i < clone.datasets.size(); ++i) {
        XYDataset d = getDataset(i);
        if (d != null) {
            d.addChangeListener(clone);
        }
    }
    clone.renderers = (ObjectList) ObjectUtilities.clone(this.renderers);
    for (int i = 0; i < this.renderers.size(); i++) {
        PolarItemRenderer renderer2 = (PolarItemRenderer) this.renderers.get(i);
        if (renderer2 instanceof PublicCloneable) {
            PublicCloneable pc = (PublicCloneable) renderer2;
            PolarItemRenderer rc = (PolarItemRenderer) pc.clone();
            clone.renderers.set(i, rc);
            rc.setPlot(clone);
            rc.addChangeListener(clone);
        }
    }
    clone.cornerTextItems = new ArrayList(this.cornerTextItems);
    return clone;
}
Also used : PublicCloneable(org.jfree.util.PublicCloneable) ValueAxis(org.jfree.chart.axis.ValueAxis) ArrayList(java.util.ArrayList) XYDataset(org.jfree.data.xy.XYDataset) PolarItemRenderer(org.jfree.chart.renderer.PolarItemRenderer) Point(java.awt.Point) Paint(java.awt.Paint)

Aggregations

PublicCloneable (org.jfree.util.PublicCloneable)18 BasicStroke (java.awt.BasicStroke)5 Test (org.junit.Test)4 Stroke (java.awt.Stroke)2 Paint (java.awt.Paint)1 Point (java.awt.Point)1 Rectangle2D (java.awt.geom.Rectangle2D)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1 ValueAxis (org.jfree.chart.axis.ValueAxis)1 PolarItemRenderer (org.jfree.chart.renderer.PolarItemRenderer)1 XYDataset (org.jfree.data.xy.XYDataset)1