com.tensegrity.graph.layout.controller
Class GraphLayoutController

java.lang.Object
  extended bycom.tensegrity.graph.layout.controller.LayoutController
      extended bycom.tensegrity.graph.layout.controller.GraphLayoutController
All Implemented Interfaces:
Attributable, AttributableOnSet
Direct Known Subclasses:
WorkflowLayoutController

public class GraphLayoutController
extends LayoutController

Class GraphLayoutController provides the generic functionality needed in many free-flowing graph editors and modelers. Different Layout styles can be used by specifying the appropriate layout context.
An instance of this class will register an instance of every Layout implementation class found in the Tensegrity framework and will attach at least one layout context to them.

Version:
$Id: GraphLayoutController.java,v 1.109 2006/05/31 05:18:50 SharokhKhani Exp $
Author:
Sharokh Khani

Field Summary
static java.lang.String BunchedLinkLayout
          Predefined layout context for edge layout / Bunched-Smooth
static java.lang.String Circular
          Predefined layout context for circular layout
static java.lang.String DefaultLinkLayout
          Predefined layout context for default edge layout
static java.lang.String Energy
          Predefined layout context for energy layout
static java.lang.String HierarchicalToBottom
          Predefined layout context for hierarchical layout / top to bottom
static java.lang.String HierarchicalToLeft
          Predefined layout context for hierarchical layout / right to left
static java.lang.String HierarchicalToRight
          Predefined layout context for hierarchical layout / left to right
static java.lang.String HierarchicalToTop
          Predefined layout context for hierarchical layout / bottom to top
static java.lang.String None
          Predefined layout context for none layout
static java.lang.String OrgChartBalanceCentered
          Predefined layout context for OrgChart layout / Balanced Center
static java.lang.String OrgChartBalanceLeft
          Predefined layout context for OrgChart layout / Balanced Left
static java.lang.String OrgChartBalanceRight
          Predefined layout context for OrgChart layout / Balanced Right
static java.lang.String OrgChartListDouble
          Predefined layout context for OrgChart layout / List Double
static java.lang.String OrgChartListLeft
          Predefined layout context for OrgChart layout / List Left
static java.lang.String OrgChartListRight
          Predefined layout context for OrgChart layout / List Right
static java.lang.String RightAngleLinkLayout
          Predefined layout context for edge layout / Bunched-Orthogonal
static java.lang.String SimpleLinkLayout
          Predefined layout context for edge layout / Plain
static java.lang.String TreeHV
          Predefined layout context for tree layout / HV
static java.lang.String TreeLoop
          Predefined layout context for tree layout / Loop
static java.lang.String TreePlan
          Predefined layout context for tree Plain layout
static java.lang.String TreeRadial
          Predefined layout context for tree layout / Radial
 
Fields inherited from class com.tensegrity.graph.layout.controller.LayoutController
ACTIVE, ACTIVE_EDGELAYOUT, ACTIVE_NODELAYOUT, animation, ANIMATION_TIME, animationDuration, ANIMATIONDURATION, ANIMATIONENABLED, ATTRIBUTENAME_EDGE_LAYOUT, ATTRIBUTENAME_GLOBAL_SETTINGS, ATTRIBUTENAME_LAYOUT_CONTEXT, ATTRIBUTENAME_LAYOUT_SETTING, ATTRIBUTENAME_NODE_LAYOUT, DEFAULTEDGELAYOUTCONTEXT, DEFAULTNODELAYOUTCONTEXT, DEPENDING_ON_LAYOUT_DIRECTION, DYNAMIC, DYNAMIC_PORT_REASSIGNMENT, dynamicEdgeLayout, DYNAMICEDGELAYOUT, dynamicNodeLayout, DYNAMICNODELAYOUT, EDGE_OPTIONS, edgeLayoutContext, ENABLE_ANIMATION, GLOBAL_CONFIGURATION, IGNORE_UNCONNECTED_NODES, INACTIVE, LAYOUT_DOMAIN, layoutDomain, LAYOUTDOMAIN_ALL, LAYOUTDOMAIN_CONSIDER_SELECTED_GROUPS, LAYOUTDOMAIN_SELECTION, LAYOUTDOMAIN_USED, LAYOUTDOMAIN_WHOLE, NODE_OPTIONS, nodeLayoutContext, observable, OTHER_OPTIONS, RELAYOUT_EDGES_ON_CHANGE, RELAYOUT_NODES_ON_CHANGE, SELECTED_GROUPS, state, strErrorMessage, visualGraphObjectContainer, visualGraphView, WHOLE_GRAPH
 
Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet
TREE_SUBSET_POSTFIX
 
Constructor Summary
GraphLayoutController()
          Constructs a new GraphLayoutController instance.
GraphLayoutController(boolean createDefaultContexts)
          Constructs a new GraphLayoutController instance.
