Search this API

y.module
Class TreeLayoutModule

java.lang.Object
  extended by y.module.YModule
      extended by y.module.LayoutModule
          extended by y.module.TreeLayoutModule

public class TreeLayoutModule
extends LayoutModule

This module represents an interactive configurator and launcher for TreeLayouter, GenericTreeLayouter and HVTreeLayouter.

See Also:
Section Tree Layout in the yFiles for Java Developer's Guide
 

Field Summary
protected static java.lang.String EDGE_BUNDLING_STRENGTH
           
protected static java.lang.String ITEM_ACT_ON_SELECTION_ONLY
           
protected static java.lang.String ITEM_ASPECT_RATIO
           
protected static java.lang.String ITEM_BUS_ALIGNMENT
           
protected static java.lang.String ITEM_CHILD_PLACEMENT_POLICY
           
protected static java.lang.String ITEM_ENFORCE_GLOBAL_LAYERING
           
protected static java.lang.String ITEM_HORIZONTAL_SPACE
           
protected static java.lang.String ITEM_HORIZONTAL_SPACE_HV
           
protected static java.lang.String ITEM_INTEGRATED_EDGE_LABELING
           
protected static java.lang.String ITEM_INTEGRATED_NODE_LABELING
           
protected static java.lang.String ITEM_LAYOUT_STYLE
           
protected static java.lang.String ITEM_MINIMAL_LAYER_DISTANCE
           
protected static java.lang.String ITEM_MINIMAL_NODE_DISTANCE
           
protected static java.lang.String ITEM_MINIMUM_FIRST_SEGMENT_LENGTH
           
protected static java.lang.String ITEM_MINIMUM_LAST_SEGMENT_LENGTH
           
protected static java.lang.String ITEM_NODE_TYPES
           
protected static java.lang.String ITEM_ORIENTATION
           
protected static java.lang.String ITEM_ORTHOGONAL_EDGE_ROUTING
           
protected static java.lang.String ITEM_PORT_STYLE
           
protected static java.lang.String ITEM_ROUTING_STYLE_FOR_NON_TREE_EDGES
           
protected static java.lang.String ITEM_USE_VIEW_ASPECT_RATIO
           
protected static java.lang.String ITEM_VERTICAL_ALIGNMENT
           
protected static java.lang.String ITEM_VERTICAL_SPACE
           
protected static java.lang.String ITEM_VERTICAL_SPACE_HV
           
protected static java.lang.String MODULE_TREE
           
protected static java.lang.String SECTION_COMPACT
           
protected static java.lang.String SECTION_DIRECTED
           
protected static java.lang.String SECTION_GENERAL
           
protected static java.lang.String SECTION_HV
           
protected static java.lang.String VALUE_ALIGNMENT_BOTTOM
           
protected static java.lang.String VALUE_ALIGNMENT_CENTER
           
protected static java.lang.String VALUE_ALIGNMENT_TOP
           
protected static java.lang.String VALUE_ALL_LEAVES_ON_SAME_LAYER
           
protected static java.lang.String VALUE_BORDER_CENTER_PORTS
           
protected static java.lang.String VALUE_BORDER_DISTRIBUTED_PORTS
           
protected static java.lang.String VALUE_BOTTOM_TO_TOP
           
protected static java.lang.String VALUE_COMPACT
           
protected static java.lang.String VALUE_DIRECTED
           
protected static java.lang.String VALUE_HV
           
protected static java.lang.String VALUE_LEAVES_STACKED
           
protected static java.lang.String VALUE_LEAVES_STACKED_LEFT
           
protected static java.lang.String VALUE_LEAVES_STACKED_RIGHT
           
protected static java.lang.String VALUE_LEFT_TO_RIGHT
           
protected static java.lang.String VALUE_NODE_CENTER_PORTS
           
protected static java.lang.String VALUE_NODE_TYPES_DEFINED_BY_COLOR
           
protected static java.lang.String VALUE_NODE_TYPES_DEFINED_BY_LABEL
           
protected static java.lang.String VALUE_NODE_TYPES_NONE
           
protected static java.lang.String VALUE_PORT_CONSTRAINTS_AWARE
           
protected static java.lang.String VALUE_RIGHT_TO_LEFT
           
protected static java.lang.String VALUE_ROUTE_BUNDLED
           
protected static java.lang.String VALUE_ROUTE_ORGANIC
           
