y.view
Class Graph2DViewRepaintManager

java.lang.Object
  extended by y.view.Graph2DViewRepaintManager
All Implemented Interfaces:
AnimationListener

public class Graph2DViewRepaintManager
extends Object
implements AnimationListener

This class triggers repaints in a Graph2DView, that affect only the unified bounds of registered graph objects.

See Also:
add(Drawable), add(EdgeRealizer), add(NodeRealizer)
 
Your browser does not support SVG content.

Constructor Summary
Graph2DViewRepaintManager(Graph2DView view)
          Constructs a new Graph2DViewRepaintManager for the specified Graph2DView.
 
Method Summary
 void add(Drawable drawable)
          Adds the specified Drawable to this manager's list of graph objects.
 void add(EdgeRealizer edge)
          Adds the specified EdgeRealizer to this manager's list of graph objects.
 void add(NodeRealizer node)
          Adds the specified NodeRealizer to this manager's list of graph objects.
 void animationPerformed(AnimationEvent e)
          Triggers update for the appropriate events.
 boolean getForceGlobalUpdate()
          Returns true if this Graph2DViewRepaintManager forces its view to repaint completely.
 Graph2DView getView()
          Returns the Graph2DView, for which this Graph2DViewRepaintManager was created.
 void invalidate()
          Forces the manager to update all of its view's contents on the next call to update.
 void remove(Drawable drawable)
          Removes the specified Drawable from this manager's list of graph objects.
 void remove(EdgeRealizer edge)
          Removes the specified EdgeRealizer from this manager's list of graph objects.
 void remove(NodeRealizer node)
          Removes the specified NodeRealizer from this manager's list of graph objects.
 void removeAll()
          Removes all registered Drawables, NodeRealizers and EdgeRealizers from this manager's list of graph objects.
 void setForceGlobalUpdate(boolean forceGlobalUpdate)
          Specifies whether this Graph2DViewRepaintManager forces its view to repaint completely.
 void update()
          Forces this manager's view to repaint the union of bounds of the currently registered graph objects.
 void updateView()
          Forces this manager's view to repaint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graph2DViewRepaintManager

public Graph2DViewRepaintManager(Graph2DView view)
Constructs a new Graph2DViewRepaintManager for the specified Graph2DView.

Parameters:
view - the Graph2DView
Method Detail

getView

public Graph2DView getView()
Returns the Graph2DView, for which this Graph2DViewRepaintManager was created.

Returns:
the Graph2DView, for which this Graph2DViewRepaintManager was created

add

public void add(Drawable drawable)
Adds the specified Drawable to this manager's list of graph objects.

Parameters:
drawable - the Drawable

remove

public void remove(Drawable drawable)
Removes the specified Drawable from this manager's list of graph objects.

Parameters:
drawable - the Drawable

add

public void add(EdgeRealizer edge)
Adds the specified EdgeRealizer to this manager's list of graph objects.

Parameters:
edge - the EdgeRealizer

remove

public void remove(EdgeRealizer edge)
Removes the specified EdgeRealizer from this manager's list of graph objects.

Parameters:
edge - the EdgeRealizer

add

public void add(NodeRealizer node)
Adds the specified NodeRealizer to this manager's list of graph objects.

Parameters:
node - the NodeRealizer

remove

public void remove(NodeRealizer node)
Removes the specified NodeRealizer from this manager's list of graph objects.

Parameters:
node - the NodeRealizer
See Also:
add(Drawable), add(NodeRealizer), add(EdgeRealizer)

removeAll

public void removeAll()
Removes all registered Drawables, NodeRealizers and EdgeRealizers from this manager's list of graph objects.


animationPerformed

public void animationPerformed(AnimationEvent e)
Triggers update for the appropriate events.

Specified by:
animationPerformed in interface AnimationListener
See Also:
update()

invalidate

public void invalidate()
Forces the manager to update all of its view's contents on the next call to update.

See Also:
update()

updateView

public void updateView()
Forces this manager's view to repaint.


update

public void update()
Forces this manager's view to repaint the union of bounds of the currently registered graph objects. If forceGlobalUpdate is set to true, calling this method has the same effect as calling updateView. If the repaint manager has no elements registered or update is called for the first time, the complete view is being updated.

See Also:
updateView(), setForceGlobalUpdate(boolean)

getForceGlobalUpdate

public boolean getForceGlobalUpdate()
Returns true if this Graph2DViewRepaintManager forces its view to repaint completely.

Returns:
true if this Graph2DViewRepaintManager forces its view to repaint completely.

setForceGlobalUpdate

public void setForceGlobalUpdate(boolean forceGlobalUpdate)
Specifies whether this Graph2DViewRepaintManager forces its view to repaint completely.

Parameters:
forceGlobalUpdate - if true, this Graph2DViewRepaintManager forces its view to repaint completely

© Copyright 2000-2008,
yWorks GmbH.
All rights reserved.