Package org.eclipse.draw2d
Class LightweightSystem
java.lang.Object
org.eclipse.draw2d.LightweightSystem
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:
- Create an SWT Canvas.
- Create a LightweightSystem passing it that Canvas.
- Create a Draw2d Figure and call setContents(IFigure). This Figure will be the top-level Figure of the Draw2d application.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classListener used to get all necessary events from the Canvas and pass them on to theEventDispatcher.protected classThe figure at the root of the LightweightSystem.
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a LightweightSystem without a Canvas.Constructs a LightweightSystem on Canvas c.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidAdds SWT listeners to the LightWeightSystem's Canvas.protected voidResizes and revalidates the root figure when the control is resized.protected final LightweightSystem.EventHandlerReturns a new instance of this LightweightSystem's EventHandler.protected LightweightSystem.RootFigureCreates and returns the root figure.protected EventDispatcherReturns this LightwightSystem's EventDispatcher.Returns this LightweightSystem's root figure.Returns this LightweightSystem's UpdateManager.protected voidinit()Initializes this LightweightSystem by setting the root figure.voidInvokes this LightweightSystem'sUpdateManagerto paint this LightweightSystem's Canvas and contents.voidsetContents(IFigure figure) Sets the contents of the LightweightSystem to the passed figure.voidsetControl(Canvas c) Sets the LightweightSystem's control to the passed Canvas.voidsetEventDispatcher(EventDispatcher dispatcher) Sets this LightweightSystem's EventDispatcher.protected voidSets this LightweightSystem's root figure.voidSets this LightweightSystem's UpdateManager.
- 
Constructor Details- 
LightweightSystemConstructs a LightweightSystem on Canvas c.- Parameters:
- c- the canvas
- Since:
- 2.0
 
- 
LightweightSystempublic LightweightSystem()Constructs a LightweightSystem without a Canvas.
 
- 
- 
Method Details- 
addListenersprotected void addListeners()Adds SWT listeners to the LightWeightSystem's Canvas. This allows for SWT events to be dispatched and handled by itsEventDispatcher.WARNING: This method should not be overridden. - Since:
- 2.0
 
- 
controlResizedprotected void controlResized()Resizes and revalidates the root figure when the control is resized.
- 
getEventDispatcherReturns this LightwightSystem's EventDispatcher.- Returns:
- the event dispatcher
- Since:
- 2.0
 
- 
getRootFigureReturns this LightweightSystem's root figure.- Returns:
- the root figure
- Since:
- 2.0
 
- 
createEventHandlerReturns a new instance of this LightweightSystem's EventHandler.- Returns:
- the newly created event handler
- Since:
- 2.0
 
- 
createRootFigureCreates and returns the root figure.- Returns:
- the newly created root figure
 
- 
getUpdateManagerReturns this LightweightSystem's UpdateManager.- Returns:
- the update manager
- Since:
- 2.0
 
- 
initprotected void init()Initializes this LightweightSystem by setting the root figure.
- 
paintInvokes this LightweightSystem'sUpdateManagerto paint this LightweightSystem's Canvas and contents.- Parameters:
- gc- the GC used for painting
- Since:
- 2.0
 
- 
setContentsSets the contents of the LightweightSystem to the passed figure. This figure should be the top-level Figure in a Draw2d application.- Parameters:
- figure- the new root figure
- Since:
- 2.0
 
- 
setControlSets the LightweightSystem's control to the passed Canvas.- Parameters:
- c- the canvas
- Since:
- 2.0
 
- 
setEventDispatcherSets this LightweightSystem's EventDispatcher.- Parameters:
- dispatcher- the new event dispatcher
- Since:
- 2.0
 
- 
setRootPaneFigureSets this LightweightSystem's root figure.- Parameters:
- root- the new root figure
 
- 
setUpdateManagerSets this LightweightSystem's UpdateManager.- Parameters:
- um- the new update manager
- Since:
- 2.0
 
 
-