Eclipse Draw2d 3.2

## org.eclipse.draw2d
Class DeferredUpdateManager

    java.lang.Object
      org.eclipse.draw2d.UpdateManager
          org.eclipse.draw2d.DeferredUpdateManager

public class DeferredUpdateManager
extends UpdateManager

An UpdateManager that asynchronously updates the affected figures.

Nested Class Summary
`protected class` `DeferredUpdateManager.UpdateRequest` Calls `performUpdate()`.

Constructor Summary
`DeferredUpdateManager()` Empty constructor.
`DeferredUpdateManager(GraphicsSource gs)` Constructs a new DererredUpdateManager with the given GraphicsSource.

Method Summary
`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.
`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(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.

Methods inherited from class org.eclipse.draw2d.UpdateManager
`addDirtyRegion, addUpdateListener, dispose, firePainting, fireValidating, isDisposed, removeUpdateListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DeferredUpdateManager

    public DeferredUpdateManager()

  Empty constructor.

### DeferredUpdateManager

    public DeferredUpdateManager(GraphicsSource gs)

  Constructs a new DererredUpdateManager with the given GraphicsSource.

Parameters:
  `gs` - the graphics source

Method Detail

### addDirtyRegion

    public 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. If the figure isn't visible or either the width or height are 0, the method returns without queueing the dirty region.

  Specified by:
    `addDirtyRegion` in 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

### addInvalidFigure

    public void addInvalidFigure(IFigure f)

  Adds the given figure to the update queue. Invalid figures will be validated before the damaged regions are repainted.

  Specified by:
    `addInvalidFigure` in class `UpdateManager`
  Parameters:
    `f` - the invalid figure

### getGraphics

    protected Graphics getGraphics(Rectangle region)

  Returns a Graphics object for the given region.

  Parameters:
    `region` - the region to be repainted
  Returns:
    the Graphics object

### performUpdate

    public void performUpdate()

  Performs the update. Validates the invalid figures and then repaints the dirty regions.

  Specified by:
    `performUpdate` in class `UpdateManager`
  See Also:
    `validateFigures()`, `repairDamage()`

### performValidation

    public void performValidation()

  Description copied from class: `UpdateManager`
  Performs a partial update if supported (validation only). Fires notification to listeners that validation has been performed. By default this method calls `UpdateManager.performUpdate()`. Subclasses should override this method to support validation without repainting.

  Overrides:
    `performValidation` in class `UpdateManager`
  See Also:
    `UpdateManager.performValidation()`

### performUpdate

    public void performUpdate(Rectangle exposed)

  Adds the given exposed region to the update queue and then performs the update.

  Specified by:
    `performUpdate` in class `UpdateManager`
  Parameters:
    `exposed` - the exposed region

### queueWork

    protected void queueWork()

  Posts an `DeferredUpdateManager.UpdateRequest` using `Display.asyncExec(Runnable)`. If work has already been queued, a new request is not needed.

### sendUpdateRequest

    protected void sendUpdateRequest()

  Fires the `UpdateRequest` to the current display asynchronously.

  Since:
    3.2

### releaseGraphics

    protected void releaseGraphics(Graphics graphics)

  Releases the graphics object, which causes the GraphicsSource to flush.

  Parameters:
    `graphics` - the graphics object

### repairDamage

    protected void repairDamage()

  Repaints the dirty regions on the update queue and calls `UpdateManager.firePainting(Rectangle, Map)`, unless there are no dirty regions.

### runWithUpdate

    public void runWithUpdate(Runnable runnable)

  Adds the given runnable and queues an update if an update is not under progress.

  Overrides:
    `runWithUpdate` in class `UpdateManager`
  Parameters:
    `runnable` - the runnable

### setGraphicsSource

    public void setGraphicsSource(GraphicsSource gs)

  Sets the graphics source.

  Specified by:
    `setGraphicsSource` in class `UpdateManager`
  Parameters:
    `gs` - the graphics source

### setRoot

    public void setRoot(IFigure figure)

  Sets the root figure.

  Specified by:
    `setRoot` in class `UpdateManager`
  Parameters:
    `figure` - the root figure

### validateFigures

    protected void validateFigures()

  Validates all invalid figures on the update queue and calls `UpdateManager.fireValidating()` unless there are no invalid figures.

Eclipse Draw2d 3.2

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