org.graffiti.plugins.algorithms.reingoldtilford
Enum LevellingPolicy

java.lang.Object
  extended by java.lang.Enum<LevellingPolicy>
      extended by org.graffiti.plugins.algorithms.reingoldtilford.LevellingPolicy
All Implemented Interfaces:
Serializable, Comparable<LevellingPolicy>

public enum LevellingPolicy
extends Enum<LevellingPolicy>

LevellingPolicy determines the y-coordinate at which each Node is placed. The y-coordinate may be calculated individually for each Node or be restricted to certain values (levels). The level to which each nodes belongs depends on its depth (number of edges of the simple path connecting the node and the root) in the tree. Each levelling policy consists of a name and a LevellingStrategy that does the actual calculations.

To provide a new levelling policy, create a class extending LevellingStrategy and add a new member to this enumeration.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner
See Also:
ReingoldTilfordAlgorithm

Enum Constant Summary
FIXED_PARAMETER_ADJUST_INDIVIDUAL
          All levels are of equal distance, which is determined by parameter; if a node does not fit in the space between two levels, all nodes of the subtree of that node are moved to consecutive levels until there are no intersecting nodes or edges.
FIXED_PARAMETER_ADJUST_LEVEL
          All levels are of equal distance, which is determined by parameter; if a node does not fit in the space betweeen two levels, the affected levels are skipped by all nodes in the tree so that no nodes or edges intersect but nodes of the same depth are still placed at the same level.
FIXED_PARAMETER_IGNORE
          All levels are of equal distance, which is determined by parameter; nodes at the same depth are placed at the same level, even if a node does not fit into the space between the levels.
GLOBALLY_HIGHEST_NODE
          All levels are of equal distance, which is determined by the highest node of the tree.
HIGHEST_NODE
          The distance between each level is determined by the highest node of the respective depth.
LOCAL
          Individual y-coordinates for each Node.
 
Method Summary
 LevellingStrategy createLevellingStrategy(double parameter, double verticalNodeDistance)
          Creates a new instance of the subclass of LevellingStrategy employed by this enumeration member.
static List<String> getNames()
          Returns the names of the policies.
static LevellingPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static LevellingPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

LOCAL

public static final LevellingPolicy LOCAL
Individual y-coordinates for each Node. There are no levels.

See Also:
LocalLevelsStrategy

FIXED_PARAMETER_IGNORE

public static final LevellingPolicy FIXED_PARAMETER_IGNORE
All levels are of equal distance, which is determined by parameter; nodes at the same depth are placed at the same level, even if a node does not fit into the space between the levels. If the node is to big, its children and its outgoing edges may intersect the node.

See Also:
GloballyFixedLevelsStrategy

FIXED_PARAMETER_ADJUST_INDIVIDUAL

public static final LevellingPolicy FIXED_PARAMETER_ADJUST_INDIVIDUAL
All levels are of equal distance, which is determined by parameter; if a node does not fit in the space between two levels, all nodes of the subtree of that node are moved to consecutive levels until there are no intersecting nodes or edges.

See Also:
GloballyFixedLevelsStrategy

FIXED_PARAMETER_ADJUST_LEVEL

public static final LevellingPolicy FIXED_PARAMETER_ADJUST_LEVEL
All levels are of equal distance, which is determined by parameter; if a node does not fit in the space betweeen two levels, the affected levels are skipped by all nodes in the tree so that no nodes or edges intersect but nodes of the same depth are still placed at the same level.

See Also:
GloballyFixedLevelsStrategy

HIGHEST_NODE

public static final LevellingPolicy HIGHEST_NODE
The distance between each level is determined by the highest node of the respective depth.

See Also:
HighestNodeLevelsStrategy

GLOBALLY_HIGHEST_NODE

public static final LevellingPolicy GLOBALLY_HIGHEST_NODE
All levels are of equal distance, which is determined by the highest node of the tree.

See Also:
GloballyHighestNodeLevelsStrategy
Method Detail

values

public static LevellingPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (LevellingPolicy c : LevellingPolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static LevellingPolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getNames

public static List<String> getNames()
Returns the names of the policies. To get the name of a specific policy, such as LOCAL, you can write
LevellingPolicy.getNames().get( LevellingPolicy.LOCAL.ordinal())

Returns:
the names of the policies.
See Also:
names

createLevellingStrategy

public LevellingStrategy createLevellingStrategy(double parameter,
                                                 double verticalNodeDistance)
Creates a new instance of the subclass of LevellingStrategy employed by this enumeration member. The object is initialized using LevellingStrategy.setParameter(double, double) by the parameters parameter and verticalNodeDistance.

Parameters:
parameter - the semantic of parameter is left to the specific subclass of LevellingStrategy. It is usually used to determine the default distance between proximate levels.
verticalNodeDistance - See ReingoldTilfordAlgorithm.getVerticalNodeDistance()
Returns:
a new instance of the subclass of LevellingStrategy employed by this enumeration member.
See Also:
LevellingStrategy.parameter


Generated at 2012-05-30 11:01:25 PM CEST