ptolemy.vergil.basic
Class BasicGraphFrame.PtolemyLayout

java.lang.Object
  extended by diva.graph.layout.AbstractGlobalLayout
      extended by diva.graph.layout.LevelLayout
          extended by ptolemy.vergil.basic.BasicGraphFrame.PtolemyLayout
All Implemented Interfaces:
GlobalLayout
Enclosing class:
BasicGraphFrame

private static class BasicGraphFrame.PtolemyLayout
extends LevelLayout

A layout algorithm for laying out ptolemy graphs. Since our edges are undirected, this layout algorithm turns them into directed edges aimed consistently. i.e. An edge should always be "out" of an internal output port and always be "in" of an internal input port. Conversely, an edge is "out" of an external input port, and "in" of an external output port. The copying operation also flattens the graph, because the level layout algorithm doesn't understand how to layout hierarchical nodes.


Nested Class Summary
 
Nested classes/interfaces inherited from class diva.graph.layout.LevelLayout
LevelLayout.LevelData, LevelLayout.LevelInfo
 
Field Summary
 
Fields inherited from class diva.graph.layout.LevelLayout
_orientation, HORIZONTAL, VERTICAL
 
Constructor Summary
BasicGraphFrame.PtolemyLayout(LayoutTarget target)
          Construct a new levelizing layout with a vertical orientation.
 
Method Summary
private  java.lang.Object _getParentInGraph(GraphModel model, java.lang.Object graph, java.lang.Object node)
           
protected  java.lang.Object copyComposite(java.lang.Object origComposite)
          Copy the given graph and make the nodes/edges in the copied graph point to the nodes/edges in the original.
 
Methods inherited from class diva.graph.layout.LevelLayout
applyLayout, applyLayout, calculateLayout, copyLayout, getLocalGraphModel, getOrientation, getRandomizedPlacement, isVisited, layout, setAllVisited, setOrientation, setRandomizedPlacement, setVisited
 
Methods inherited from class diva.graph.layout.AbstractGlobalLayout
getLayoutTarget, setLayoutTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicGraphFrame.PtolemyLayout

public BasicGraphFrame.PtolemyLayout(LayoutTarget target)
Construct a new levelizing layout with a vertical orientation.

Method Detail

copyComposite

protected java.lang.Object copyComposite(java.lang.Object origComposite)
Copy the given graph and make the nodes/edges in the copied graph point to the nodes/edges in the original.

Overrides:
copyComposite in class LevelLayout

_getParentInGraph

private java.lang.Object _getParentInGraph(GraphModel model,
                                           java.lang.Object graph,
                                           java.lang.Object node)