Eclipse Draw2d
2.1

org.eclipse.draw2d
Class UpdateManager

java.lang.Object
  |
  +--org.eclipse.draw2d.UpdateManager
Direct Known Subclasses:
DeferredUpdateManager, SubordinateUpdateManager

public abstract class UpdateManager
extends Object

Update managers handle the job of repainting and laying out figures. A desirable implementation is one that batches work to be done and collapses any redundant work. Update managers may contain 0 or more nested update managers. Some optimizations can only be performed after all requests have been batched. For this reason, an UpdateManager should call performUpdate() on its nested UpdateManagers prior to doing its own update. During the nested updates, new requests may be added.


Constructor Summary
UpdateManager()
           
 
Method Summary
abstract  void addDirtyRegion(IFigure figure, int x, int y, int w, int h)
          Adds the dirty region defined by the coordinates on the IFigure figure.
 void addDirtyRegion(IFigure figure, Rectangle rect)
           
abstract  void addInvalidFigure(IFigure figure)
          The receiver should call validate() on the IFigure figure in a timely fashion.
 void addUpdateListener(UpdateListener listener)
          Adds the given listener to the list of listeners to be notified of painting and validation.
 void dispose()
          Called when the EditPartViewer is being disposed.
protected  void firePainting(Rectangle damage, Map dirtyRegions)
          Notifies listeners that painting is about to occur, passing them the damaged rectangle and the map of dirty regions.
protected  void fireValidating()
          Notifies listeners that validation is about to occur.
protected  boolean isDisposed()
           
abstract  void performUpdate()
          Performs the update.
abstract  void performUpdate(Rectangle exposed)
          Performs an update on the given exposed rectangle.
 void removeUpdateListener(UpdateListener listener)
          Removes the given UpdateListener.
abstract  void setGraphicsSource(GraphicsSource gs)
          Sets the GraphicsSource for this update manager.
abstract  void setRoot(IFigure figure)
          Sets the root figure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateManager

public UpdateManager()
Method Detail

addDirtyRegion

public abstract void addDirtyRegion(IFigure figure,
                                    int x,
                                    int y,
                                    int w,
                                    int h)
Adds the dirty region defined by the coordinates on the IFigure figure. The update manager should repaint the dirty region in a timely fashion.

Parameters:
figure - the dirty figure
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

addDirtyRegion

public void addDirtyRegion(IFigure figure,
                           Rectangle rect)
See Also:
addDirtyRegion(IFigure, int, int, int, int)

addInvalidFigure

public abstract void addInvalidFigure(IFigure figure)
The receiver should call validate() on the IFigure figure in a timely fashion.

Parameters:
figure - the invalid figure

addUpdateListener

public void addUpdateListener(UpdateListener listener)
Adds the given listener to the list of listeners to be notified of painting and validation.

Parameters:
listener - the listener

dispose

public void dispose()
Called when the EditPartViewer is being disposed.


firePainting

protected void firePainting(Rectangle damage,
                            Map dirtyRegions)
Notifies listeners that painting is about to occur, passing them the damaged rectangle and the map of dirty regions.

Parameters:
damage - the damaged rectangle
dirtyRegions - map of dirty regions to figures

fireValidating

protected void fireValidating()
Notifies listeners that validation is about to occur.


isDisposed

protected boolean isDisposed()
Returns:
whether this update manager has been disposed.

performUpdate

public abstract void performUpdate()
Performs the update.


performUpdate

public abstract void performUpdate(Rectangle exposed)
Performs an update on the given exposed rectangle.

Parameters:
exposed - the exposed rectangle

removeUpdateListener

public void removeUpdateListener(UpdateListener listener)
Removes the given UpdateListener.

Parameters:
listener - the listener

setGraphicsSource

public abstract void setGraphicsSource(GraphicsSource gs)
Sets the GraphicsSource for this update manager.

Parameters:
gs - the new GraphicsSource

setRoot

public abstract void setRoot(IFigure figure)
Sets the root figure.

Parameters:
figure - the new root figure

Eclipse Draw2d
2.1

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