GraphLayoutController(GraphLayoutController graphLayoutController, VisualGraphObjectContainer visualGraphObjectContainer)
          Copy-Constructs a new GraphLayoutController instance.
 
Method Summary
 LayoutController deepCopy(VisualGraphObjectContainer visualGraphObjectContainer)
          Creates a new independent layout-controller associated with the given VisualGraphObjectContainer.
protected  void init()
          This method must be overwritten by derived LayoutControllers.
protected  void onEndVisualSubgraphLayout(VisualSubgraph visualsubgraph)
          Override this method with code that should be performed after layout on a VisualSubgraph has completed.
protected  void onLayoutSubgraph(VisualSubgraph visualsubgraph)
          This method will be called by LayoutController.apply() for each subgraph for which a layout is to be performed.
 void setDefaultLayerDistance(int distance)
          Deprecated. Please use the method LayoutController.setLayoutAttribute(String, String, Object) to set the layer distance of the hierarchical layout.
 void setDefaultNodeDistance(int distance)
          Deprecated. Please use the method LayoutController.setLayoutAttribute(String, String, Object) to set the node distance of the hierarchical layout.
 
Methods inherited from class com.tensegrity.graph.layout.controller.LayoutController
addAttributableOnSetListener, addErrorMessage, addLayoutContext, addObserver, addProgressListener, apply, apply, apply, apply, apply, applyDynamic, applyEdgeLayout, applyEdgeLayout, areAttributableEventsEnabled, considerCurrentEdgesRoute, deleteObserver, disableAttributableEvents, duplicateLayoutContext, enableAnimation, enableAttributableEvents, enableDynamicEdgeLayout, enableDynamicNodeLayout, error, getAnimateDuration, getAttribute, getAttributes, getAttributesTree, getAttributesTree, getAttributeType, getAttributeValue, getAutomaticPortReassignment, getAutomaticPortReassignmentDirectionDependent, getBaseLayoutEngine, getBaseLayouter, getConfiguration, getEdgeDefaultLayoutAttributes, getEdgeLayoutContext, getEdgeLayoutContextConstraint, getEdgeLayoutContextList, getEdgeLayouterList, getErrorMessage, getGraphPosition, getIgnoreIsolatedNodes, getLayoutAttribute, getLayoutAttributeSet, getLayoutContext, getLayoutContextList, getLayoutContextList, getLayoutDomain, getLayoutEdgesContextDepended, getLayoutReport, getLayoutService, getNodeDefaultLayoutAttributes, getNodeLayoutContext, getNodeLayoutContextConstraint, getNodeLayoutContextList, getNodeLayouterList, getPreviousEdgeLayoutAttributeMap, getPreviousEdgeLayoutContextMap, getPreviousNodeLayoutAttributeMap, getPreviousNodeLayoutContextMap, getState, getUsingLayoutContexts, getVisualGraphObjectContainer, isAnimationEnabled, isDynamicEdgeLayoutEnabled, isDynamicLayoutSupported, isDynamicNodeLayoutEnabled, isNodeLayoutContext, isRecursive, isValidLayoutContext, journalStartLayout, journalStopLayout, onBeginLayout, onBeginLoading, onBeginVisualSubgraphEdgeLayout, onBeginVisualSubgraphLayout, onEndLayout, onEndLoading, onEndVisualSubgraphEdgeLayout, onLayoutEdgeSubgraph, registerLayout, registerLayout, registerLayoutEngine, registerLayoutEngine, removeAttributableOnSetListener, removeLayoutContext, removeProgressListener, setAnimateDuration, setAttribute, setAttributes, setAttributesTree, setAttributesTree, setAttributeValue, setAutomaticPortReassignment, setAutomaticPortReassignmentDirectionDependent, setBorder, setChanged, setChanged, setConfiguration, setEdgeLayoutContext, setGraphPosition, setIgnoreIsolatedNodes, setLayoutAttribute, setLayoutAttributeSet, setLayoutContext, setLayoutDomain, setLayoutEdgesContextDepended, setLayoutService, setNodeLayoutContext, setVisualGraphObjectContainer, toString, updateLayoutAttributeSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OrgChartBalanceCentered

public static final java.lang.String OrgChartBalanceCentered
Predefined layout context for OrgChart layout / Balanced Center

See Also:
Constant Field Values

OrgChartBalanceLeft

public static final java.lang.String OrgChartBalanceLeft
Predefined layout context for OrgChart layout / Balanced Left

See Also:
Constant Field Values

OrgChartBalanceRight

public static final java.lang.String OrgChartBalanceRight
Predefined layout context for OrgChart layout / Balanced Right

See Also:
Constant Field Values

OrgChartListLeft

public static final java.lang.String OrgChartListLeft
Predefined layout context for OrgChart layout / List Left

See Also:
Constant Field Values

OrgChartListRight

public static final java.lang.String OrgChartListRight
Predefined layout context for OrgChart layout / List Right

See Also:
Constant Field Values

OrgChartListDouble