protected static java.lang.String VALUE_ROUTE_ORTHOGONAL
           
protected static java.lang.String VALUE_ROUTE_STRAIGHTLINE
           
protected static java.lang.String VALUE_SIBLINGS_ON_SAME_LAYER
           
protected static java.lang.String VALUE_TOP_TO_BOTTOM
           
 
Fields inherited from class y.module.YModule
FAILED, moduleListenerSupport, PRECONDITION_VIOLATED, SUCCESS
 
Constructor Summary
TreeLayoutModule()
          Creates an instance of this module.
 
Method Summary
protected  void configure(GenericTreeLayouter gtl, OptionHandler options)
          Configures the module's layout algorithm according to the given options.
protected  void configure(HVTreeLayouter hv, OptionHandler options)
          This method configures the modules underlying algorithm with options found in the given OptionHandler.
protected  void configure(TreeLayouter tree, OptionHandler options)
          Configures the module's layout algorithm according to the given options.
protected  void configure(TreeReductionStage reduction, OptionHandler options)
          Configures the module's layout algorithm according to the given options.
protected  OptionHandler createOptionHandler()
          Creates an OptionHandler and adds the option items used by this module.
protected  void mainrun()
          Main module execution routine.
protected  void prepareGraph(Graph2D graph, OptionHandler options)
          Prepares a graph depending on the given options for the module's layout algorithm.
protected  void restoreGraph(Graph2D graph, OptionHandler options)
          Restores the given graph by freeing up resources created by prepareGraph(y.view.Graph2D, y.option.OptionHandler).
 
Methods inherited from class y.module.LayoutModule
backupDataProvider, createAnimationPlayer, createLayoutExecutor, createLayoutMorpher, getBufferedMode, getLayoutExecutor, isAbortable, isMorphingEnabled, isPortIntersectionCalculatorEnabled, launchLayouter, launchLayouter, restoreDataProvider, setBufferedMode, setLayoutExecutor, setMorphingEnabled, setPortIntersectionCalculatorEnabled, useEventDispatchThread
 
Methods inherited from class y.module.YModule
addModuleListener, createThread, dispose, exceptionHappened, fitGraph2DView, getAuthor, getDescription, getExitStatus, getGraph2D, getGraph2DView, getModuleListeners, getModuleName, getOptionHandler, getTimer, getView, init, initGuiFactory, isBackupRealizersEnabled, removeModuleListener, run, setBackupRealizersEnabled, setExitStatus, setGraph2D, setModuleName, setOptionHandler, start, startAsThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE_TREE

protected static final java.lang.String MODULE_TREE
See Also:
Constant Field Values

SECTION_GENERAL

protected static final java.lang.String SECTION_GENERAL
See Also:
Constant Field Values

ITEM_LAYOUT_STYLE

protected static final java.lang.String ITEM_LAYOUT_STYLE
See Also:
Constant Field Values

VALUE_DIRECTED

protected static final java.lang.String VALUE_DIRECTED
See Also:
Constant Field Values

VALUE_HV

protected static final java.lang.String VALUE_HV
See Also:
Constant Field Values

VALUE_COMPACT

protected static final java.lang.String VALUE_COMPACT
See Also:
Constant Field Values

ITEM_ROUTING_STYLE_FOR_NON_TREE_EDGES

protected static final java.lang.String ITEM_ROUTING_STYLE_FOR_NON_TREE_EDGES
See Also:
Constant Field Values

VALUE_ROUTE_ORGANIC

protected static final java.lang.String VALUE_ROUTE_ORGANIC
See Also:
Constant Field Values

VALUE_ROUTE_ORTHOGONAL

protected static final java.lang.String VALUE_ROUTE_ORTHOGONAL
See Also:
Constant Field Values

VALUE_ROUTE_STRAIGHTLINE

protected static final java.lang.String VALUE_ROUTE_STRAIGHTLINE
See Also:
Constant Field Values

VALUE_ROUTE_BUNDLED

protected static final java.lang.String VALUE_ROUTE_BUNDLED
See Also:
Constant Field Values

EDGE_BUNDLING_STRENGTH

protected static final java.lang.String EDGE_BUNDLING_STRENGTH
See Also:
Constant Field Values

ITEM_NODE_TYPES

protected static final java.lang.String ITEM_NODE_TYPES
See Also:
Constant Field Values

VALUE_NODE_TYPES_NONE

protected static final java.lang.String VALUE_NODE_TYPES_NONE
See Also:
Constant Field Values

