public abstract class PlotComposite
extends org.eclipse.swt.widgets.Composite
IPlot
s.
Certain methods are suggested for sub-classes to override, in particular the following methods:
createPlotContent(Composite, int)
- fill the composite with
customized contentupdatePlotContent(Composite)
- refresh the customized content
disposePlotContent(Composite)
- clear the customized content
showSeries(ISeries)
- add the selected series to the custom
contenthideSeries(ISeries)
- remove the series from the custom content
The life-cycle of these method calls can be found in
performRefresh()
, and each method may be called multiple times.
Additional room for customization includes a context (right-click) menu that
can be added to nested composites via addContextMenu(Composite)
. The
context menu's content can be updated or replaced by overriding
getPlotActions()
.
Another simple customization includes the ability to prohibit multiple series
from being selected by overriding canShowMultipleSeries()
.
Constructor and Description |
---|
PlotComposite(org.eclipse.swt.widgets.Composite parent,
int style)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
refresh()
Refreshes the composite based on the
plot 's current content. |
boolean |
setPlot(IPlot plot)
Sets the current plot associated with this plot composite.
|
changed, computeSize, 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, 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, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
public PlotComposite(org.eclipse.swt.widgets.Composite parent, int style)
parent
- a widget which will be the parent of the new instance (cannot
be null)style
- the style of widget to constructpublic void refresh()
plot
's current content.
This method is safe to call from off the UI thread.
public boolean setPlot(IPlot plot)
Note: This method will not refresh the composite
automatically. If the plot changes, the calling code should call
refresh()
afterward.
plot
- The new plot shown in this composite, or null
to clear
it.