Class GFFigureCanvas
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.graphiti.ui.internal.editor.GFFigureCanvas
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable
,org.eclipse.swt.graphics.Drawable
public class GFFigureCanvas
extends org.eclipse.swt.widgets.Canvas
implements org.eclipse.core.runtime.IAdaptable
A Canvas that contains
Figures
.
Note: Only one of the styles RIGHT_TO_LEFT, LEFT_TO_RIGHT may be specified.
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
Always show scrollbar.static int
Automatically show scrollbar when needed.static int
Never show scrollbar.Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
-
Constructor Summary
ConstructorDescriptionGFFigureCanvas
(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.draw2d.LightweightSystem lws, DiagramBehavior diagramBehavior) Constructor.GFFigureCanvas
(org.eclipse.swt.widgets.Composite parent, int style, DiagramBehavior diagramBehavior) Constructor.GFFigureCanvas
(org.eclipse.swt.widgets.Composite parent, org.eclipse.draw2d.LightweightSystem lws, DiagramBehavior diagramBehavior) Constructs a new FigureCanvas with the given parent and LightweightSystem.GFFigureCanvas
(org.eclipse.swt.widgets.Composite parent, DiagramBehavior diagramBehavior) Creates a new FigureCanvas with the given parent. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.graphics.Point
computeSize
(int wHint, int hHint, boolean changed) getAdapter
(Class adapter) org.eclipse.draw2d.IFigure
Gets the contents.org.eclipse.draw2d.geometry.Rectangle
org.eclipse.swt.graphics.Font
getFont()
int
Gets the horizontal scroll bar visibility.org.eclipse.draw2d.LightweightSystem
Gets the lightweight system.int
Gets the vertical scroll bar visibility.org.eclipse.draw2d.Viewport
Returns the Viewport.void
Regain horizontal space.void
Regain space.void
Regain vertical space.void
void
scrollSmoothTo
(int x, int y) Scroll smooth to.void
scrollTo
(int x, int y) Scroll to.void
scrollToX
(org.eclipse.swt.events.SelectionEvent event, int hOffset) Scrolls the contents horizontally so that they are offset byhOffset
.void
scrollToY
(org.eclipse.swt.events.SelectionEvent event, int vOffset) Scrolls the contents vertically so that they are offset byvOffset
.void
setBorder
(org.eclipse.draw2d.Border border) Sets the given border on the LightweightSystem's root figure.void
setContents
(org.eclipse.draw2d.IFigure figure) Sets the contents of theViewport
.void
void
setFont
(org.eclipse.swt.graphics.Font font) void
Sets the horizontal scrollbar visibility.void
setScrollBarVisibility
(int both) Sets both the horizontal and vertical scrollbar visibility to the given value.void
Sets the vertical scrollbar visibility.void
setViewport
(org.eclipse.draw2d.Viewport vp) Sets the Viewport.Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setIME
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
Methods inherited from class org.eclipse.swt.widgets.Control
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, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, 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, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
-
Field Details
-
NEVER
public static int NEVERNever show scrollbar. -
AUTOMATIC
public static int AUTOMATICAutomatically show scrollbar when needed. -
ALWAYS
public static int ALWAYSAlways show scrollbar.
-
-
Constructor Details
-
GFFigureCanvas
Creates a new FigureCanvas with the given parent.- Parameters:
parent
- the parentdiagramEditor
- the diagram editor
-
GFFigureCanvas
public GFFigureCanvas(org.eclipse.swt.widgets.Composite parent, int style, DiagramBehavior diagramBehavior) Constructor.- Parameters:
parent
- the parent compositestyle
- look at class javadoc for valid stylesdiagramEditor
- the diagram editor- Since:
- 3.1
-
GFFigureCanvas
public GFFigureCanvas(org.eclipse.swt.widgets.Composite parent, org.eclipse.draw2d.LightweightSystem lws, DiagramBehavior diagramBehavior) Constructs a new FigureCanvas with the given parent and LightweightSystem.- Parameters:
parent
- the parentlws
- the LightweightSystemdiagramEditor
- the diagram editor
-
GFFigureCanvas
public GFFigureCanvas(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.draw2d.LightweightSystem lws, DiagramBehavior diagramBehavior) Constructor.- Parameters:
parent
- the parent compositestyle
- look at class javadoc for valid styleslws
- the lightweight systemdiagramEditor
- the diagram editor- Since:
- 3.1
-
-
Method Details
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed) - Overrides:
computeSize
in classorg.eclipse.swt.widgets.Control
-
getContents
public org.eclipse.draw2d.IFigure getContents()Gets the contents.- Returns:
- the contents of the
Viewport
.
-
getFont
public org.eclipse.swt.graphics.Font getFont()- Overrides:
getFont
in classorg.eclipse.swt.widgets.Control
-
getHorizontalScrollBarVisibility
public int getHorizontalScrollBarVisibility()Gets the horizontal scroll bar visibility.- Returns:
- the horizontal scrollbar visibility.
-
getLightweightSystem
public org.eclipse.draw2d.LightweightSystem getLightweightSystem()Gets the lightweight system.- Returns:
- the LightweightSystem
-
getVerticalScrollBarVisibility
public int getVerticalScrollBarVisibility()Gets the vertical scroll bar visibility.- Returns:
- the vertical scrollbar visibility.
-
getViewport
public org.eclipse.draw2d.Viewport getViewport()Returns the Viewport. If it'snull
, a new one is created.- Returns:
- the viewport
-
scrollToX
public void scrollToX(org.eclipse.swt.events.SelectionEvent event, int hOffset) Scrolls the contents horizontally so that they are offset byhOffset
.- Parameters:
hOffset
- the new horizontal offsetevent
- the event
-
scrollToY
public void scrollToY(org.eclipse.swt.events.SelectionEvent event, int vOffset) Scrolls the contents vertically so that they are offset byvOffset
.- Parameters:
vOffset
- the new vertical offsetevent
- the event
-
regainSpace
public void regainSpace()Regain space. -
regainHorizontalSpace
public void regainHorizontalSpace()Regain horizontal space. -
regainVerticalSpace
public void regainVerticalSpace()Regain vertical space. -
getDiagramBoundsFromEditPartChildren
public org.eclipse.draw2d.geometry.Rectangle getDiagramBoundsFromEditPartChildren() -
scrollSmoothTo
public void scrollSmoothTo(int x, int y) Scroll smooth to.- Parameters:
x
- the xy
- the y
-
scrollTo
public void scrollTo(int x, int y) Scroll to.- Parameters:
x
- the xy
- the y
-
setBorder
public void setBorder(org.eclipse.draw2d.Border border) Sets the given border on the LightweightSystem's root figure.- Parameters:
border
- The new border
-
setContents
public void setContents(org.eclipse.draw2d.IFigure figure) Sets the contents of theViewport
.- Parameters:
figure
- the new contents
-
setFont
public void setFont(org.eclipse.swt.graphics.Font font) - Overrides:
setFont
in classorg.eclipse.swt.widgets.Canvas
-
setHorizontalScrollBarVisibility
public void setHorizontalScrollBarVisibility(int v) - Parameters:
v
- the new visibility
-
setScrollBarVisibility
public void setScrollBarVisibility(int both) Sets both the horizontal and vertical scrollbar visibility to the given value. Possible values areAUTOMATIC
,ALWAYS
, andNEVER
.- Parameters:
both
- the new visibility
-
setVerticalScrollBarVisibility
public void setVerticalScrollBarVisibility(int v) - Parameters:
v
- the new visibility
-
setViewport
public void setViewport(org.eclipse.draw2d.Viewport vp) Sets the Viewport. The given Viewport must use "fake" scrolling. That is, it must be constructed usingnew Viewport(true)
.- Parameters:
vp
- the new viewport
-
removeCornerPixels
public void removeCornerPixels() -
setCornerPixels
public void setCornerPixels() -
getAdapter
- Specified by:
getAdapter
in interfaceorg.eclipse.core.runtime.IAdaptable
-