Package org.swtchart
Interface ILegend
-
- All Known Implementing Classes:
Legend
public interface ILegendA legend for chart.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.eclipse.swt.graphics.ColorgetBackground()Gets the background color of legend.org.eclipse.swt.graphics.RectanglegetBounds(java.lang.String seriesId)Gets the rectangle associated with the given series id on legend.org.eclipse.swt.graphics.FontgetFont()Gets the font.org.eclipse.swt.graphics.ColorgetForeground()Gets the foreground color of legend.intgetPosition()Gets the position of legend.booleanisVisible()Gets the visibility state.voidsetBackground(org.eclipse.swt.graphics.Color color)Sets the background color of legend.voidsetFont(org.eclipse.swt.graphics.Font font)Sets the font.voidsetForeground(org.eclipse.swt.graphics.Color color)Sets the foreground color of legend.voidsetPosition(int position)Sets the position of legend.voidsetVisible(boolean visible)Sets legend visible.
-
-
-
Method Detail
-
setVisible
void setVisible(boolean visible)
Sets legend visible.- Parameters:
visible- the visibility state
-
isVisible
boolean isVisible()
Gets the visibility state.- Returns:
- true if legend is visible
-
setBackground
void setBackground(org.eclipse.swt.graphics.Color color)
Sets the background color of legend.- Parameters:
color- the background color
-
getBackground
org.eclipse.swt.graphics.Color getBackground()
Gets the background color of legend.- Returns:
- background color of legend.
-
setForeground
void setForeground(org.eclipse.swt.graphics.Color color)
Sets the foreground color of legend.- Parameters:
color- the foreground color
-
getForeground
org.eclipse.swt.graphics.Color getForeground()
Gets the foreground color of legend.- Returns:
- foreground color of legend.
-
getFont
org.eclipse.swt.graphics.Font getFont()
Gets the font.- Returns:
- the font
-
setFont
void setFont(org.eclipse.swt.graphics.Font font)
Sets the font.- Parameters:
font- the font
-
getPosition
int getPosition()
Gets the position of legend.- Returns:
- the position of legend.
-
setPosition
void 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.- Parameters:
position- the position of legend that can be SWT.LEFT, SWT.RIGHT, SWT.TOP or SWT.BOTTOM.
-
getBounds
org.eclipse.swt.graphics.Rectangle getBounds(java.lang.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(...);
- Parameters:
seriesId- the series id- Returns:
- the rectangle associated with the given series id in pixels.
-
-