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