Search this API

y.layout.organic
Class ShuffleLayouter

java.lang.Object
  extended by y.layout.organic.ShuffleLayouter
All Implemented Interfaces:
Layouter, LayoutStage

public class ShuffleLayouter
extends Object
implements LayoutStage

This layout stage removes node overlaps in a layout graph by using a method which is based on a famous russian arcade game.


Field Summary
static Object FIXED_NODE_DPKEY
          This key can be used to specify a minimal distance for each single node in the graph using a data provider.
static byte HOC_INTERSECTION_BOX
          Horizontal overlap criteria enumeration constant.
static byte HOC_LESS_MOVEMENT
          Horizontal overlap criteria enumeration constant.
static byte HOC_NODE_CENTER
          Horizontal overlap criteria enumeration constant.
static Object MINIMAL_DISTANCE_DPKEY
          This key can be used to specify a minimal distance for each single node in the graph using a data provider.
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
ShuffleLayouter()
          Creates a new instance of ShuffleLayouter.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be laid out by this algorithm.
 void doLayout(LayoutGraph graph)
          Performs the force transfer algorithm on the given graph after the core layouter has performed its job.
 Layouter getCoreLayouter()
          Returns the core layouter.
 byte getHorizontalOverlapCriterium()
          Gets the horizontal overlap criterion.
 double getMinimalNodeDistance()
          Returns the minimal distance between nodes that has to be obeyed by this layouter.
 boolean isBarycenterModeActive()
          Returns true if this layouter uses a barycenter based node shuffling strategy and false otherwise.
 boolean isSimpleModeActive()
          Returns whether or not simple mode is active.
 void setBarycenterModeActive(boolean barycenterModeActive)
          Specifies whether or not this layouter should use a barycenter based node shuffling strategy.
 void setCoreLayouter(Layouter l)
          Sets the core layouter.
 void setHorizontalOverlapCriterium(byte hoc)
          Sets the horizontal overlap criterion.
 void setMinimalNodeDistance(double d)
          Sets the minimal distance between nodes that has to be obeyed by this layouter.
 void setSimpleModeActive(boolean s)
          Specifies whether or not to activate a simple layout mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINIMAL_DISTANCE_DPKEY

public static final Object MINIMAL_DISTANCE_DPKEY
This key can be used to specify a minimal distance for each single node in the graph using a data provider. Note that values must be strictly positive.


FIXED_NODE_DPKEY

public static final Object FIXED_NODE_DPKEY
This key can be used to specify a minimal distance for each single node in the graph using a data provider. Note that values must be strictly positive.


HOC_INTERSECTION_BOX

public static final byte HOC_INTERSECTION_BOX
Horizontal overlap criteria enumeration constant.

See Also:
Constant Field Values

HOC_NODE_CENTER

public static final byte HOC_NODE_CENTER
Horizontal overlap criteria enumeration constant.

See Also:
Constant Field Values

HOC_LESS_MOVEMENT

public static final byte HOC_LESS_MOVEMENT
Horizontal overlap criteria enumeration constant.

See Also:
Constant Field Values
Constructor Detail

ShuffleLayouter

public ShuffleLayouter()
Creates a new instance of ShuffleLayouter.

Method Detail

doLayout

public void doLayout(LayoutGraph graph)
Performs the force transfer algorithm on the given graph after the core layouter has performed its job.

Specified by:
doLayout in interface Layouter

canLayout

public boolean canLayout(LayoutGraph graph)
Description copied from interface: Layouter
Returns true iff the given graph can be laid out by this algorithm. Calling doLayout with the given graph as its argument will only success if this method returns true.

Specified by:
canLayout in interface Layouter

setCoreLayouter

public void setCoreLayouter(Layouter l)
Sets the core layouter.

Specified by:
setCoreLayouter in interface LayoutStage

getCoreLayouter

public Layouter getCoreLayouter()
Returns the core layouter.

Specified by:
getCoreLayouter in interface LayoutStage

setHorizontalOverlapCriterium

public void setHorizontalOverlapCriterium(byte hoc)
Sets the horizontal overlap criterion. One of HOC_INTERSECTION_BOX, HOC_LESS_MOVEMENT and HOC_NODE_CENTER


getHorizontalOverlapCriterium

public byte getHorizontalOverlapCriterium()
Gets the horizontal overlap criterion. One of HOC_INTERSECTION_BOX, HOC_LESS_MOVEMENT and HOC_NODE_CENTER


setMinimalNodeDistance

public void setMinimalNodeDistance(double d)
Sets the minimal distance between nodes that has to be obeyed by this layouter.


getMinimalNodeDistance

public double getMinimalNodeDistance()
Returns the minimal distance between nodes that has to be obeyed by this layouter.


setSimpleModeActive

public void setSimpleModeActive(boolean s)
Specifies whether or not to activate a simple layout mode. When in simple mode the algorithm is very fast but the quality of the resulting layout may be poor. When not active the resulting layout is better and the running time is higher.

By default simple mode is not active.


isSimpleModeActive

public boolean isSimpleModeActive()
Returns whether or not simple mode is active.

See Also:
setSimpleModeActive(boolean)

isBarycenterModeActive

public boolean isBarycenterModeActive()
Returns true if this layouter uses a barycenter based node shuffling strategy and false otherwise.


setBarycenterModeActive

public void setBarycenterModeActive(boolean barycenterModeActive)
Specifies whether or not this layouter should use a barycenter based node shuffling strategy.


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