Java Code Examples for org.jfree.chart.renderer.category.CategoryItemRenderer#setPlot()

The following examples show how to use org.jfree.chart.renderer.category.CategoryItemRenderer#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: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 2
Source File: Cardumen_006_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 3
Source File: Nopol2017_005_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 4
Source File: Cardumen_00143_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 5
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 6
Source File: CategoryPlot.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Sets the renderer to use for the dataset with the specified index and,
 * if requested, sends a change event to all registered listeners.  Note 
 * that each dataset should have its own renderer, you should not use one 
 * renderer for multiple datasets.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 *
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer,
        boolean notify) {
    CategoryItemRenderer existing = this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    this.renderers.put(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    configureDomainAxes();
    configureRangeAxes();
    if (notify) {
        fireChangeEvent();
    }
}
 
Example 7
Source File: CategoryPlot.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 8
Source File: jMutRepair_0021_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 9
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 10
Source File: Chart_19_CategoryPlot_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 11
Source File: JGenProg2017_005_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 12
Source File: jMutRepair_0030_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(this));
    }
}
 
Example 13
Source File: CategoryPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Sets the renderer to use for the dataset with the specified index and,
 * if requested, sends a change event to all registered listeners.  Note 
 * that each dataset should have its own renderer, you should not use one 
 * renderer for multiple datasets.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 *
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer,
        boolean notify) {
    CategoryItemRenderer existing = this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    this.renderers.put(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    configureDomainAxes();
    configureRangeAxes();
    if (notify) {
        fireChangeEvent();
    }
}
 
Example 14
Source File: Cardumen_00243_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Sets a renderer.  A {@link PlotChangeEvent} is sent to all registered 
 * listeners.
 *
 * @param index  the index.
 * @param renderer  the renderer (<code>null</code> permitted).
 * @param notify  notify listeners?
 * 
 * @see #getRenderer(int)
 */
public void setRenderer(int index, CategoryItemRenderer renderer, 
                        boolean notify) {
    
    // stop listening to the existing renderer...
    CategoryItemRenderer existing 
        = (CategoryItemRenderer) this.renderers.get(index);
    if (existing != null) {
        existing.removeChangeListener(this);
    }
    
    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();
    
    if (notify) {
        notifyListeners(new PlotChangeEvent(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: jKali_001_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 17
Source File: jMutRepair_0021_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 18
Source File: Cardumen_00143_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 = 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 19
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 20
Source File: Chart_19_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();

}