Constructor and Description |
---|
Legend(Chart chart,
int style)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
protected void |
drawSymbol(GC gc,
Series series,
Rectangle r)
Draws the symbol of series.
|
Rectangle |
getBounds(java.lang.String seriesId)
Gets the rectangle associated with the given series id on legend.
|
int |
getPosition()
Gets the position of legend.
|
boolean |
isVisible()
Gets the visibility state.
|
void |
paintControl(PaintEvent e) |
void |
setBackground(Color color)
Sets the background color of legend.
|
void |
setFont(Font font)
Sets the font.
|
void |
setForeground(Color color)
Sets the foreground color of legend.
|
void |
setPosition(int value)
Sets the position of legend.
|
void |
setVisible(boolean visible)
Sets legend visible.
|
void |
updateLayoutData()
Update the layout data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBackground, getFont, getForeground
public Legend(Chart chart, int style)
chart
- the chartstyle
- the stylepublic void setVisible(boolean visible)
ILegend
setVisible
in interface ILegend
visible
- the visibility statepublic boolean isVisible()
ILegend
public void setFont(Font font)
ILegend
public void setForeground(Color color)
ILegend
setForeground
in interface ILegend
color
- the foreground colorpublic void setBackground(Color color)
ILegend
setBackground
in interface ILegend
color
- the background colorpublic int getPosition()
ILegend
getPosition
in interface ILegend
public void setPosition(int value)
ILegend
setPosition
in interface ILegend
value
- the position of legend that can be SWT.LEFT,
SWT.RIGHT, SWT.TOP or SWT.BOTTOM.public Rectangle getBounds(java.lang.String seriesId)
ILegend
Mouse listener can be added by casting ILegend to Control.
Control legend = (Control) chart.getLegend(); legend.addMouseListener(...);
public void dispose()
public void updateLayoutData()
protected void drawSymbol(GC gc, Series series, Rectangle r)
gc
- the graphics contextseries
- the seriesr
- the rectangle to draw the symbol of seriespublic void paintControl(PaintEvent e)