public class DeferredUpdateManager extends UpdateManager
| Modifier and Type | Class and Description |
|---|---|
protected class |
DeferredUpdateManager.UpdateRequest
Calls
performUpdate(). |
| Constructor and Description |
|---|
DeferredUpdateManager()
Empty constructor.
|
DeferredUpdateManager(GraphicsSource gs)
Constructs a new DererredUpdateManager with the given GraphicsSource.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDirtyRegion(IFigure figure,
int x,
int y,
int w,
int h)
Adds a dirty region (defined by the rectangle x, y, w, h) to the
update queue.
|
void |
addInvalidFigure(IFigure f)
Adds the given figure to the update queue.
|
protected Graphics |
getGraphics(Rectangle region)
Returns a Graphics object for the given region.
|
protected void |
paint(GC gc)
Invoked by the
LightweightSystem (
LightweightSystem.paint(GC)) to have the update manger paint its
contents. |
void |
performUpdate()
Performs the update.
|
void |
performUpdate(Rectangle exposed)
Adds the given exposed region to the update queue and then performs the
update.
|
void |
performValidation()
Performs a partial update if supported (validation only).
|
protected void |
queueWork()
Posts an
DeferredUpdateManager.UpdateRequest using Display.asyncExec(Runnable). |
protected void |
releaseGraphics(Graphics graphics)
Releases the graphics object, which causes the GraphicsSource to flush.
|
protected void |
repairDamage()
Repaints the dirty regions on the update queue and calls
UpdateManager.firePainting(Rectangle, Map), unless there are no
dirty regions. |
void |
runWithUpdate(java.lang.Runnable runnable)
Adds the given runnable and queues an update if an update is not under
progress.
|
protected void |
sendUpdateRequest()
Fires the
UpdateRequest to the current display
asynchronously. |
void |
setGraphicsSource(GraphicsSource gs)
Sets the graphics source.
|
void |
setRoot(IFigure figure)
Sets the root figure.
|
protected void |
validateFigures()
Validates all invalid figures on the update queue and calls
UpdateManager.fireValidating() unless there are no invalid
figures. |
addDirtyRegion, addUpdateListener, dispose, firePainting, fireValidating, isDisposed, removeUpdateListenerpublic DeferredUpdateManager()
public DeferredUpdateManager(GraphicsSource gs)
gs - the graphics sourcepublic void addDirtyRegion(IFigure figure, int x, int y, int w, int h)
addDirtyRegion in class UpdateManagerfigure - the figure that contains the dirty regionx - the x coordinate of the dirty regiony - the y coordinate of the dirty regionw - the width of the dirty regionh - the height of the dirty regionpublic void addInvalidFigure(IFigure f)
addInvalidFigure in class UpdateManagerf - the invalid figureprotected Graphics getGraphics(Rectangle region)
region - the region to be repaintedprotected void paint(GC gc)
UpdateManagerLightweightSystem (
LightweightSystem.paint(GC)) to have the update manger paint its
contents. Delegates to UpdateManager.performUpdate(Rectangle) with the passed
in gc's clipping region (GC.getClipping()) by default. Subclasses
may override if they need to access the GC for updating.paint in class UpdateManagergc - The GC to be used for updatingpublic void performUpdate()
performUpdate in class UpdateManagervalidateFigures(),
repairDamage()public void performValidation()
UpdateManagerUpdateManager.performUpdate(). Subclasses should override
this method to support validation without repainting.performValidation in class UpdateManagerUpdateManager.performValidation()public void performUpdate(Rectangle exposed)
performUpdate in class UpdateManagerexposed - the exposed regionprotected void queueWork()
DeferredUpdateManager.UpdateRequest using Display.asyncExec(Runnable).
If work has already been queued, a new request is not needed.protected void sendUpdateRequest()
UpdateRequest to the current display
asynchronously.protected void releaseGraphics(Graphics graphics)
graphics - the graphics objectprotected void repairDamage()
UpdateManager.firePainting(Rectangle, Map), unless there are no
dirty regions.public void runWithUpdate(java.lang.Runnable runnable)
runWithUpdate in class UpdateManagerrunnable - the runnablepublic void setGraphicsSource(GraphicsSource gs)
setGraphicsSource in class UpdateManagergs - the graphics sourcepublic void setRoot(IFigure figure)
setRoot in class UpdateManagerfigure - the root figureprotected void validateFigures()
UpdateManager.fireValidating() unless there are no invalid
figures.Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.