public class LightweightSystem
extends java.lang.Object
Figures
to be hosted on an SWT
Canvas.
Normal procedure for using a LightweightSystem:
Modifier and Type | Class and Description |
---|---|
protected class |
LightweightSystem.EventHandler
Listener used to get all necessary events from the Canvas and pass them
on to the
EventDispatcher . |
protected class |
LightweightSystem.RootFigure
The figure at the root of the LightweightSystem.
|
Constructor and Description |
---|
LightweightSystem()
Constructs a LightweightSystem without a Canvas.
|
LightweightSystem(Canvas c)
Constructs a LightweightSystem on Canvas c.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addListeners()
Adds SWT listeners to the LightWeightSystem's Canvas.
|
protected void |
controlResized()
Resizes and revalidates the root figure when the control is resized.
|
protected LightweightSystem.EventHandler |
createEventHandler()
Returns a new instance of this LightweightSystem's EventHandler.
|
protected LightweightSystem.RootFigure |
createRootFigure()
Creates and returns the root figure.
|
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()
Initializes this LightweightSystem by setting the root figure.
|
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.
|
protected void |
setRootPaneFigure(LightweightSystem.RootFigure root)
Sets this LightweightSystem's root figure.
|
void |
setUpdateManager(UpdateManager um)
Sets this LightweightSystem's UpdateManager.
|
public LightweightSystem(Canvas c)
c
- the canvaspublic LightweightSystem()
protected void addListeners()
EventDispatcher
.
WARNING: This method should not be overridden.
protected void controlResized()
protected EventDispatcher getEventDispatcher()
public IFigure getRootFigure()
protected final LightweightSystem.EventHandler createEventHandler()
protected LightweightSystem.RootFigure createRootFigure()
public UpdateManager getUpdateManager()
protected void init()
public void paint(GC gc)
UpdateManager
to paint this
LightweightSystem's Canvas and contents.gc
- the GC used for paintingpublic void setContents(IFigure figure)
figure
- the new root figurepublic void setControl(Canvas c)
c
- the canvaspublic void setEventDispatcher(EventDispatcher dispatcher)
dispatcher
- the new event dispatcherprotected void setRootPaneFigure(LightweightSystem.RootFigure root)
root
- the new root figurepublic void setUpdateManager(UpdateManager um)
um
- the new update managerCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.