Search in sources :

Example 1 with EventListenerList

use of javax.swing.event.EventListenerList in project SIMVA-SoS by SESoS.

the class AbstractAnnotation method clone.

/**
 * Returns a clone of the annotation. The cloned annotation will NOT
 * include the {@link AnnotationChangeListener} references that have been
 * registered with this annotation.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException  if the annotation does not support
 *                                     cloning.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    AbstractAnnotation clone = (AbstractAnnotation) super.clone();
    clone.listenerList = new EventListenerList();
    return clone;
}
Also used : EventListenerList(javax.swing.event.EventListenerList)

Example 2 with EventListenerList

use of javax.swing.event.EventListenerList in project SIMVA-SoS by SESoS.

the class JFreeChartInfo method clone.

/**
 * Clones the object, and takes care of listeners.
 * Note: caller shall register its own listeners on cloned graph.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException if the chart is not cloneable.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    JFreeChart chart = (JFreeChart) super.clone();
    chart.renderingHints = (RenderingHints) this.renderingHints.clone();
    if (this.title != null) {
        chart.title = (TextTitle) this.title.clone();
        chart.title.addChangeListener(chart);
    }
    chart.subtitles = new ArrayList();
    for (int i = 0; i < getSubtitleCount(); i++) {
        Title subtitle = (Title) getSubtitle(i).clone();
        chart.subtitles.add(subtitle);
        subtitle.addChangeListener(chart);
    }
    if (this.plot != null) {
        chart.plot = (Plot) this.plot.clone();
        chart.plot.addChangeListener(chart);
    }
    chart.progressListeners = new EventListenerList();
    chart.changeListeners = new EventListenerList();
    return chart;
}
Also used : ArrayList(java.util.ArrayList) EventListenerList(javax.swing.event.EventListenerList) Title(org.jfree.chart.title.Title) TextTitle(org.jfree.chart.title.TextTitle) LegendTitle(org.jfree.chart.title.LegendTitle) RectangleConstraint(org.jfree.chart.block.RectangleConstraint) Paint(java.awt.Paint)

Example 3 with EventListenerList

use of javax.swing.event.EventListenerList in project SIMVA-SoS by SESoS.

the class Axis method clone.

/**
 * Returns a clone of the axis.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException if some component of the axis does
 *         not support cloning.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    Axis clone = (Axis) super.clone();
    // It's up to the plot which clones up to restore the correct references
    clone.plot = null;
    clone.listenerList = new EventListenerList();
    return clone;
}
Also used : EventListenerList(javax.swing.event.EventListenerList)

Example 4 with EventListenerList

use of javax.swing.event.EventListenerList in project SIMVA-SoS by SESoS.

the class Title method clone.

/**
 * Returns a clone of the title.
 * <P>
 * One situation when this is useful is when editing the title properties -
 * you can edit a clone, and then it is easier to cancel the changes if
 * necessary.
 *
 * @return A clone of the title.
 *
 * @throws CloneNotSupportedException not thrown by this class, but it may
 *         be thrown by subclasses.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    Title duplicate = (Title) super.clone();
    duplicate.listenerList = new EventListenerList();
    // RectangleInsets is immutable => same reference in clone OK
    return duplicate;
}
Also used : EventListenerList(javax.swing.event.EventListenerList)

Example 5 with EventListenerList

use of javax.swing.event.EventListenerList in project SIMVA-SoS by SESoS.

the class Plot method clone.

/**
 * Creates a clone of the plot.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException if some component of the plot does not
 *         support cloning.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    Plot clone = (Plot) super.clone();
    // childs in combined plots instead
    if (this.datasetGroup != null) {
        clone.datasetGroup = (DatasetGroup) ObjectUtilities.clone(this.datasetGroup);
    }
    clone.drawingSupplier = (DrawingSupplier) ObjectUtilities.clone(this.drawingSupplier);
    clone.listenerList = new EventListenerList();
    return clone;
}
Also used : EventListenerList(javax.swing.event.EventListenerList)

Aggregations

EventListenerList (javax.swing.event.EventListenerList)21 Paint (java.awt.Paint)2 RectangleConstraint (org.jfree.chart.block.RectangleConstraint)2 WindowsTabbedPaneUI (com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI)1 RenderingHints (java.awt.RenderingHints)1 PropertyChangeSupport (java.beans.PropertyChangeSupport)1 VetoableChangeSupport (java.beans.VetoableChangeSupport)1 ArrayList (java.util.ArrayList)1 LegendTitle (org.jfree.chart.title.LegendTitle)1 TextTitle (org.jfree.chart.title.TextTitle)1 Title (org.jfree.chart.title.Title)1