diva.graph.layout
Interface LayoutTarget

All Known Implementing Classes:
BasicGraphFrame.PtolemyLayoutTarget, BasicLayoutTarget

public interface LayoutTarget

The basic set of information necessary to layout a graph: a mapping the graph data structure to aspects of its visual representation, a viewport to layout in, and some manipulation routines including pick, place, and route.

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

Method Summary
 java.awt.geom.Rectangle2D getBounds(java.lang.Object node)
          Return the bounds of the figure associated with the given node in the target's view.
 GraphModel getGraphModel()
          Return the graph model that provides a traversal interface to the graph I'm trying to layout.
 java.awt.geom.Rectangle2D getViewport(java.lang.Object composite)
          Return the viewport of the given graph as a rectangle in logical coordinates.
 java.lang.Object getVisualObject(java.lang.Object object)
          Return the visual object of the given graph object.
 java.util.Iterator intersectingEdges(java.awt.geom.Rectangle2D r)
          Return an iterator over nodes in the view which intersect the given rectangle.
 java.util.Iterator intersectingNodes(java.awt.geom.Rectangle2D r)
          Return an iterator over edges in the view which intersect the given rectangle.
 boolean isEdgeVisible(java.lang.Object edge)
          Return whether or not the given edge is actually visible in the view.
 boolean isNodeVisible(java.lang.Object node)
          Return whether or not the given node is actually visible in the view.
 void route(java.lang.Object edge)
          Route absolutely the figure associated with the given edge in the target's view.
 void translate(java.lang.Object node, double dx, double dy)
          Translate the figure associated with the given node in the target's view by the given delta.
 

Method Detail

getBounds

java.awt.geom.Rectangle2D getBounds(java.lang.Object node)
Return the bounds of the figure associated with the given node in the target's view.


getGraphModel

GraphModel getGraphModel()
Return the graph model that provides a traversal interface to the graph I'm trying to layout.


getVisualObject

java.lang.Object getVisualObject(java.lang.Object object)
Return the visual object of the given graph object. Note that the purpose of a layout target is to abstract away the visual object and using this method breaks that abstraction.


getViewport

java.awt.geom.Rectangle2D getViewport(java.lang.Object composite)
Return the viewport of the given graph as a rectangle in logical coordinates.


isNodeVisible

boolean isNodeVisible(java.lang.Object node)
Return whether or not the given node is actually visible in the view.


isEdgeVisible

boolean isEdgeVisible(java.lang.Object edge)
Return whether or not the given edge is actually visible in the view.


intersectingNodes

java.util.Iterator intersectingNodes(java.awt.geom.Rectangle2D r)
Return an iterator over edges in the view which intersect the given rectangle.


intersectingEdges

java.util.Iterator intersectingEdges(java.awt.geom.Rectangle2D r)
Return an iterator over nodes in the view which intersect the given rectangle.


route

void route(java.lang.Object edge)
Route absolutely the figure associated with the given edge in the target's view.


translate

void translate(java.lang.Object node,
               double dx,
               double dy)
Translate the figure associated with the given node in the target's view by the given delta.