VALUE_NODE_TYPES_DEFINED_BY_COLOR

protected static final java.lang.String VALUE_NODE_TYPES_DEFINED_BY_COLOR
See Also:
Constant Field Values

VALUE_NODE_TYPES_DEFINED_BY_LABEL

protected static final java.lang.String VALUE_NODE_TYPES_DEFINED_BY_LABEL
See Also:
Constant Field Values

ITEM_ACT_ON_SELECTION_ONLY

protected static final java.lang.String ITEM_ACT_ON_SELECTION_ONLY
See Also:
Constant Field Values

SECTION_DIRECTED

protected static final java.lang.String SECTION_DIRECTED
See Also:
Constant Field Values

ITEM_MINIMAL_NODE_DISTANCE

protected static final java.lang.String ITEM_MINIMAL_NODE_DISTANCE
See Also:
Constant Field Values

ITEM_MINIMAL_LAYER_DISTANCE

protected static final java.lang.String ITEM_MINIMAL_LAYER_DISTANCE
See Also:
Constant Field Values

ITEM_ORIENTATION

protected static final java.lang.String ITEM_ORIENTATION
See Also:
Constant Field Values

VALUE_TOP_TO_BOTTOM

protected static final java.lang.String VALUE_TOP_TO_BOTTOM
See Also:
Constant Field Values

VALUE_LEFT_TO_RIGHT

protected static final java.lang.String VALUE_LEFT_TO_RIGHT
See Also:
Constant Field Values

VALUE_BOTTOM_TO_TOP

protected static final java.lang.String VALUE_BOTTOM_TO_TOP
See Also:
Constant Field Values

VALUE_RIGHT_TO_LEFT

protected static final java.lang.String VALUE_RIGHT_TO_LEFT
See Also:
Constant Field Values

ITEM_PORT_STYLE

protected static final java.lang.String ITEM_PORT_STYLE
See Also:
Constant Field Values

VALUE_NODE_CENTER_PORTS

protected static final java.lang.String VALUE_NODE_CENTER_PORTS
See Also:
Constant Field Values

VALUE_BORDER_CENTER_PORTS

protected static final java.lang.String VALUE_BORDER_CENTER_PORTS
See Also:
Constant Field Values

VALUE_BORDER_DISTRIBUTED_PORTS

protected static final java.lang.String VALUE_BORDER_DISTRIBUTED_PORTS
See Also:
Constant Field Values

VALUE_PORT_CONSTRAINTS_AWARE

protected static final java.lang.String VALUE_PORT_CONSTRAINTS_AWARE
See Also:
Constant Field Values

ITEM_INTEGRATED_NODE_LABELING

protected static final java.lang.String ITEM_INTEGRATED_NODE_LABELING
See Also:
Constant Field Values

ITEM_INTEGRATED_EDGE_LABELING

protected static final java.lang.String ITEM_INTEGRATED_EDGE_LABELING
See Also:
Constant Field Values

ITEM_ORTHOGONAL_EDGE_ROUTING

protected static final java.lang.String ITEM_ORTHOGONAL_EDGE_ROUTING
See Also:
Constant Field Values

ITEM_BUS_ALIGNMENT

protected static final java.lang.String ITEM_BUS_ALIGNMENT
See Also:
Constant Field Values

ITEM_VERTICAL_ALIGNMENT

protected static final java.lang.String ITEM_VERTICAL_ALIGNMENT
See Also:
Constant Field Values

VALUE_ALIGNMENT_TOP

protected static final java.lang.String VALUE_ALIGNMENT_TOP
See Also:
Constant Field Values

VALUE_ALIGNMENT_CENTER

protected static final java.lang.String VALUE_ALIGNMENT_CENTER
See Also:
Constant Field Values

VALUE_ALIGNMENT_BOTTOM

protected static final java.lang.String VALUE_ALIGNMENT_BOTTOM
See Also:
Constant Field Values

ITEM_CHILD_PLACEMENT_POLICY

protected static final java.lang.String ITEM_CHILD_PLACEMENT_POLICY
See Also:
Constant Field Values

VALUE_SIBLINGS_ON_SAME_LAYER

protected static final java.lang.String VALUE_SIBLINGS_ON_SAME_LAYER
See Also:
Constant Field Values

VALUE_ALL_LEAVES_ON_SAME_LAYER

