de.erichseifert.gral.plots.legends
Class ValueLegend
- java.lang.Object
-
- de.erichseifert.gral.graphics.AbstractDrawable
-
- de.erichseifert.gral.graphics.DrawableContainer
-
- de.erichseifert.gral.plots.legends.AbstractLegend
-
- de.erichseifert.gral.plots.legends.ValueLegend
-
- All Implemented Interfaces:
- DataListener, Container, Drawable, Legend, java.io.Serializable, java.lang.Iterable<Drawable>
- Direct Known Subclasses:
- BarPlot.BarPlotLegend, BoxPlot.BoxPlotLegend, PiePlot.PiePlotLegend
public abstract class ValueLegend extends AbstractLegend implements DataListener
A legend implementation that displays items for all data values of all data series that are added to the legend.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.erichseifert.gral.plots.legends.AbstractLegend
AbstractLegend.AbstractSymbol, AbstractLegend.Item
-
-
Constructor Summary
Constructors Constructor and Description ValueLegend()Initializes a new instance with default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(DataSource source)Adds the specified data source in order to display it.voiddataAdded(DataSource source, DataChangeEvent... events)Method that is invoked when data has been added.voiddataRemoved(DataSource source, DataChangeEvent... events)Method that is invoked when data has been removed.voiddataUpdated(DataSource source, DataChangeEvent... events)Method that is invoked when data has been updated.intgetLabelColumn()Returns the index of the column that contains the labels for the values.java.text.FormatgetLabelFormat()Returns the format used to display data values.voidremove(DataSource source)Removes the specified data source.voidsetLabelColumn(int labelColumn)Sets the index of the column that contains the labels for the values.voidsetLabelFormat(java.text.Format labelFormat)Sets the format used to display data values.-
Methods inherited from class de.erichseifert.gral.plots.legends.AbstractLegend
clear, contains, draw, getAlignmentX, getAlignmentY, getBackground, getBaseFont, getBorderColor, getBorderStroke, getFont, getGap, getOrientation, getSources, getSymbolSize, setAlignmentX, setAlignmentY, setBackground, setBaseFont, setBorderColor, setBorderStroke, setBounds, setFont, setGap, setOrientation, setSymbolSize
-
Methods inherited from class de.erichseifert.gral.graphics.DrawableContainer
add, add, contains, getConstraints, getDrawables, getDrawablesAt, getInsets, getLayout, getPreferredSize, iterator, layout, remove, setBounds, setInsets, setLayout, size
-
Methods inherited from class de.erichseifert.gral.graphics.AbstractDrawable
getBounds, getHeight, getWidth, getX, getY, setPosition
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.erichseifert.gral.graphics.Container
add, add, contains, getBounds, getConstraints, getDrawables, getDrawablesAt, getInsets, getLayout, layout, remove, setBounds, setInsets, setLayout, size
-
Methods inherited from interface de.erichseifert.gral.graphics.Drawable
getBounds, getHeight, getPreferredSize, getWidth, getX, getY, setBounds, setPosition
-
-
-
-
Method Detail
-
add
public void add(DataSource source)
Description copied from class:AbstractLegendAdds the specified data source in order to display it.- Specified by:
addin interfaceLegend- Overrides:
addin classAbstractLegend- Parameters:
source- data source to be added.
-
remove
public void remove(DataSource source)
Description copied from class:AbstractLegendRemoves the specified data source.- Specified by:
removein interfaceLegend- Overrides:
removein classAbstractLegend- Parameters:
source- Data source to be removed.
-
dataAdded
public void dataAdded(DataSource source, DataChangeEvent... events)
Method that is invoked when data has been added. This method is invoked by objects that provide support forDataListeners and should not be called manually.- Specified by:
dataAddedin interfaceDataListener- Parameters:
source- Data source that has been changed.events- Optional event object describing the data values that have been added.
-
dataUpdated
public void dataUpdated(DataSource source, DataChangeEvent... events)
Method that is invoked when data has been updated. This method is invoked by objects that provide support forDataListeners and should not be called manually.- Specified by:
dataUpdatedin interfaceDataListener- Parameters:
source- Data source that has been changed.events- Optional event object describing the data values that have been updated.
-
dataRemoved
public void dataRemoved(DataSource source, DataChangeEvent... events)
Method that is invoked when data has been removed. This method is invoked by objects that provide support forDataListeners and should not be called manually.- Specified by:
dataRemovedin interfaceDataListener- Parameters:
source- Data source that has been changed.events- Optional event object describing the data values that have been removed.
-
getLabelColumn
public int getLabelColumn()
Returns the index of the column that contains the labels for the values.- Returns:
- Column index containing the labels.
-
setLabelColumn
public void setLabelColumn(int labelColumn)
Sets the index of the column that contains the labels for the values.- Parameters:
labelColumn- Column index containing the labels.
-
getLabelFormat
public java.text.Format getLabelFormat()
Returns the format used to display data values.- Returns:
- Format for data to label text conversion.
-
setLabelFormat
public void setLabelFormat(java.text.Format labelFormat)
Sets the format used to display data values.- Parameters:
labelFormat- Format for data to label text conversion.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG