|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.ChartPanel
schmitzm.jfree.chart.SelectableChartPanel
public class SelectableChartPanel
This class extends the org.jfree.chart.ChartPanel
with some new
functionalities.
Nested Class Summary | |
---|---|
static class |
SelectableChartPanel.WindowSelectionMode
Types of window selection on chart panel. |
Field Summary | |
---|---|
static ImageIcon |
ICON_ZOOM_TO_SELECTED
|
protected ChartMouseSelectionTracker |
selectionTracker
Listens to mouse window selection on the chart. |
protected SelectableChartPanel.WindowSelectionMode |
windowSelectionMode
Holds the behavior on window selection (Default: SelectableChartPanel.WindowSelectionMode.ZOOM_IN_CHART ). |
Constructor Summary | |
---|---|
SelectableChartPanel(JFreeChart chart)
Creates a new chart panel. |
|
SelectableChartPanel(JFreeChart chart,
boolean useBuffer)
Creates a new chart panel. |
|
SelectableChartPanel(JFreeChart chart,
boolean properties,
boolean save,
boolean print,
boolean zoom,
boolean tooltips)
Creates a new chart panel. |
|
SelectableChartPanel(JFreeChart chart,
int width,
int height,
int minimumDrawWidth,
int minimumDrawHeight,
int maximumDrawWidth,
int maximumDrawHeight,
boolean useBuffer,
boolean properties,
boolean save,
boolean print,
boolean zoom,
boolean tooltips)
Creates a new chart panel. |
Method Summary | ||
---|---|---|
protected
|
applyRendererPropertiesToSelectionRenderer(Dataset dataset,
AbstractRenderer originRenderer,
AbstractRenderer selRenderer)
Applies some rendering properties to the (new) selection renderer. |
|
void |
chartChanged(ChartChangeEvent e)
If a new dataset is added this method updates the selection renderers. |
|
protected SelectionRenderer<?> |
createSelectionRenderer(Dataset dataset)
Creates an adequate selection renderer for a dataset. |
|
SelectableChartPanel.WindowSelectionMode |
getWindowSelectionMode()
Returns the behavior of the chart panel on window selections via mouse. |
|
protected void |
init()
Called by every constructor to initialize the extensions of this panel. |
|
void |
mouseDragged(MouseEvent e)
Ignores the event if the window selection mode is not SelectableChartPanel.WindowSelectionMode.ZOOM_IN_CHART , to avoid conflicts between the two
listeners. |
|
void |
mouseMoved(MouseEvent e)
Ignores the event if the window selection mode is not SelectableChartPanel.WindowSelectionMode.ZOOM_IN_CHART , to avoid conflicts between the two
listeners. |
|
void |
refresh()
Repaints the chart. |
|
void |
setChart(JFreeChart chart)
After setting a new chart the zoom relevant properties are reset according to the new chart. |
|
void |
setWindowSelectionMode(SelectableChartPanel.WindowSelectionMode mode)
Sets the behavior of the chart panel on window selections via mouse. |
|
protected void |
updateSelectionRenderers()
This methods creates a SelectionRenderer for each Dataset
in the plot to realize the highlight of the selected items. |
|
protected void |
updateStatesForWindowSelectionMode()
Configures the zoomable properties and selectionTracker
according to the current windowSelectionMode . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ImageIcon ICON_ZOOM_TO_SELECTED
protected SelectableChartPanel.WindowSelectionMode windowSelectionMode
SelectableChartPanel.WindowSelectionMode.ZOOM_IN_CHART
).
protected ChartMouseSelectionTracker selectionTracker
Constructor Detail |
---|
public SelectableChartPanel(JFreeChart chart)
public SelectableChartPanel(JFreeChart chart, boolean useBuffer)
public SelectableChartPanel(JFreeChart chart, boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips)
public SelectableChartPanel(JFreeChart chart, int width, int height, int minimumDrawWidth, int minimumDrawHeight, int maximumDrawWidth, int maximumDrawHeight, boolean useBuffer, boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips)
Method Detail |
---|
protected void init()
public void refresh()
public void setWindowSelectionMode(SelectableChartPanel.WindowSelectionMode mode)
mode
- new selection modepublic SelectableChartPanel.WindowSelectionMode getWindowSelectionMode()
selectionMode
- new selection modepublic void setChart(JFreeChart chart)
windowSelectionMode
to keep its functionality remaining.
updateStatesForWindowSelectionMode()
protected void updateStatesForWindowSelectionMode()
selectionTracker
according to the current windowSelectionMode
.
protected void updateSelectionRenderers()
SelectionRenderer
for each Dataset
in the plot to realize the highlight of the selected items.
protected SelectionRenderer<?> createSelectionRenderer(Dataset dataset)
FeatureSeriesDatasetSelectionModel
)
for special purposes.
dataset
- a dataset
SelectionRenderer
the returned object must be
an AbstractRenderer
protected <E> void applyRendererPropertiesToSelectionRenderer(Dataset dataset, AbstractRenderer originRenderer, AbstractRenderer selRenderer)
dataset
- the dataset for the selection rendereroriginRenderer
- the origin renderer for the dataset (should not
be changed!)selRenderer
- the selection renderer to apply the properties topublic void chartChanged(ChartChangeEvent e)
public void mouseDragged(MouseEvent e)
SelectableChartPanel.WindowSelectionMode.ZOOM_IN_CHART
, to avoid conflicts between the two
listeners.
public void mouseMoved(MouseEvent e)
SelectableChartPanel.WindowSelectionMode.ZOOM_IN_CHART
, to avoid conflicts between the two
listeners.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |