public abstract class ValueLegend extends AbstractLegend implements DataListener
AbstractLegend.AbstractSymbol, AbstractLegend.Item
Constructor and Description |
---|
ValueLegend()
Initializes a new instance with default values.
|
Modifier and Type | Method and Description |
---|---|
void |
add(DataSource source)
Adds the specified data source in order to display it.
|
void |
dataAdded(DataSource source,
DataChangeEvent... events)
Method that is invoked when data has been added.
|
void |
dataRemoved(DataSource source,
DataChangeEvent... events)
Method that is invoked when data has been removed.
|
void |
dataUpdated(DataSource source,
DataChangeEvent... events)
Method that is invoked when data has been updated.
|
protected java.lang.Iterable<Row> |
getEntries(DataSource source)
Returns a sequence of items for the specified data source that should be
added to the legend.
|
protected java.lang.String |
getLabel(Row row)
Returns the label text for the specified row.
|
int |
getLabelColumn()
Returns the index of the column that contains the labels for the values.
|
java.text.Format |
getLabelFormat()
Returns the format used to display data values.
|
void |
remove(DataSource source)
Removes the specified data source.
|
void |
setLabelColumn(int labelColumn)
Sets the index of the column that contains the labels for the values.
|
void |
setLabelFormat(java.text.Format labelFormat)
Sets the format used to display data values.
|
clear, contains, draw, drawBackground, drawBorder, getAlignmentX, getAlignmentY, getBackground, getBorderColor, getBorderStroke, getFont, getGap, getOrientation, getSymbolSize, invalidate, isValid, refresh, refreshLayout, setAlignmentX, setAlignmentY, setBackground, setBorderColor, setBorderStroke, setBounds, setDrawableFonts, setFont, setGap, setOrientation, setSymbolSize
add, add, drawComponents, getConstraints, getDrawableAt, getInsets, getLayout, getPreferredSize, iterator, layout, remove, setBounds, setInsets, setLayout, size
getBounds, getHeight, getWidth, getX, getY
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, getBounds, getConstraints, getDrawableAt, getInsets, getLayout, layout, remove, setBounds, setInsets, setLayout, size
getBounds, getHeight, getPreferredSize, getWidth, getX, getY, setBounds
getSymbol
protected java.lang.Iterable<Row> getEntries(DataSource source)
AbstractLegend
getEntries
in class AbstractLegend
source
- Data source.protected java.lang.String getLabel(Row row)
AbstractLegend
getLabel
in class AbstractLegend
row
- Data row.public void add(DataSource source)
AbstractLegend
add
in interface Legend
add
in class AbstractLegend
source
- data source to be added.public void remove(DataSource source)
AbstractLegend
remove
in interface Legend
remove
in class AbstractLegend
source
- Data source to be removed.public void dataAdded(DataSource source, DataChangeEvent... events)
DataListener
s and should not be called manually.dataAdded
in interface DataListener
source
- Data source that has been changed.events
- Optional event object describing the data values that
have been added.public void dataUpdated(DataSource source, DataChangeEvent... events)
DataListener
s and should not be called manually.dataUpdated
in interface DataListener
source
- Data source that has been changed.events
- Optional event object describing the data values that
have been updated.public void dataRemoved(DataSource source, DataChangeEvent... events)
DataListener
s and should not be called manually.dataRemoved
in interface DataListener
source
- Data source that has been changed.events
- Optional event object describing the data values that
have been removed.public int getLabelColumn()
public void setLabelColumn(int labelColumn)
labelColumn
- Column index containing the labels.public java.text.Format getLabelFormat()
public void setLabelFormat(java.text.Format labelFormat)
labelFormat
- Format for data to label text conversion.