public interface Legend extends Container, Drawable, SettingsStorage
Modifier and Type | Field and Description |
---|---|
static Key |
ALIGNMENT_X
Key for specifying a
Number value describing the horizontal
alignment of the legend relative to the plot area. |
static Key |
ALIGNMENT_Y
Key for specifying a
Number value describing the vertical
alignment of the legend relative to the plot area. |
static Key |
BACKGROUND
Key for specifying the
Paint instance to be used to
paint the background. |
static Key |
BORDER
Key for specifying the
Stroke instance to be used to
paint the border of the legend. |
static Key |
COLOR
Key for specifying the
Paint instance to be used to
fill the border of the legend. |
static Key |
FONT
Key for specifying the
Font instance to be used to
display the legend labels. |
static Key |
GAP
Key for specifying a
Insets2D instance defining the
horizontal and vertical gap between items. |
static Key |
ORIENTATION
Key for specifying a
Orientation
instance defining the direction of the legend's items. |
static Key |
SYMBOL_SIZE
Key for specifying a
Insets2D instance defining the
size of the legend's symbols. |
Modifier and Type | Method and Description |
---|---|
void |
add(DataSource source)
Adds the specified data source in order to display it.
|
void |
clear()
Removes all data sources from the legend.
|
boolean |
contains(DataSource source)
Returns whether the specified data source was added to the legend.
|
void |
refresh()
Updates the items for all data sources stored in this legend.
|
void |
remove(DataSource source)
Removes the specified data source.
|
add, add, getBounds, getConstraints, getDrawableAt, getInsets, getLayout, layout, remove, setBounds, setInsets, setLayout, size
draw, getBounds, getHeight, getPreferredSize, getWidth, getX, getY, setBounds, setBounds
getSetting, removeSetting, removeSettingDefault, setSetting, setSettingDefault
static final Key BACKGROUND
Paint
instance to be used to
paint the background.static final Key BORDER
Stroke
instance to be used to
paint the border of the legend.static final Key FONT
Font
instance to be used to
display the legend labels.static final Key COLOR
Paint
instance to be used to
fill the border of the legend.static final Key ORIENTATION
Orientation
instance defining the direction of the legend's items.static final Key ALIGNMENT_X
Number
value describing the horizontal
alignment of the legend relative to the plot area. 0.0
means left,
0.5
means centered, and 1.0
means right.static final Key ALIGNMENT_Y
Number
value describing the vertical
alignment of the legend relative to the plot area. 0.0
means top,
0.5
means centered, and 1.0
means bottom.static final Key GAP
Insets2D
instance defining the
horizontal and vertical gap between items. The gap size is defined
relative to the font height of the legend.void add(DataSource source)
source
- data source to be added.boolean contains(DataSource source)
source
- Data sourcetrue
if legend contains the data source, otherwise false
void remove(DataSource source)
source
- Data source to be removed.void clear()
void refresh()
Copyright © 2009-2013. All Rights Reserved.