com.odesys.chart
Class LegendView
java.lang.Object
|
+--com.odesys.chart.ChartView
|
+--com.odesys.chart.LegendView
- Direct Known Subclasses:
- LineLegendView
- public class LegendView
- extends ChartView
LegendView is a ChartView subclass that draws a Legend based on the Series
of its ChartModel.
Constructor Summary |
LegendView(Chart chart)
Creates a new LegendView instance for the specified Chart. |
Method Summary |
LegendItem |
createLegendItem(Series series)
Factory method that creates a LegendItem for this LegendView and the
specified Series. |
java.awt.Dimension |
getPreferredSize()
Calculates the size needed by this LegendView to show its content. |
void |
paint(java.awt.Graphics g)
Draws this LegendView in the specified Graphics context |
void |
setModel(ChartModel model)
Sets the ChartModel of this LegendView |
void |
updateAggregates()
Updates the aggregate values for this chart (min or max values etc.). |
void |
updateDrawables()
Updates all visible elements of this ChartView. |
Methods inherited from class com.odesys.chart.ChartView |
getBackground, getFont, getForeground, isAutoScaleToFit, isContoursVisible, isLabelsVisible, location, repaint, reshape, setAutoScaleToFit, setBackground, setContoursVisible, setFont, setForeground, setLabelsVisible, size |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LegendView
public LegendView(Chart chart)
- Creates a new LegendView instance for the specified Chart.
setModel
public void setModel(ChartModel model)
- Sets the ChartModel of this LegendView
- Overrides:
setModel
in class ChartView
updateDrawables
public void updateDrawables()
- Description copied from class:
ChartView
- Updates all visible elements of this ChartView. Usually called automatically
when the parameters are changed.
- Overrides:
updateDrawables
in class ChartView
updateAggregates
public void updateAggregates()
- Description copied from class:
ChartView
- Updates the aggregate values for this chart (min or max values etc.).
Called automatically when a value in the model is changed.
- Overrides:
updateAggregates
in class ChartView
getPreferredSize
public java.awt.Dimension getPreferredSize()
- Calculates the size needed by this LegendView to show its content.
- Overrides:
getPreferredSize
in class ChartView
paint
public void paint(java.awt.Graphics g)
- Draws this LegendView in the specified Graphics context
- Overrides:
paint
in class ChartView
createLegendItem
public LegendItem createLegendItem(Series series)
- Factory method that creates a LegendItem for this LegendView and the
specified Series. This implementation returns a LegendItem instance.