Example usage for org.jfree.chart.axis Axis addChangeListener

List of usage examples for org.jfree.chart.axis Axis addChangeListener

Introduction

In this page you can find the example usage for org.jfree.chart.axis Axis addChangeListener.

Prototype

public void addChangeListener(AxisChangeListener listener) 

Source Link

Document

Registers an object for notification of changes to the axis.

Usage

From source file:ucar.unidata.idv.control.chart.MyXYPlot.java

/**
 * Provides serialization support.//from   w  ww.j  av  a2  s . c  o m
 *
 * @param stream  the input stream.
 *
 * @throws IOException  if there is an I/O error.
 * @throws ClassNotFoundException  if there is a classpath problem.
 */
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {

    stream.defaultReadObject();
    this.domainGridlineStroke = SerialUtilities.readStroke(stream);
    this.domainGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeGridlineStroke = SerialUtilities.readStroke(stream);
    this.rangeGridlinePaint = SerialUtilities.readPaint(stream);
    this.rangeZeroBaselineStroke = SerialUtilities.readStroke(stream);
    this.rangeZeroBaselinePaint = SerialUtilities.readPaint(stream);
    this.domainCrosshairStroke = SerialUtilities.readStroke(stream);
    this.domainCrosshairPaint = SerialUtilities.readPaint(stream);
    this.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);
    this.domainTickBandPaint = SerialUtilities.readPaint(stream);
    this.rangeTickBandPaint = SerialUtilities.readPaint(stream);
    this.quadrantOrigin = SerialUtilities.readPoint2D(stream);
    this.quadrantPaint = new Paint[4];
    for (int i = 0; i < 4; i++) {
        this.quadrantPaint[i] = SerialUtilities.readPaint(stream);
    }

    // register the plot as a listener with its axes, datasets, and 
    // renderers...
    int domainAxisCount = this.domainAxes.size();
    for (int i = 0; i < domainAxisCount; i++) {
        Axis axis = (Axis) this.domainAxes.get(i);
        if (axis != null) {
            axis.setPlot(this);
            axis.addChangeListener(this);
        }
    }
    int rangeAxisCount = this.rangeAxes.size();
    for (int i = 0; i < rangeAxisCount; i++) {
        Axis axis = (Axis) this.rangeAxes.get(i);
        if (axis != null) {
            axis.setPlot(this);
            axis.addChangeListener(this);
        }
    }
    int datasetCount = this.datasets.size();
    for (int i = 0; i < datasetCount; i++) {
        Dataset dataset = (Dataset) this.datasets.get(i);
        if (dataset != null) {
            dataset.addChangeListener(this);
        }
    }
    int rendererCount = this.renderers.size();
    for (int i = 0; i < rendererCount; i++) {
        XYItemRenderer renderer = (XYItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}