Search this API

y.layout.organic
Class GRIP

java.lang.Object
  extended by y.layout.CanonicMultiStageLayouter
      extended by 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 mesh-like 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()
          Returns the current laxity value.
 int getPreferredEdgeLength()
          returns the desired edge length
 int getRounds()
          returns the number of the initial rounds
 boolean isDeterministic()
          Returns whether or not GRIP works in a deterministic manner.
 boolean isNodeSizeAware()
          Returns whether or not GRIP takes average node sizes into account.
 boolean isSmartInitialPlacement()
          Returns whether or not initial placements are determined in a smart way.
 void setDeterministic(boolean deterministic)
          Specifies whether or not GRIP works in a deterministic manner.
 void setFinalRounds(int FinalRounds)
          Sets the number of Fruchtermann Reingold rounds (final)
 void setInitialTemperature(int tInit)
          Sets the initial temperature for each round.
 void setLaxity(double laxity)
          Specifies the current laxity value.
 void setNodeSizeAware(boolean nodeSizeAware)
          Specifies whether or not GRIP takes average node sizes into account.
 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)
          Specifies whether or not initial placements are determined in a smart way.
 
Methods inherited from class y.layout.CanonicMultiStageLayouter
appendStage, calcLayout, calcLayout, canLayout, checkGroupNodeSize, checkNodeSize, 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 initial 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()
Returns whether or not initial placements are determined in a smart way.


setSmartInitialPlacement

public void setSmartInitialPlacement(boolean smartInitialPlacement)
Specifies whether or not initial placements are determined in a smart way.


isDeterministic

public boolean isDeterministic()
Returns whether or not GRIP works in a deterministic manner.


setDeterministic

public void setDeterministic(boolean deterministic)
Specifies whether or not GRIP works in a deterministic manner.


getLaxity

public double getLaxity()
Returns the current laxity value.

Returns:
the current laxity value.

setLaxity

public void setLaxity(double laxity)
Specifies the current laxity value.

Parameters:
laxity - the current laxity value.

isNodeSizeAware

public boolean isNodeSizeAware()
Returns whether or not GRIP takes average node sizes into account.


setNodeSizeAware

public void setNodeSizeAware(boolean nodeSizeAware)
Specifies whether or not GRIP takes average node sizes into account.

Parameters:
nodeSizeAware - if true, the algorithm is aware of the average node size and takes it into account.

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