schmitzm.jfree.chart.renderer
Class SelectionXYLineAndShapeRenderer

java.lang.Object
  extended by XYLineAndShapeRenderer
      extended by schmitzm.jfree.chart.renderer.SelectionXYLineAndShapeRenderer
All Implemented Interfaces:
SelectionRenderer<SeriesDatasetSelectionModel>, DatasetSelectionModelProvider<SeriesDatasetSelectionModel>

Deprecated. This class is not used anymore because the selection rendering is no longer realized by the origin dataset renderer (e.g. because the selected data items should be rendered in the foregound!). Instead the SelectableChartPanel inserts explicit renderers to the plot to draw only the selected data items highlighted.

public class SelectionXYLineAndShapeRenderer
extends XYLineAndShapeRenderer
implements SelectionRenderer<SeriesDatasetSelectionModel>

Extends the XYLineAndShapeRenderer with the SelectionRenderer functionality. Additionally redefines the drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int) method to realize the highlight rendering of the selected items.
Note:
An adequate SeriesDatasetSelectionModel is automatically created when a new Plot is set. Manually calling setSelectionModel(SeriesDatasetSelectionModel) is usually not necessary. Overwrite createAndSetSelectionModel() to avoid this behavior.
If no selection model is set, the behavior of this renderer is exactly like the super class.

Author:
Martin Schmitz

Field Summary
protected  Logger LOGGER
          Deprecated. Used for log and debug messages.
protected  SeriesDatasetSelectionModel selectionModel
          Deprecated. Holds the selection model, the renderer uses to determine whether a data item is selected or not.
protected  Map<Integer,Paint> selectionPaint
          Deprecated. Holds the selection color for each series.
 
Constructor Summary
SelectionXYLineAndShapeRenderer()
          Deprecated. Creates a new renderer.
SelectionXYLineAndShapeRenderer(boolean lines, boolean shapes)
          Deprecated. Creates a new renderer.
 
Method Summary
 void createAndSetSelectionModel()
          Deprecated. Creates and sets an adequate SeriesDatasetSelectionModel according to the Dataset of the current Plot.
 SeriesDatasetSelectionModel createSelectionModel(Dataset dataset)
          Deprecated. Creates an adequate SeriesDatasetSelectionModel according to the given Dataset.
 void drawItem(Graphics2D g, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
          Deprecated. Sets the rendering color (temporary for the rendering process) to the highlight color, if the item is defined as selected (by the selection model).
 SeriesDatasetSelectionModel getSelectionModel()
          Deprecated. Returns the selection model the renderer uses to determine whether a data item is selected or not.
 Paint getSelectionPaint()
          Deprecated. Returns the color, the selected data of the primary series is rendered with.
 Paint getSelectionPaint(int series)
          Deprecated. Returns the color, the selected data is rendered with.
protected  void init()
          Deprecated. Called by every constructor to initialize the extensions of this renderer.
 void setPlot(XYPlot plot)
          Deprecated. Creates and sets a new SeriesDatasetSelectionModel, if no selection model is set yet, or the selection model's dataset differs from the dataset of the new plot.
 void setSelectionModel(SeriesDatasetSelectionModel model)
          Deprecated. Sets the selection model the renderer uses to determine whether a data item is selected or not.
 void setSelectionPaint(int series, Paint paint)
          Deprecated. Sets the color, the selected data is rendered with.
 void setSelectionPaint(Paint paint)
          Deprecated. Sets the color, the selected data of the primary series is rendered with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface schmitzm.jfree.chart.selection.DatasetSelectionModelProvider
setSelectionModel
 

Field Detail

LOGGER

protected Logger LOGGER
Deprecated. 
Used for log and debug messages.


selectionModel

protected SeriesDatasetSelectionModel selectionModel
Deprecated. 
Holds the selection model, the renderer uses to determine whether a data item is selected or not.


selectionPaint

protected Map<Integer,Paint> selectionPaint
Deprecated. 
Holds the selection color for each series.

Constructor Detail

SelectionXYLineAndShapeRenderer

public SelectionXYLineAndShapeRenderer()
Deprecated. 
Creates a new renderer.


SelectionXYLineAndShapeRenderer

public SelectionXYLineAndShapeRenderer(boolean lines,
                                       boolean shapes)
Deprecated. 
Creates a new renderer.

Parameters:
lines - indicates whether lines are rendered between the data points
shapes - indicates whether shapes are rendered under the data line
Method Detail

init

protected void init()
Deprecated. 
Called by every constructor to initialize the extensions of this renderer.


setSelectionModel

public void setSelectionModel(SeriesDatasetSelectionModel model)
Deprecated. 
Sets the selection model the renderer uses to determine whether a data item is selected or not.

Parameters:
model - the selection model

getSelectionModel

public SeriesDatasetSelectionModel getSelectionModel()
Deprecated. 
Returns the selection model the renderer uses to determine whether a data item is selected or not.

Specified by:
getSelectionModel in interface DatasetSelectionModelProvider<SeriesDatasetSelectionModel>

createAndSetSelectionModel

public void createAndSetSelectionModel()
Deprecated. 
Creates and sets an adequate SeriesDatasetSelectionModel according to the Dataset of the current Plot. Automatically called by setPlot(XYPlot).
Sets the selection model to null if the renderer is not connected to a plot or the plot contains no dataset.

See Also:
#createSelectionModel(XYDataset)

createSelectionModel

public SeriesDatasetSelectionModel createSelectionModel(Dataset dataset)
Deprecated. 
Creates an adequate SeriesDatasetSelectionModel according to the given Dataset. Subclasses can overwrite this method to create an alternative SeriesDatasetSelectionModel.

Specified by:
createSelectionModel in interface DatasetSelectionModelProvider<SeriesDatasetSelectionModel>
Parameters:
dataset - a dataset

getSelectionPaint

public Paint getSelectionPaint()
Deprecated. 
Returns the color, the selected data of the primary series is rendered with.

Specified by:
getSelectionPaint in interface SelectionRenderer<SeriesDatasetSelectionModel>
Returns:
null if no selection color is defined for the series

setSelectionPaint

public void setSelectionPaint(Paint paint)
Deprecated. 
Sets the color, the selected data of the primary series is rendered with.

Specified by:
setSelectionPaint in interface SelectionRenderer<SeriesDatasetSelectionModel>
Parameters:
paint - color for the selected data

getSelectionPaint

public Paint getSelectionPaint(int series)
Deprecated. 
Returns the color, the selected data is rendered with.

Parameters:
series - the data series
Returns:
null if no selection color is defined for the series

setSelectionPaint

public void setSelectionPaint(int series,
                              Paint paint)
Deprecated. 
Sets the color, the selected data is rendered with.

Parameters:
series - the data series
paint - color for the selected data

setPlot

public void setPlot(XYPlot plot)
Deprecated. 
Creates and sets a new SeriesDatasetSelectionModel, if no selection model is set yet, or the selection model's dataset differs from the dataset of the new plot.

Parameters:
plot - the plot rendered by this renderer

drawItem

public void drawItem(Graphics2D g,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass)
Deprecated. 
Sets the rendering color (temporary for the rendering process) to the highlight color, if the item is defined as selected (by the selection model).