Example usage for org.jfree.chart.plot DrawingSupplier getNextShape

List of usage examples for org.jfree.chart.plot DrawingSupplier getNextShape

Introduction

In this page you can find the example usage for org.jfree.chart.plot DrawingSupplier getNextShape.

Prototype

public Shape getNextShape();

Source Link

Document

Returns the next Shape object in a sequence maintained by the supplier.

Usage

From source file:edu.ucla.stat.SOCR.chart.demo.SOCR_EM_MixtureModelChartDemo.java

public void init() {
    CLEAR_BUTTON = false;//from  w w  w  .java2 s.  co  m
    LEGEND_SWITCH = false;
    //DefaultDrawingSupplier supplier = new DefaultDrawingSupplier();
    DrawingSupplier supplier = new DefaultDrawingSupplier(DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    //series_shapes = supplier.createStandardSeriesShapes();

    //color_mainGroup = supplier.getNextPaint(); //moved to EM
    for (int i = 0; i < 10; i++) {
        //color_kernels[i] = supplier.getNextPaint();
        //series_strokes[i] = supplier.getNextStroke();
        series_shapes[i] = supplier.getNextShape();
    }

    series_strokes[0] = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL);

    series_strokes[1] = new BasicStroke(2.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL);

    series_strokes[2] = new BasicStroke(3.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL);

    series_strokes[3] = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 10.0f, 6.0f }, 0.0f);
    series_strokes[4] = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 10.0f, 6.0f }, 0.0f);

    series_strokes[5] = new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 10.0f, 6.0f }, 0.0f);
    series_strokes[6] = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 6.0f, 6.0f }, 0.0f);
    series_strokes[7] = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 6.0f, 6.0f }, 0.0f);
    series_strokes[8] = new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 6.0f, 6.0f }, 0.0f);

    series_strokes[9] = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f,
            new float[] { 2.0f, 6.0f }, 0.0f);

    controlPanel = new JPanel();
    modelAllSelected = TOGETHER;
    num_series = 1;
    mEMexperiment = new MixtureEMExperiment[num_series];
    mEMexperiment[0] = new MixtureEMExperiment();
    resultsTables = new CustomJTable[num_series];
    resultsTables[0] = mEMexperiment[0].getResultsTable();

    initControlPanel();
    //initResutlsTable();
    SHOW_STATUS_TEXTAREA = false;

    super.init();

    indLabel = new JLabel("X");
    depLabel = new JLabel("Y");

    mEMexperiment[0].resetSize();

    packControlArea();
}

From source file:KIDLYAbstractRenderer.java

/**
 * Returns a shape used to represent the items in a series.
 *
 * @param series  the series (zero-based index).
 *
 * @return The shape (never <code>null</code>).
 *
 * @since 1.0.6//  w  w w  .  j ava2s. c  o m
 */
public Shape lookupSeriesShape(int series) {

    // return the override, if there is one...
    if (this.shape != null) {
        return this.shape;
    }

    // otherwise look up the shape list
    Shape result = getSeriesShape(series);
    if (result == null && this.autoPopulateSeriesShape) {
        DrawingSupplier supplier = getDrawingSupplier();
        if (supplier != null) {
            result = supplier.getNextShape();
            setSeriesShape(series, result, false);
        }
    }
    if (result == null) {
        result = this.baseShape;
    }
    return result;

}