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;
}
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);
}
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);
}
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);
}
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;
}
Aggregations