Search in sources :

Example 16 with PublicCloneable

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

the class ChartRenderingInfo method clone.

/**
 * Returns a clone of this object.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException if the object cannot be cloned.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    ChartRenderingInfo clone = (ChartRenderingInfo) super.clone();
    if (this.chartArea != null) {
        clone.chartArea = (Rectangle2D) this.chartArea.clone();
    }
    if (this.entities instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.entities;
        clone.entities = (EntityCollection) pc.clone();
    }
    return clone;
}
Also used : PublicCloneable(org.jfree.util.PublicCloneable)

Example 17 with PublicCloneable

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

the class LegendItem method clone.

/**
 * Returns an independent copy of this object (except that the clone will
 * still reference the same dataset as the original
 * <code>LegendItem</code>).
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException if the legend item cannot be cloned.
 *
 * @since 1.0.10
 */
@Override
public Object clone() throws CloneNotSupportedException {
    LegendItem clone = (LegendItem) super.clone();
    if (this.seriesKey instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.seriesKey;
        clone.seriesKey = (Comparable) pc.clone();
    }
    // FIXME: Clone the attributed string if it is not null
    clone.shape = ShapeUtilities.clone(this.shape);
    if (this.fillPaintTransformer instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.fillPaintTransformer;
        clone.fillPaintTransformer = (GradientPaintTransformer) pc.clone();
    }
    clone.line = ShapeUtilities.clone(this.line);
    return clone;
}
Also used : PublicCloneable(org.jfree.util.PublicCloneable)

Example 18 with PublicCloneable

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

the class AbstractXYItemRenderer method clone.

/**
 * Returns a clone of the renderer.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException if the renderer does not support
 *         cloning.
 */
@Override
protected Object clone() throws CloneNotSupportedException {
    AbstractXYItemRenderer clone = (AbstractXYItemRenderer) super.clone();
    if (this.itemLabelGenerator != null && this.itemLabelGenerator instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.itemLabelGenerator;
        clone.itemLabelGenerator = (XYItemLabelGenerator) pc.clone();
    }
    clone.itemLabelGeneratorMap = CloneUtils.cloneMapValues(this.itemLabelGeneratorMap);
    if (this.baseItemLabelGenerator != null && this.baseItemLabelGenerator instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.baseItemLabelGenerator;
        clone.baseItemLabelGenerator = (XYItemLabelGenerator) pc.clone();
    }
    if (this.toolTipGenerator != null && this.toolTipGenerator instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.toolTipGenerator;
        clone.toolTipGenerator = (XYToolTipGenerator) pc.clone();
    }
    clone.toolTipGeneratorMap = CloneUtils.cloneMapValues(this.toolTipGeneratorMap);
    if (this.baseToolTipGenerator != null && this.baseToolTipGenerator instanceof PublicCloneable) {
        PublicCloneable pc = (PublicCloneable) this.baseToolTipGenerator;
        clone.baseToolTipGenerator = (XYToolTipGenerator) pc.clone();
    }
    if (this.legendItemLabelGenerator instanceof PublicCloneable) {
        clone.legendItemLabelGenerator = (XYSeriesLabelGenerator) ObjectUtilities.clone(this.legendItemLabelGenerator);
    }
    if (this.legendItemToolTipGenerator instanceof PublicCloneable) {
        clone.legendItemToolTipGenerator = (XYSeriesLabelGenerator) ObjectUtilities.clone(this.legendItemToolTipGenerator);
    }
    if (this.legendItemURLGenerator instanceof PublicCloneable) {
        clone.legendItemURLGenerator = (XYSeriesLabelGenerator) ObjectUtilities.clone(this.legendItemURLGenerator);
    }
    clone.foregroundAnnotations = (List) ObjectUtilities.deepClone(this.foregroundAnnotations);
    clone.backgroundAnnotations = (List) ObjectUtilities.deepClone(this.backgroundAnnotations);
    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