Package org.eclipse.draw2d
Class DeferredUpdateManager
java.lang.Object
org.eclipse.draw2d.UpdateManager
org.eclipse.draw2d.DeferredUpdateManager
An UpdateManager that asynchronously updates the affected figures.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionEmpty constructor.Constructs a new DererredUpdateManager with the given GraphicsSource.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddDirtyRegion(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.voidAdds the given figure to the update queue.protected GraphicsgetGraphics(Rectangle region) Returns a Graphics object for the given region.protected voidInvoked by theLightweightSystem(LightweightSystem.paint(GC)) to have the update manger paint its contents.voidPerforms the update.voidperformUpdate(Rectangle exposed) Adds the given exposed region to the update queue and then performs the update.voidPerforms a partial update if supported (validation only).protected voidPosts anDeferredUpdateManager.UpdateRequestusingDisplay.asyncExec(Runnable).protected voidreleaseGraphics(Graphics graphics) Releases the graphics object, which causes the GraphicsSource to flush.protected voidRepaints the dirty regions on the update queue and callsUpdateManager.firePainting(Rectangle, Map), unless there are no dirty regions.voidrunWithUpdate(Runnable runnable) Adds the given runnable and queues an update if an update is not under progress.protected voidFires theUpdateRequestto the current display asynchronously.voidSets the graphics source.voidsetRefreshRate(int refreshRate) Sets the rate with paint requests are executed.voidSets the root figure.protected voidValidates all invalid figures on the update queue and callsUpdateManager.fireValidating()unless there are no invalid figures.Methods inherited from class org.eclipse.draw2d.UpdateManageraddDirtyRegion, addUpdateListener, dispose, firePainting, fireValidating, isDisposed, removeUpdateListener
- 
Constructor Details- 
DeferredUpdateManagerpublic DeferredUpdateManager()Empty constructor.
- 
DeferredUpdateManagerConstructs a new DererredUpdateManager with the given GraphicsSource.- Parameters:
- gs- the graphics source
 
 
- 
- 
Method Details- 
addDirtyRegionAdds a dirty region (defined by the rectangle x, y, w, h) to the update queue. If the figure isn't visible or either the width or height are 0, the method returns without queueing the dirty region.- Specified by:
- addDirtyRegionin class- UpdateManager
- Parameters:
- figure- the figure that contains the dirty region
- x- the x coordinate of the dirty region
- y- the y coordinate of the dirty region
- w- the width of the dirty region
- h- the height of the dirty region
 
- 
addInvalidFigureAdds the given figure to the update queue. Invalid figures will be validated before the damaged regions are repainted.- Specified by:
- addInvalidFigurein class- UpdateManager
- Parameters:
- f- the invalid figure
 
- 
getGraphicsReturns a Graphics object for the given region.- Parameters:
- region- the region to be repainted
- Returns:
- the Graphics object
 
- 
paintDescription copied from class:UpdateManagerInvoked by theLightweightSystem(LightweightSystem.paint(GC)) to have the update manger paint its contents. Delegates toUpdateManager.performUpdate(Rectangle)with the passed in gc's clipping region (GC.getClipping()) by default. Subclasses may override if they need to access theGCfor updating.- Overrides:
- paintin class- UpdateManager
- Parameters:
- gc- The- GCto be used for updating
- Since:
- 3.10
 
- 
performUpdatepublic void performUpdate()Performs the update. Validates the invalid figures and then repaints the dirty regions.- Specified by:
- performUpdatein class- UpdateManager
- See Also:
 
- 
performValidationpublic void performValidation()Description copied from class:UpdateManagerPerforms a partial update if supported (validation only). Fires notification to listeners that validation has been performed. By default this method callsUpdateManager.performUpdate(). Subclasses should override this method to support validation without repainting.- Overrides:
- performValidationin class- UpdateManager
- See Also:
 
- 
performUpdateAdds the given exposed region to the update queue and then performs the update.- Specified by:
- performUpdatein class- UpdateManager
- Parameters:
- exposed- the exposed region
 
- 
queueWorkprotected void queueWork()Posts anDeferredUpdateManager.UpdateRequestusingDisplay.asyncExec(Runnable). If work has already been queued, a new request is not needed.
- 
sendUpdateRequestprotected void sendUpdateRequest()Fires theUpdateRequestto the current display asynchronously.- Since:
- 3.2
 
- 
releaseGraphicsReleases the graphics object, which causes the GraphicsSource to flush.- Parameters:
- graphics- the graphics object
 
- 
repairDamageprotected void repairDamage()Repaints the dirty regions on the update queue and callsUpdateManager.firePainting(Rectangle, Map), unless there are no dirty regions.
- 
runWithUpdateAdds the given runnable and queues an update if an update is not under progress.- Overrides:
- runWithUpdatein class- UpdateManager
- Parameters:
- runnable- the runnable
 
- 
setGraphicsSourceSets the graphics source.- Specified by:
- setGraphicsSourcein class- UpdateManager
- Parameters:
- gs- the graphics source
 
- 
setRootSets the root figure.- Specified by:
- setRootin class- UpdateManager
- Parameters:
- figure- the root figure
 
- 
setRefreshRatepublic void setRefreshRate(int refreshRate) Sets the rate with paint requests are executed. If set to either0or a negative value, requests are executed as fast as possible (default behavior), otherwise everyrefreshRatems. Example:setRefreshRate(500); // Paints every 500ms - Parameters:
- refreshRate- The rate with which paint requests are executed.
- Since:
- 3.18
 
- 
validateFiguresprotected void validateFigures()Validates all invalid figures on the update queue and callsUpdateManager.fireValidating()unless there are no invalid figures.
 
-