public static final java.lang.String OrgChartListDouble
Predefined layout context for OrgChart layout / List Double

See Also:
Constant Field Values

HierarchicalToLeft

public static final java.lang.String HierarchicalToLeft
Predefined layout context for hierarchical layout / right to left

See Also:
Constant Field Values

HierarchicalToRight

public static final java.lang.String HierarchicalToRight
Predefined layout context for hierarchical layout / left to right

See Also:
Constant Field Values

HierarchicalToTop

public static final java.lang.String HierarchicalToTop
Predefined layout context for hierarchical layout / bottom to top

See Also:
Constant Field Values

HierarchicalToBottom

public static final java.lang.String HierarchicalToBottom
Predefined layout context for hierarchical layout / top to bottom

See Also:
Constant Field Values

TreePlan

public static final java.lang.String TreePlan
Predefined layout context for tree Plain layout

See Also:
Constant Field Values

TreeRadial

public static final java.lang.String TreeRadial
Predefined layout context for tree layout / Radial

See Also:
Constant Field Values

TreeLoop

public static final java.lang.String TreeLoop
Predefined layout context for tree layout / Loop

See Also:
Constant Field Values

TreeHV

public static final java.lang.String TreeHV
Predefined layout context for tree layout / HV

See Also:
Constant Field Values

Energy

public static final java.lang.String Energy
Predefined layout context for energy layout

See Also:
Constant Field Values

Circular

public static final java.lang.String Circular
Predefined layout context for circular layout

See Also:
Constant Field Values

DefaultLinkLayout

public static final java.lang.String DefaultLinkLayout
Predefined layout context for default edge layout

See Also:
Constant Field Values

RightAngleLinkLayout

public static final java.lang.String RightAngleLinkLayout
Predefined layout context for edge layout / Bunched-Orthogonal

See Also:
Constant Field Values

BunchedLinkLayout

public static final java.lang.String BunchedLinkLayout
Predefined layout context for edge layout / Bunched-Smooth

See Also:
Constant Field Values

SimpleLinkLayout

public static final java.lang.String SimpleLinkLayout
Predefined layout context for edge layout / Plain

See Also:
Constant Field Values

None

public static final java.lang.String None
Predefined layout context for none layout

See Also:
Constant Field Values
Constructor Detail

GraphLayoutController

public GraphLayoutController()
Constructs a new GraphLayoutController instance.


GraphLayoutController

public GraphLayoutController(boolean createDefaultContexts)
Constructs a new GraphLayoutController instance.

Parameters:
createDefaultContexts - determines whether the new instance of this class should be initialized with default default layout contexts or not

GraphLayoutController

public GraphLayoutController(GraphLayoutController graphLayoutController,
                             VisualGraphObjectContainer visualGraphObjectContainer)
Copy-Constructs a new GraphLayoutController instance.

Parameters:
graphLayoutController - the GraphLayoutController to copy stuff from.
visualGraphObjectContainer - the VisualGraphObjectContainer to associate the copy with.
Method Detail

init

protected void init()
Description copied from class: LayoutController
This method must be overwritten by derived LayoutControllers. It should be used to register necessary Layout and define the according layout-contexts.

Specified by:
init in class LayoutController

deepCopy

public LayoutController deepCopy(VisualGraphObjectContainer visualGraphObjectContainer)
Creates a new independent layout-controller associated with the given VisualGraphObjectContainer.

Specified by:
deepCopy in class LayoutController
Parameters:
visualGraphObjectContainer - the VisualGraphObjectContainer the copy is to be associated with.
Returns:
a deep-copy of the instance.

onEndVisualSubgraphLayout

protected void onEndVisualSubgraphLayout(VisualSubgraph visualsubgraph)
Description copied from class: LayoutController
Override this method with code that should be performed after layout on a VisualSubgraph has completed.

Overrides:
onEndVisualSubgraphLayout in class LayoutController
Parameters:
visualsubgraph - the VisualSubgraph instance that was just arranged.

onLayoutSubgraph

protected void onLayoutSubgraph(VisualSubgraph visualsubgraph)
Description copied from class: LayoutController
This method will be called by LayoutController.apply() for each subgraph for which a layout is to be performed.

Overrides:
onLayoutSubgraph in class LayoutController
Parameters:
visualsubgraph - The subgraph to layout.

setDefaultNodeDistance

public void setDefaultNodeDistance(int distance)
Deprecated. Please use the method LayoutController.setLayoutAttribute(String, String, Object) to set the node distance of the hierarchical layout.

Sets the distance between nodes which used by hierarchical layout

Parameters:
distance - the distance between nodes;

setDefaultLayerDistance

public void setDefaultLayerDistance(int distance)
Deprecated. Please use the method LayoutController.setLayoutAttribute(String, String, Object) to set the layer distance of the hierarchical layout.

Sets the layer distance which used by hierarchical layout

Parameters:
distance - the distance between layers;


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.