A legend for chart. More...
Public Member Functions | |
boolean | isVisible () |
Gets the visibility state. | |
void | setBackground (Color color) |
Sets the background color of legend. | |
Color | getBackground () |
Gets the background color of legend. | |
void | setForeground (Color color) |
Sets the foreground color of legend. | |
Color | getForeground () |
Gets the foreground color of legend. | |
Font | getFont () |
Gets the font. | |
void | setFont (Font font) |
Sets the font. | |
int | getPosition () |
Gets the position of legend. | |
void | setPosition (int position) |
Sets the position of legend. | |
Rectangle | getBounds (String seriesId) |
Gets the rectangle associated with the given series id on legend. | |
Package Functions | |
void | setVisible (boolean visible) |
Sets legend visible. |
A legend for chart.
Definition at line 16 of file ILegend.java.
Color org.swtchart.ILegend.getBackground | ( | ) |
Gets the background color of legend.
Referenced by org.swtchart.internal.Legend.paintControl(), and org.swtchart.ext.internal.properties.LegendPage.selectValues().
Rectangle org.swtchart.ILegend.getBounds | ( | String | seriesId | ) |
Gets the rectangle associated with the given series id on legend.
This method is typically used for mouse listener to check whether mouse cursor is on legend for a certain series.
Mouse listener can be added by casting ILegend
to Control
.
Control legend = (Control) chart.getLegend(); legend.addMouseListener(...);
seriesId | the series id |
Implemented in org.swtchart.internal.Legend.
Referenced by org.swtchart.examples.advanced.LegendBoundsExample.createChart().
Font org.swtchart.ILegend.getFont | ( | ) |
Gets the font.
Referenced by org.swtchart.ext.internal.properties.LegendPage.apply(), org.swtchart.internal.Legend.paintControl(), org.swtchart.ext.internal.properties.LegendPage.selectValues(), and org.swtchart.internal.Legend.updateLayoutData().
Color org.swtchart.ILegend.getForeground | ( | ) |
Gets the foreground color of legend.
Referenced by org.swtchart.internal.Legend.paintControl(), and org.swtchart.ext.internal.properties.LegendPage.selectValues().
int org.swtchart.ILegend.getPosition | ( | ) |
Gets the position of legend.
Implemented in org.swtchart.internal.Legend.
boolean org.swtchart.ILegend.isVisible | ( | ) |
Gets the visibility state.
Implemented in org.swtchart.internal.Legend.
Referenced by org.swtchart.ext.internal.properties.LegendPage.selectValues().
void org.swtchart.ILegend.setBackground | ( | Color | color | ) |
Sets the background color of legend.
color | the background color |
Implemented in org.swtchart.internal.Legend.
Referenced by org.swtchart.ext.internal.properties.LegendPage.apply().
void org.swtchart.ILegend.setFont | ( | Font | font | ) |
Sets the font.
font | the font |
Implemented in org.swtchart.internal.Legend.
Referenced by org.swtchart.ext.internal.properties.LegendPage.apply().
void org.swtchart.ILegend.setForeground | ( | Color | color | ) |
Sets the foreground color of legend.
color | the foreground color |
Implemented in org.swtchart.internal.Legend.
Referenced by org.swtchart.ext.internal.properties.LegendPage.apply().
void org.swtchart.ILegend.setPosition | ( | int | position | ) |
Sets the position of legend.
If the position is SWT.LEFT
or SWT.RIGHT
, the orientation of series on legend will be vertical. If the position is SWT.TOP
or SWT.BOTTOM
, the orientation will be horizontal.
position | the position of legend that can be SWT.LEFT , SWT.RIGHT , SWT.TOP or SWT.BOTTOM . |
Implemented in org.swtchart.internal.Legend.
void org.swtchart.ILegend.setVisible | ( | boolean | visible | ) | [package] |
Sets legend visible.
visible | the visibility state |
Implemented in org.swtchart.internal.Legend.
Referenced by org.swtchart.ext.internal.properties.LegendPage.apply().