Java Code Examples for org.jfree.chart.axis.ValueAxis#setPlot()

The following examples show how to use org.jfree.chart.axis.ValueAxis#setPlot() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XYPlot.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
/**
 * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRangeAxis(int)
 */
public void setRangeAxis(int index, ValueAxis axis, boolean notify) {
    ValueAxis existing = getRangeAxis(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    if (axis != null) {
        axis.setPlot(this);
    }
    this.rangeAxes.set(index, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 2
Source File: Cardumen_0082_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 *
 * @see #getRangeAxis(int)
 */
public void setRangeAxis(int index, ValueAxis axis, boolean notify) {
    ValueAxis existing = getRangeAxis(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    if (axis != null) {
        axis.setPlot(this);
    }
    this.rangeAxes.set(index, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    if (notify) {
        fireChangeEvent();
    }
}
 
Example 3
Source File: XYPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Sets the range axis for the plot and sends a {@link PlotChangeEvent} to
 * all registered listeners.
 *
 * @param axis  the axis (<code>null</code> permitted).
 *
 * @see #getRangeAxis()
 * @see #setRangeAxis(int, ValueAxis)
 */
public void setRangeAxis(ValueAxis axis)  {
    if (axis != null) {
        axis.setPlot(this);
    }
    // plot is likely registered as a listener with the existing axis...
    ValueAxis existing = getRangeAxis();
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    this.rangeAxes.put(0, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    fireChangeEvent();
}
 
Example 4
Source File: 1_XYPlot.java    From SimFix with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRangeAxis(int)
 */
public void setRangeAxis(int index, ValueAxis axis, boolean notify) {
    ValueAxis existing = getRangeAxis(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    if (axis != null) {
        axis.setPlot(this);
    }
    this.rangeAxes.set(index, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    if (notify) {
        fireChangeEvent();
    }
}
 
Example 5
Source File: Chart_14_XYPlot_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRangeAxis(int)
 */
public void setRangeAxis(int index, ValueAxis axis, boolean notify) {
    ValueAxis existing = getRangeAxis(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    if (axis != null) {
        axis.setPlot(this);
    }
    this.rangeAxes.set(index, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    if (notify) {
        fireChangeEvent();
    }
}
 
Example 6
Source File: JGenProg2017_0081_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis.
 * @param notify  notify listeners?
 */
public void setRangeAxis(int index, ValueAxis axis, boolean notify) {
    ValueAxis existing = (ValueAxis) this.rangeAxes.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    if (axis != null) {
        axis.setPlot(this);
    }
    this.rangeAxes.set(index, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 7
Source File: JGenProg2017_005_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to 
 * all registered listeners.
 *
 * @param index  the axis index.
 * @param axis  the axis.
 * @param notify  notify listeners?
 */
public void setRangeAxis(int index, ValueAxis axis, boolean notify) {
    ValueAxis existing = (ValueAxis) this.rangeAxes.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    if (axis != null) {
        axis.setPlot(this);
    }
    this.rangeAxes.set(index, axis);
    if (axis != null) {
        axis.configure();
        axis.addChangeListener(this);
    }
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 8
Source File: ContourPlot.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs a contour plot with the specified axes (other attributes take
 * default values).
 *
 * @param dataset  The dataset.
 * @param domainAxis  The domain axis.
 * @param rangeAxis  The range axis.
 * @param colorBar  The z-axis axis.
*/
public ContourPlot(ContourDataset dataset,
                   ValueAxis domainAxis, ValueAxis rangeAxis,
                   ColorBar colorBar) {

    super();

    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.domainAxis = domainAxis;
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }

    this.rangeAxis = rangeAxis;
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }

    this.colorBar = colorBar;
    if (colorBar != null) {
        colorBar.getAxis().setPlot(this);
        colorBar.getAxis().addChangeListener(this);
        colorBar.configure(this);
    }
    this.colorBarLocation = RectangleEdge.LEFT;

    this.toolTipGenerator = new StandardContourToolTipGenerator();

}
 
Example 9
Source File: ThermometerPlot.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets the range axis for the plot and sends a {@link PlotChangeEvent} to
 * all registered listeners.
 *
 * @param axis  the new axis (<code>null</code> not permitted).
 *
 * @see #getRangeAxis()
 */
public void setRangeAxis(ValueAxis axis) {
    ParamChecks.nullNotPermitted(axis, "axis");
    // plot is registered as a listener with the existing axis...
    this.rangeAxis.removeChangeListener(this);

    axis.setPlot(this);
    axis.addChangeListener(this);
    this.rangeAxis = axis;
    fireChangeEvent();
}
 
Example 10
Source File: ContourPlot.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Constructs a contour plot with the specified axes (other attributes take
 * default values).
 *
 * @param dataset  The dataset.
 * @param domainAxis  The domain axis.
 * @param rangeAxis  The range axis.
 * @param colorBar  The z-axis axis.
*/
public ContourPlot(ContourDataset dataset,
                   ValueAxis domainAxis, ValueAxis rangeAxis,
                   ColorBar colorBar) {

    super();

    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.domainAxis = domainAxis;
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }

    this.rangeAxis = rangeAxis;
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }

    this.colorBar = colorBar;
    if (colorBar != null) {
        colorBar.getAxis().setPlot(this);
        colorBar.getAxis().addChangeListener(this);
        colorBar.configure(this);
    }
    this.colorBarLocation = RectangleEdge.LEFT;

    this.toolTipGenerator = new StandardContourToolTipGenerator();

}
 
Example 11
Source File: Nopol2017_005_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Provides serialization support.
 *
 * @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.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.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++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}
 
Example 12
Source File: Cardumen_00243_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 13
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 14
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Provides serialization support.
 *
 * @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.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.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++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}
 
Example 15
Source File: CategoryPlot.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new HashMap<Integer, CategoryAxis>();
    this.domainAxisLocations = new HashMap<Integer, AxisLocation>();
    this.rangeAxes = new HashMap<Integer, ValueAxis>();
    this.rangeAxisLocations = new HashMap<Integer, AxisLocation>();

    this.datasetToDomainAxesMap = new TreeMap();
    this.datasetToRangeAxesMap = new TreeMap();

    this.renderers = new HashMap<Integer, CategoryItemRenderer>();

    this.datasets = new HashMap<Integer, CategoryDataset>();
    this.datasets.put(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;
    this.domainAxisLocations.put(0, AxisLocation.BOTTOM_OR_LEFT);
    this.rangeAxisLocations.put(0, AxisLocation.TOP_OR_LEFT);

    this.renderers.put(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.put(0, domainAxis);
    mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.put(0, rangeAxis);
    mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }

    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeZeroBaselineVisible = false;
    this.rangeZeroBaselinePaint = Color.black;
    this.rangeZeroBaselineStroke = new BasicStroke(0.5f);

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeMinorGridlinesVisible = false;
    this.rangeMinorGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeMinorGridlinePaint = Color.white;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    this.anchorValue = 0.0;

    this.domainCrosshairVisible = false;
    this.domainCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.domainCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;

    this.annotations = new java.util.ArrayList();

    this.rangePannable = false;
    this.shadowGenerator = null;
}
 
Example 16
Source File: jMutRepair_0021_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Provides serialization support.
 *
 * @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.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.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++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}
 
Example 17
Source File: Chart_14_XYPlot_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot with the specified dataset, axes and renderer.  Any
 * of the arguments can be <code>null</code>, but in that case you should
 * take care to specify the value before using the plot (otherwise a
 * <code>NullPointerException</code> may be thrown).
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the renderer (<code>null</code> permitted).
 */
public XYPlot(XYDataset dataset,
              ValueAxis domainAxis,
              ValueAxis rangeAxis,
              XYItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;
    this.weight = 1;  // only relevant when this is a subplot
    this.axisOffset = new RectangleInsets(4.0, 4.0, 4.0, 4.0);

    // allocate storage for datasets, axes and renderers (all optional)
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();

    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    this.datasets = new ObjectList();
    this.renderers = new ObjectList();

    this.datasetToDomainAxisMap = new TreeMap();
    this.datasetToRangeAxisMap = new TreeMap();

    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.domainAxisLocations.set(0, AxisLocation.BOTTOM_OR_LEFT);

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    this.rangeAxisLocations.set(0, AxisLocation.BOTTOM_OR_LEFT);

    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = true;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.domainZeroBaselineVisible = false;
    this.domainZeroBaselinePaint = Color.black;
    this.domainZeroBaselineStroke = new BasicStroke(0.5f);

    this.rangeGridlinesVisible = true;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeZeroBaselineVisible = false;
    this.rangeZeroBaselinePaint = Color.black;
    this.rangeZeroBaselineStroke = new BasicStroke(0.5f);

    this.domainCrosshairVisible = false;
    this.domainCrosshairValue = 0.0;
    this.domainCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.domainCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;

    this.rangeCrosshairVisible = false;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;

    this.annotations = new java.util.ArrayList();

}
 
Example 18
Source File: jMutRepair_001_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Provides serialization support.
 *
 * @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.rangeCrosshairStroke = SerialUtilities.readStroke(stream);
    this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);

    for (int i = 0; i < this.domainAxes.size(); i++) {
        CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(i);
        if (xAxis != null) {
            xAxis.setPlot(this);
            xAxis.addChangeListener(this);
        }
    } 
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(i);
        if (yAxis != null) {
            yAxis.setPlot(this);   
            yAxis.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++) {
        CategoryItemRenderer renderer 
            = (CategoryItemRenderer) this.renderers.get(i);
        if (renderer != null) {
            renderer.addChangeListener(this);
        }
    }

}
 
Example 19
Source File: Chart_14_CategoryPlot_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = new RectangleInsets(4.0, 4.0, 4.0, 4.0);

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 20
Source File: jMutRepair_001_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}