Eclipse Draw2d
2.1

org.eclipse.draw2d
Class LightweightSystem

java.lang.Object
  |
  +--org.eclipse.draw2d.LightweightSystem

public class LightweightSystem
extends Object

The LightweightSystem is the link between SWT and draw2d. It is the component that provides the ability for Figures to be hosted on an SWT Canvas. Normal procedure for using a LightweightSystem: 1) Create an SWT Canvas. 2) Create a LightweightSystem passing it that Canvas. 3) Create a draw2d Figure and call setContents(IFigure). This Figure will be the top-level Figure of the draw2d application.


Nested Class Summary
protected  class LightweightSystem.EventHandler
           
protected  class LightweightSystem.RootFigure
           
 
Constructor Summary
LightweightSystem()
           
LightweightSystem(Canvas c)
          Constructs a LightweightSystem on Canvas c.
 
Method Summary
protected  void addListeners()
          Adds SWT listeners to the LightWeightSystem's Canvas.
protected  void controlResized()
           
protected  LightweightSystem.EventHandler createEventHandler()
          Returns a new instance of this LightweightSystem's.
protected  LightweightSystem.RootFigure createRootFigure()
           
protected  EventDispatcher getEventDispatcher()
          Returns this LightwightSystem's EventDispatcher.
 IFigure getRootFigure()
          Returns this LightweightSystem's root Figure.
 UpdateManager getUpdateManager()
          Returns this LightweightSystem's UpdateManager.
protected  void init()
           
 void paint(GC gc)
          Invokes this LightweightSystem's UpdateManager to paint this LightweightSystem's Canvas and contents.
 void setContents(IFigure figure)
          Sets the contents of the LightweightSystem to the passed Figure.
 void setControl(Canvas c)
          Sets the LightweightSystem's control to the passed Canvas.
 void setEventDispatcher(EventDispatcher dispatcher)
          Sets this LightweightSystem's EventDispatcher to dispatcher.
protected  void setRootPaneFigure(LightweightSystem.RootFigure root)
           
 void setUpdateManager(UpdateManager um)
          Sets this LightweightSystem's UpdateManager to um.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LightweightSystem

public LightweightSystem(Canvas c)
Constructs a LightweightSystem on Canvas c.

Since:
2.0

LightweightSystem

public LightweightSystem()
Method Detail

addListeners

protected void addListeners()
Adds SWT listeners to the LightWeightSystem's Canvas. This allows for SWT events to be dispatched and handled by its EventDispatcher.

Since:
2.0

controlResized

protected void controlResized()

getEventDispatcher

protected EventDispatcher getEventDispatcher()
Returns this LightwightSystem's EventDispatcher.

Since:
2.0

getRootFigure

public IFigure getRootFigure()
Returns this LightweightSystem's root Figure.

Since:
2.0

createEventHandler

protected final LightweightSystem.EventHandler createEventHandler()
Returns a new instance of this LightweightSystem's. EventHandler.

Since:
2.0

createRootFigure

protected LightweightSystem.RootFigure createRootFigure()

getUpdateManager

public UpdateManager getUpdateManager()
Returns this LightweightSystem's UpdateManager.

Since:
2.0

init

protected void init()

paint

public void paint(GC gc)
Invokes this LightweightSystem's UpdateManager to paint this LightweightSystem's Canvas and contents.

Since:
2.0

setContents

public void setContents(IFigure figure)
Sets the contents of the LightweightSystem to the passed Figure. This Figure should be the top-level Figure in a draw2d application.

Since:
2.0

setControl

public void setControl(Canvas c)
Sets the LightweightSystem's control to the passed Canvas.

Since:
2.0

setEventDispatcher

public void setEventDispatcher(EventDispatcher dispatcher)
Sets this LightweightSystem's EventDispatcher to dispatcher.

Since:
2.0

setRootPaneFigure

protected void setRootPaneFigure(LightweightSystem.RootFigure root)

setUpdateManager

public void setUpdateManager(UpdateManager um)
Sets this LightweightSystem's UpdateManager to um.

Since:
2.0

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.