Search in sources :

Example 6 with PublicCloneable

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

the class XYBlockRenderer 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 {
    XYBlockRenderer clone = (XYBlockRenderer) 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 7 with PublicCloneable

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

the class CategoryLineAnnotationTest method testPublicCloneable.

/**
 * Checks that this class implements PublicCloneable.
 */
@Test
public void testPublicCloneable() {
    CategoryLineAnnotation a1 = new CategoryLineAnnotation("Category 1", 1.0, "Category 2", 2.0, Color.red, new BasicStroke(1.0f));
    assertTrue(a1 instanceof PublicCloneable);
}
Also used : BasicStroke(java.awt.BasicStroke) PublicCloneable(org.jfree.util.PublicCloneable) Test(org.junit.Test)

Example 8 with PublicCloneable

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

the class XYBoxAnnotationTest method testPublicCloneable.

/**
 * Checks that this class implements PublicCloneable.
 */
public void testPublicCloneable() {
    XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue);
    assertTrue(a1 instanceof PublicCloneable);
}
Also used : BasicStroke(java.awt.BasicStroke) PublicCloneable(org.jfree.util.PublicCloneable)

Example 9 with PublicCloneable

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

the class XYShapeAnnotationTest method testPublicCloneable.

/**
 * Checks that this class implements PublicCloneable.
 */
@Test
public void testPublicCloneable() {
    XYShapeAnnotation a1 = new XYShapeAnnotation(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0), new BasicStroke(1.2f), Color.red, Color.blue);
    assertTrue(a1 instanceof PublicCloneable);
}
Also used : BasicStroke(java.awt.BasicStroke) PublicCloneable(org.jfree.util.PublicCloneable) Rectangle2D(java.awt.geom.Rectangle2D) Test(org.junit.Test)

Example 10 with PublicCloneable

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

the class KeyedObject method clone.

/**
 * Returns a clone of this object.  It is assumed that the key is an
 * immutable object, so it is not deep-cloned.  The object is deep-cloned
 * if it implements {@link PublicCloneable}, otherwise a shallow clone is
 * made.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException if there is a problem cloning.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    KeyedObject clone = (KeyedObject) super.clone();
    if (this.object instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.object;
        clone.object = pc.clone();
    }
    return clone;
}
Also used : PublicCloneable(org.jfree.util.PublicCloneable)

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