protected static final java.lang.String VALUE_ALL_LEAVES_ON_SAME_LAYER
See Also:
Constant Field Values

VALUE_LEAVES_STACKED

protected static final java.lang.String VALUE_LEAVES_STACKED
See Also:
Constant Field Values

VALUE_LEAVES_STACKED_LEFT

protected static final java.lang.String VALUE_LEAVES_STACKED_LEFT
See Also:
Constant Field Values

VALUE_LEAVES_STACKED_RIGHT

protected static final java.lang.String VALUE_LEAVES_STACKED_RIGHT
See Also:
Constant Field Values

ITEM_ENFORCE_GLOBAL_LAYERING

protected static final java.lang.String ITEM_ENFORCE_GLOBAL_LAYERING
See Also:
Constant Field Values

SECTION_HV

protected static final java.lang.String SECTION_HV
See Also:
Constant Field Values

ITEM_HORIZONTAL_SPACE_HV

protected static final java.lang.String ITEM_HORIZONTAL_SPACE_HV
See Also:
Constant Field Values

ITEM_VERTICAL_SPACE_HV

protected static final java.lang.String ITEM_VERTICAL_SPACE_HV
See Also:
Constant Field Values

SECTION_COMPACT

protected static final java.lang.String SECTION_COMPACT
See Also:
Constant Field Values

ITEM_HORIZONTAL_SPACE

protected static final java.lang.String ITEM_HORIZONTAL_SPACE
See Also:
Constant Field Values

ITEM_VERTICAL_SPACE

protected static final java.lang.String ITEM_VERTICAL_SPACE
See Also:
Constant Field Values

ITEM_MINIMUM_FIRST_SEGMENT_LENGTH

protected static final java.lang.String ITEM_MINIMUM_FIRST_SEGMENT_LENGTH
See Also:
Constant Field Values

ITEM_MINIMUM_LAST_SEGMENT_LENGTH

protected static final java.lang.String ITEM_MINIMUM_LAST_SEGMENT_LENGTH
See Also:
Constant Field Values

ITEM_USE_VIEW_ASPECT_RATIO

protected static final java.lang.String ITEM_USE_VIEW_ASPECT_RATIO
See Also:
Constant Field Values

ITEM_ASPECT_RATIO

protected static final java.lang.String ITEM_ASPECT_RATIO
See Also:
Constant Field Values
Constructor Detail

TreeLayoutModule

public TreeLayoutModule()
Creates an instance of this module.

Method Detail

createOptionHandler

protected OptionHandler createOptionHandler()
Creates an OptionHandler and adds the option items used by this module.

Overrides:
createOptionHandler in class YModule
Returns:
the created OptionHandler providing module related options

mainrun

protected void mainrun()
Main module execution routine. Launches the module's underlying algorithm on the module's graph based on user options.

Specified by:
mainrun in class YModule

prepareGraph

protected void prepareGraph(Graph2D graph,
                            OptionHandler options)
Prepares a graph depending on the given options for the module's layout algorithm.
Additional resources created by this method have to be freed up by calling restoreGraph(y.view.Graph2D, y.option.OptionHandler) after layout calculation.

Parameters:
graph - the graph to be prepared
options - the options for the module's layout algorithm

restoreGraph

protected void restoreGraph(Graph2D graph,
                            OptionHandler options)
Restores the given graph by freeing up resources created by prepareGraph(y.view.Graph2D, y.option.OptionHandler).

Parameters:
graph - the graph for which prepareGraph has been called
options - the options for the module's layout algorithm

configure

protected void configure(TreeLayouter tree,
                         OptionHandler options)
Configures the module's layout algorithm according to the given options.

Parameters:
tree - the TreeLayouter to be configured
options - the layout options to set

configure

protected void configure(GenericTreeLayouter gtl,
                         OptionHandler options)
Configures the module's layout algorithm according to the given options.

Parameters:
gtl - the GenericTreeLayouter to be configured
options - the options for the module's layout algorithm

configure

protected void configure(HVTreeLayouter hv,
                         OptionHandler options)
This method configures the modules underlying algorithm with options found in the given OptionHandler.

Parameters:
hv - the HVTreeLayouter to be configured
options - the options for the module's layout algorithm

configure

protected void configure(TreeReductionStage reduction,
                         OptionHandler options)
Configures the module's layout algorithm according to the given options.

Parameters:
reduction - the TreeReductionStage to be configured
options - the options for the module's layout algorithm

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