| 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, waitgetBackground, getFont, getForegroundpublic Legend(Chart chart, int style)
chart - the chartstyle - the stylepublic void setVisible(boolean visible)
ILegendsetVisible in interface ILegendvisible - the visibility statepublic boolean isVisible()
ILegendpublic void setFont(Font font)
ILegendpublic void setForeground(Color color)
ILegendsetForeground in interface ILegendcolor - the foreground colorpublic void setBackground(Color color)
ILegendsetBackground in interface ILegendcolor - the background colorpublic int getPosition()
ILegendgetPosition in interface ILegendpublic void setPosition(int value)
ILegendsetPosition in interface ILegendvalue - the position of legend that can be SWT.LEFT,
SWT.RIGHT, SWT.TOP or SWT.BOTTOM.public Rectangle getBounds(java.lang.String seriesId)
ILegendMouse 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)