diva.graph.layout
Class IncrLayoutAdapter

java.lang.Object
  extended by diva.graph.layout.IncrLayoutAdapter
All Implemented Interfaces:
GlobalLayout, IncrementalLayout

public class IncrLayoutAdapter
extends java.lang.Object
implements IncrementalLayout

An adapter to make global layouts incremental. This class just calls a global layout on every change to the graph.

Version:
$Id: IncrLayoutAdapter.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Michael Shilman
Accepted Rating:
Red

Field Summary
private  GlobalLayout _layout
           
private  LayoutTarget _target
           
 
Constructor Summary
IncrLayoutAdapter(GlobalLayout global)
          Construct a new adapter that uses the given global layout for every change in the graph, and operates within the context of the given layout target.
 
Method Summary
 void edgeDrawn(java.lang.Object edge)
          Called in response to the edge head being changed.
 void edgeRouted(java.lang.Object edge)
          Called in response to the edge tail being changed.
 LayoutTarget getLayoutTarget()
          Return the layout target.
 void layout(java.lang.Object composite)
          Call the global layout on the graph.
 void nodeDrawn(java.lang.Object node)
          Called in response to the given node being added.
 void nodeMoved(java.lang.Object node)
          Called in response to the given node being moved.
 void setLayoutTarget(LayoutTarget target)
          Set the layout target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_target

private LayoutTarget _target

_layout

private GlobalLayout _layout
Constructor Detail

IncrLayoutAdapter

public IncrLayoutAdapter(GlobalLayout global)
Construct a new adapter that uses the given global layout for every change in the graph, and operates within the context of the given layout target.

Method Detail

nodeDrawn

public void nodeDrawn(java.lang.Object node)
Called in response to the given node being added.

Specified by:
nodeDrawn in interface IncrementalLayout

nodeMoved

public void nodeMoved(java.lang.Object node)
Called in response to the given node being moved.

Specified by:
nodeMoved in interface IncrementalLayout

edgeDrawn

public void edgeDrawn(java.lang.Object edge)
Called in response to the edge head being changed.

Specified by:
edgeDrawn in interface IncrementalLayout

edgeRouted

public void edgeRouted(java.lang.Object edge)
Called in response to the edge tail being changed.

Specified by:
edgeRouted in interface IncrementalLayout

getLayoutTarget

public LayoutTarget getLayoutTarget()
Return the layout target.

Specified by:
getLayoutTarget in interface GlobalLayout

setLayoutTarget

public void setLayoutTarget(LayoutTarget target)
Set the layout target.

Specified by:
setLayoutTarget in interface GlobalLayout

layout

public void layout(java.lang.Object composite)
Call the global layout on the graph.

Specified by:
layout in interface GlobalLayout