Draw2D v2.0

org.eclipse.draw2d
Class FigureCanvas

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.draw2d.FigureCanvas
All Implemented Interfaces:
Drawable

public class FigureCanvas
extends Canvas

A Canvas that contains Figures.


Field Summary
static int ALWAYS
           
static int AUTOMATIC
           
static int NEVER
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
FigureCanvas(Composite parent)
          Creates a new FigureCanvas with the given parent.
 
Method Summary
 IFigure getContents()
          Returns the contents of the Viewport.
 int getHorizontalScrollBarVisibility()
          Returns the horizontal scrollbar visibility.
 LightweightSystem getLightweightSystem()
           
 int getVerticalScrollBarVisibility()
          Returns the vertical scrollbar visibility.
 Viewport getViewport()
          Returns the Viewport.
 void scrollSmoothTo(int x, int y)
          Scrolls in an animated way to the new x and y location.
 void scrollTo(int x, int y)
          Scrolls the contents to the new x and y location.
 void scrollToX(int hOffset)
          Scrolls the contents horizontally so that they are offset by newHOffset.
 void scrollToY(int vOffset)
          Scrolls the contents vertically so that they are offset by newVOffset.
 void setContents(IFigure figure)
          Sets the contents of the Viewport.
 void setHorizontalScrollBarVisibility(int v)
          Sets the horizontal scrollbar visibility.
 void setScrollBarVisibility(int both)
           
 void setVerticalScrollBarVisibility(int v)
          Sets the vertical scrollbar visibility.
 void setViewport(Viewport vp)
          Sets the Viewport.
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getDisplay, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isDisposed, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getStyle, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEVER

public static int NEVER

AUTOMATIC

public static int AUTOMATIC

ALWAYS

public static int ALWAYS
Constructor Detail

FigureCanvas

public FigureCanvas(Composite parent)
Creates a new FigureCanvas with the given parent.
Method Detail

getContents

public IFigure getContents()
Returns the contents of the Viewport.

getHorizontalScrollBarVisibility

public int getHorizontalScrollBarVisibility()
Returns the horizontal scrollbar visibility.

getLightweightSystem

public LightweightSystem getLightweightSystem()

getVerticalScrollBarVisibility

public int getVerticalScrollBarVisibility()
Returns the vertical scrollbar visibility.

getViewport

public Viewport getViewport()
Returns the Viewport. If it's null, a new one is created.

scrollSmoothTo

public void scrollSmoothTo(int x,
                           int y)
Scrolls in an animated way to the new x and y location.

scrollTo

public void scrollTo(int x,
                     int y)
Scrolls the contents to the new x and y location. If this scroll operation only consists of a vertical or horizontal scroll, a call will be made to scrollToY(int) or scrollToX(int), respectively, to increase performance.

scrollToX

public void scrollToX(int hOffset)
Scrolls the contents horizontally so that they are offset by newHOffset.

scrollToY

public void scrollToY(int vOffset)
Scrolls the contents vertically so that they are offset by newVOffset.

setContents

public void setContents(IFigure figure)
Sets the contents of the Viewport.

setHorizontalScrollBarVisibility

public void setHorizontalScrollBarVisibility(int v)
Sets the horizontal scrollbar visibility. Possible values are AUTOMATIC, ALWAYS, and NEVER.

setScrollBarVisibility

public void setScrollBarVisibility(int both)

setVerticalScrollBarVisibility

public void setVerticalScrollBarVisibility(int v)
Sets the vertical scrollbar visibility. Possible values are AUTOMATIC, ALWAYS, and NEVER.

setViewport

public void setViewport(Viewport vp)
Sets the Viewport.

Draw2D v2.0