public abstract class ValueLegend extends AbstractLegend implements DataListener
AbstractLegend.AbstractSymbol, AbstractLegend.Item
Modifier and Type | Field and Description |
---|---|
static Key |
LABEL_COLUMN
Key for specifying a
Integer value for the index of
the column that contains the labels for the values. |
static Key |
LABEL_FORMAT
Key for specifying the
Format instance to be used to
format the displayed data values. |
ALIGNMENT_X, ALIGNMENT_Y, BACKGROUND, BORDER, COLOR, FONT, GAP, ORIENTATION, SYMBOL_SIZE
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 Iterable<Row> |
getEntries(DataSource source)
Returns a sequence of items for the specified data source that should be
added to the legend.
|
protected String |
getLabel(Row row)
Returns the label text for the specified row.
|
void |
remove(DataSource source)
Removes the specified data source.
|
void |
settingChanged(SettingChangeEvent event)
Invoked if a setting has changed.
|
clear, contains, draw, drawBackground, drawBorder, invalidate, isValid, refresh, setBounds
getSetting, removeSetting, removeSettingDefault, setSetting, setSettingDefault
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
getSetting, removeSetting, removeSettingDefault, setSetting, setSettingDefault
getSymbol
public static final Key LABEL_COLUMN
Integer
value for the index of
the column that contains the labels for the values.protected Iterable<Row> getEntries(DataSource source)
AbstractLegend
getEntries
in class AbstractLegend
source
- Data source.protected 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 settingChanged(SettingChangeEvent event)
AbstractLegend
settingChanged
in interface SettingsListener
settingChanged
in class AbstractLegend
event
- Event containing information about the changed setting.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.Copyright © 2009-2013. All Rights Reserved.