public class Legend extends org.eclipse.swt.widgets.Composite implements ILegend, org.eclipse.swt.events.PaintListener
Constructor and Description |
---|
Legend(Chart chart,
int style)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
protected void |
drawSymbol(org.eclipse.swt.graphics.GC gc,
Series series,
org.eclipse.swt.graphics.Rectangle r)
Draws the symbol of series.
|
org.eclipse.swt.graphics.Rectangle |
getBounds(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(org.eclipse.swt.events.PaintEvent e) |
void |
setBackground(org.eclipse.swt.graphics.Color color)
Sets the background color of legend.
|
void |
setFont(org.eclipse.swt.graphics.Font font)
Sets the font.
|
void |
setForeground(org.eclipse.swt.graphics.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.
|
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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
setVisible
in class org.eclipse.swt.widgets.Control
visible
- the visibility statepublic boolean isVisible()
ILegend
public void setFont(org.eclipse.swt.graphics.Font font)
ILegend
public void setForeground(org.eclipse.swt.graphics.Color color)
ILegend
setForeground
in interface ILegend
setForeground
in class org.eclipse.swt.widgets.Control
color
- the foreground colorpublic void setBackground(org.eclipse.swt.graphics.Color color)
ILegend
setBackground
in interface ILegend
setBackground
in class org.eclipse.swt.widgets.Control
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 org.eclipse.swt.graphics.Rectangle getBounds(String seriesId)
ILegend
Mouse listener can be added by casting ILegend to Control.
Control legend = (Control) chart.getLegend(); legend.addMouseListener(...);
public void dispose()
dispose
in class org.eclipse.swt.widgets.Widget
public void updateLayoutData()
protected void drawSymbol(org.eclipse.swt.graphics.GC gc, Series series, org.eclipse.swt.graphics.Rectangle r)
gc
- the graphics contextseries
- the seriesr
- the rectangle to draw the symbol of seriespublic void paintControl(org.eclipse.swt.events.PaintEvent e)
paintControl
in interface org.eclipse.swt.events.PaintListener
Copyright © 2016. All Rights Reserved.