Class AbstractSWTWidgetFigure<T extends Control>
java.lang.Object
org.eclipse.draw2d.Figure
org.csstudio.opibuilder.widgets.figures.AbstractSWTWidgetFigure<T>
- All Implemented Interfaces:
org.eclipse.draw2d.IFigure
- Direct Known Subclasses:
AbstractWebBrowserFigure,NativeButtonFigure,NativeTextFigure,SpreadSheetTableFigure
The abstract figure for all SWT widget based figure. Note that there are some known issues regarding using SWT native
widget in draw2D figure:
- The order of SWT widget is always on top of draw2D figures. The order between between SWT widgets works but it is initialized during OPI startup, so change its order with change order action will only be reflected after reopen/run the opi.
- Moving/Resizing a SWT widget is much slower than draw2D figure
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch, org.eclipse.draw2d.Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets -
Field Summary
FieldsFields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSWTWidgetFigure(AbstractBaseEditPart editpart) Construct the figure with SWT.NONE as style bit.AbstractSWTWidgetFigure(AbstractBaseEditPart editpart, int style) Construct the figure. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TcreateSWTWidget(Composite parent, int style) Create the SWT widget.This method will be call in constructorAbstractSWTWidgetFigure(AbstractBaseEditPart, int)protected voiddispose()Dispose SWT widget.Get the SWT widget on this figure.protected voidlayout()protected voidpaintClientArea(org.eclipse.draw2d.Graphics graphics) protected voidpaintOutlineFigure(org.eclipse.draw2d.Graphics graphics) Paint an outline figure so it can be viewed in outline view in edit mode.protected voidrelocate the widget so it follows the figure position.protected voidvoidvoidvoidsetEnabled(boolean value) voidvoidvoidsetVisible(boolean visible) Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBorder, getBounds, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, optimizeClip, paint, paintBorder, paintChildren, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setFlag, setFocusTraversable, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
Field Details
-
runmode
protected boolean runmode -
editPart
-
-
Constructor Details
-
AbstractSWTWidgetFigure
Construct the figure with SWT.NONE as style bit.- Parameters:
editpart- the editpart that holds this figure
-
AbstractSWTWidgetFigure
Construct the figure.- Parameters:
editpart- the editpart that holds this figure.style- style of the SWT widget, which will be passed tocreateSWTWidget(Composite, int).
-
-
Method Details
-
layout
protected void layout()- Overrides:
layoutin classorg.eclipse.draw2d.Figure
-
getSWTWidget
Get the SWT widget on this figure.- Returns:
- the SWT widget.
-
createSWTWidget
Create the SWT widget.This method will be call in constructorAbstractSWTWidgetFigure(AbstractBaseEditPart, int)- Parameters:
parent- the parent composite.style- style of the SWT widget, which is passed from the constructorAbstractSWTWidgetFigure(AbstractBaseEditPart, int)- Returns:
- the SWT widget.
-
setCursor
- Specified by:
setCursorin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setCursorin classorg.eclipse.draw2d.Figure
-
setEnabled
public void setEnabled(boolean value) - Specified by:
setEnabledin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setEnabledin classorg.eclipse.draw2d.Figure
-
setVisible
public void setVisible(boolean visible) - Specified by:
setVisiblein interfaceorg.eclipse.draw2d.IFigure- Overrides:
setVisiblein classorg.eclipse.draw2d.Figure
-
getForegroundColor
- Specified by:
getForegroundColorin interfaceorg.eclipse.draw2d.IFigure- Overrides:
getForegroundColorin classorg.eclipse.draw2d.Figure
-
getBackgroundColor
- Specified by:
getBackgroundColorin interfaceorg.eclipse.draw2d.IFigure- Overrides:
getBackgroundColorin classorg.eclipse.draw2d.Figure
-
setForegroundColor
- Specified by:
setForegroundColorin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setForegroundColorin classorg.eclipse.draw2d.Figure
-
setBackgroundColor
- Specified by:
setBackgroundColorin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setBackgroundColorin classorg.eclipse.draw2d.Figure
-
paintClientArea
protected void paintClientArea(org.eclipse.draw2d.Graphics graphics) - Overrides:
paintClientAreain classorg.eclipse.draw2d.Figure
-
paintOutlineFigure
protected void paintOutlineFigure(org.eclipse.draw2d.Graphics graphics) Paint an outline figure so it can be viewed in outline view in edit mode. It is a white filled rectangle with gray border by default. Subclass may override it accordingly.- Parameters:
graphics- The Graphics used to paint
-
repaintWidget
protected void repaintWidget() -
relocateWidget
protected void relocateWidget()relocate the widget so it follows the figure position. -
setFont
- Specified by:
setFontin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setFontin classorg.eclipse.draw2d.Figure
-
dispose
protected void dispose()Dispose SWT widget. The SWT widget will be automatically disposed when widget editpart is deactivated. Subclass should not dispose the SWT widget again.
-