public interface Legend extends Container, Drawable
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.
|
double |
getAlignmentX()
Returns the horizontal alignment of the legend relative to the plot area.
|
double |
getAlignmentY()
Returns the vertical alignment of the legend relative to the plot area.
|
java.awt.Paint |
getBackground()
Returns the paint used to draw the background.
|
java.awt.Paint |
getBorderColor()
Returns the paint used to fill the border of the legend.
|
java.awt.Stroke |
getBorderStroke()
Returns the stroke used to draw the border of the legend.
|
java.awt.Font |
getFont()
Returns the font used to display the labels.
|
java.awt.geom.Dimension2D |
getGap()
Returns the horizontal and vertical gap between items.
|
Orientation |
getOrientation()
Returns the direction of the legend's items.
|
java.awt.geom.Dimension2D |
getSymbolSize()
Returns the size of the legend's symbols.
|
void |
refresh()
Updates the items for all data sources stored in this legend.
|
void |
remove(DataSource source)
Removes the specified data source.
|
void |
setAlignmentX(double alignmentX)
Sets the horizontal alignment of the legend relative to the plot area.
|
void |
setAlignmentY(double alignmentY)
Sets the vertical alignment of the legend relative to the plot area.
|
void |
setBackground(java.awt.Paint background)
Sets the paint used to draw the background.
|
void |
setBorderColor(java.awt.Paint borderColor)
Sets the paint used to fill the border of the legend.
|
void |
setBorderStroke(java.awt.Stroke borderStroke)
Sets the stroke used to draw the border of the legend.
|
void |
setFont(java.awt.Font font)
Sets the font used to display the labels.
|
void |
setGap(java.awt.geom.Dimension2D gap)
Sets the horizontal and vertical gap between items.
|
void |
setOrientation(Orientation orientation)
Sets the direction of the legend's items.
|
void |
setSymbolSize(java.awt.geom.Dimension2D symbolSize)
Sets the size of the legend's symbols.
|
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()
java.awt.Paint getBackground()
void setBackground(java.awt.Paint background)
background
- Paint used for background drawing.java.awt.Stroke getBorderStroke()
void setBorderStroke(java.awt.Stroke borderStroke)
borderStroke
- Stroke used for border drawing.java.awt.Font getFont()
void setFont(java.awt.Font font)
font
- Font used for labels.java.awt.Paint getBorderColor()
void setBorderColor(java.awt.Paint borderColor)
borderColor
- Paint used for border drawing.Orientation getOrientation()
void setOrientation(Orientation orientation)
orientation
- Item orientation.java.awt.geom.Dimension2D getSymbolSize()
void setSymbolSize(java.awt.geom.Dimension2D symbolSize)
symbolSize
- Symbol size relative to the font height.double getAlignmentX()
0.0
means left, 0.5
means centered, and 1.0
means right.void setAlignmentX(double alignmentX)
0.0
means left, 0.5
means centered, and 1.0
means right.alignmentX
- Relative horizontal alignment.double getAlignmentY()
0.0
means top, 0.5
means centered, and 1.0
means bottom.void setAlignmentY(double alignmentY)
0.0
means top, 0.5
means centered, and 1.0
means bottom.alignmentY
- Relative vertical alignment.java.awt.geom.Dimension2D getGap()
void setGap(java.awt.geom.Dimension2D gap)
gap
- Gap size relative to the font height.