y.layout.organic
Class GRIP

java.lang.Object
  |
  +--y.layout.CanonicMultiStageLayouter
        |
        +--y.layout.organic.GRIP
All Implemented Interfaces:
Layouter

public class GRIP
extends CanonicMultiStageLayouter

This class implements a variant of the GRIP algorithm by P. Gajer and SG Kobourov: "Graph Drawing with Intelligent Placement". It implements ideas of the GUIDE algorithm, and fixes some bugs from the original algorithm and implementation. Additionally several important parts of the algorithm have been drastically improved. This layout is especially suited for huge diagrams, that would normally be laid out using an Organic layout. It leads to perfect results for meshlike graph structures.


Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
GRIP()
          Creates a new instance of the GRIP layout algorithm
 
Method Summary
 boolean canLayoutCore(LayoutGraph g)
          Subclasses have to provide information whether or not they can layout the given graph.
 void doLayoutCore(LayoutGraph g)
          Subclasses have to provide core layout code in this method.
 int getFinalRounds()
          returns the number of the final rounds
 int getInitialTemperature()
          returns the initial temperature
 double getLaxity()
          Getter for property laxity.
 int getPreferredEdgeLength()
          returns the desired edge length
 int getRounds()
          returns the number of the initial rounds
 boolean isDeterministic()
          Getter for property deterministic.
 boolean isNodeSizeAware()
          Getter for property nodeSizeAware.
 boolean isSmartInitialPlacement()
          Getter for property smartInitialPlacement.
 void setDeterministic(boolean deterministic)
          Setter for property deterministic.
 void setFinalRounds(int FinalRounds)
          Sets the number of Fruchtermann Reingold rounds (final)
 void setInitialTemperature(int tInit)
          Sets the inital temperature for each round.
 void setLaxity(double laxity)
          Setter for property laxity.
 void setNodeSizeAware(boolean nodeSizeAware)
          Setter for property nodeSizeAware.
 void setPreferredEdgeLength(int EdgeLength)
          sets the desired edge length
 void setRounds(int Rounds)
          Sets the number of Kamada Kawai rounds (initial)
 void setSmartInitialPlacement(boolean smartInitialPlacement)
          Setter for property smartInitialPlacement.
 
Methods inherited from class y.layout.CanonicMultiStageLayouter
appendStage, calcLayout, calcLayout, canLayout, doLayout, doLayout, enableOnlyCore, getComponentLayouter, getGroupNodeHider, getLabelLayouter, getLayoutOrientation, getOrientationLayouter, getParallelEdgeLayouter, getSelfLoopLayouter, getSubgraphLayouter, isComponentLayouterEnabled, isGroupNodeHidingEnabled, isLabelLayouterEnabled, isOrientationLayouterEnabled, isParallelEdgeLayouterEnabled, isSelfLoopLayouterEnabled, isSubgraphLayouterEnabled, prependStage, removeStage, setComponentLayouter, setComponentLayouterEnabled, setGroupNodeHider, setGroupNodeHidingEnabled, setLabelLayouter, setLabelLayouterEnabled, setLayoutOrientation, setOrientationLayouter, setOrientationLayouterEnabled, setParallelEdgeLayouter, setParallelEdgeLayouterEnabled, setSelfLoopLayouter, setSelfLoopLayouterEnabled, setSubgraphLayouter, setSubgraphLayouterEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GRIP

public GRIP()
Creates a new instance of the GRIP layout algorithm

Method Detail

canLayoutCore

public boolean canLayoutCore(LayoutGraph g)
Description copied from class: CanonicMultiStageLayouter
Subclasses have to provide information whether or not they can layout the given graph.

Specified by:
canLayoutCore in class CanonicMultiStageLayouter

setRounds

public void setRounds(int Rounds)
Sets the number of Kamada Kawai rounds (initial)

Parameters:
Rounds - the number of rounds

setFinalRounds

public void setFinalRounds(int FinalRounds)
Sets the number of Fruchtermann Reingold rounds (final)

Parameters:
FinalRounds - the number

setPreferredEdgeLength

public void setPreferredEdgeLength(int EdgeLength)
sets the desired edge length

Parameters:
EdgeLength - the length in world coordinates

setInitialTemperature

public void setInitialTemperature(int tInit)
Sets the inital temperature for each round. This value should lie somewhere in [10..80].

Parameters:
tInit - the initial temperature

getRounds

public int getRounds()
returns the number of the initial rounds

Returns:
the number of initial rounds

getFinalRounds

public int getFinalRounds()
returns the number of the final rounds

Returns:
the final rounds

getPreferredEdgeLength

public int getPreferredEdgeLength()
returns the desired edge length

Returns:
the length in world coordinate space

getInitialTemperature

public int getInitialTemperature()
returns the initial temperature

Returns:
the temperature

doLayoutCore

public void doLayoutCore(LayoutGraph g)
Description copied from class: CanonicMultiStageLayouter
Subclasses have to provide core layout code in this method.

Specified by:
doLayoutCore in class CanonicMultiStageLayouter

isSmartInitialPlacement

public boolean isSmartInitialPlacement()
Getter for property smartInitialPlacement.

Returns:
Value of property smartInitialPlacement.

setSmartInitialPlacement

public void setSmartInitialPlacement(boolean smartInitialPlacement)
Setter for property smartInitialPlacement.

Parameters:
smartInitialPlacement - New value of property smartInitialPlacement.

isDeterministic

public boolean isDeterministic()
Getter for property deterministic.

Returns:
Value of property deterministic.

setDeterministic

public void setDeterministic(boolean deterministic)
Setter for property deterministic.

Parameters:
deterministic - New value of property deterministic.

getLaxity

public double getLaxity()
Getter for property laxity.

Returns:
Value of property laxity.

setLaxity

public void setLaxity(double laxity)
Setter for property laxity.

Parameters:
laxity - New value of property laxity.

isNodeSizeAware

public boolean isNodeSizeAware()
Getter for property nodeSizeAware.

Returns:
Value of property nodeSizeAware.

setNodeSizeAware

public void setNodeSizeAware(boolean nodeSizeAware)
Setter for property nodeSizeAware. If set to true, the algorithm is aware of the average node size and takes it into account.

Parameters:
nodeSizeAware - New value of property nodeSizeAware.

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

2003