Example usage for org.jfree.io SerialUtilities readPoint2D

List of usage examples for org.jfree.io SerialUtilities readPoint2D

Introduction

In this page you can find the example usage for org.jfree.io SerialUtilities readPoint2D.

Prototype

public static Point2D readPoint2D(final ObjectInputStream stream) throws IOException 

Source Link

Document

Reads a Point2D object that has been serialised by the #writePoint2D(Point2D,ObjectOutputStream) method.

Usage

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

/**
 * Provides serialization support.//w w  w  . j  a v  a 2s .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);
        }
    }

}