com.tensegrity.graph.layout.controller
Class OrgChartLayoutController

java.lang.Object
  extended bycom.tensegrity.graph.layout.controller.LayoutController
      extended bycom.tensegrity.graph.layout.controller.OrgChartLayoutController
All Implemented Interfaces:
Attributable, AttributableOnSet

public class OrgChartLayoutController
extends LayoutController

The OrgChartLayoutController is a concrete LayoutController class used to layout an organizational chart. In such a chart, visual nodes are distributed below or to the side of a parent node in equal measure.

The class encapsulates details that are necessary to properly use the necessary OrgChartLayout instance and provides a set of methods that are helpful for developing organizational chart applications.

Author:
SharokhKhani

Field Summary
static int BALANCE_CENTER
          Node arrangement specifier.
static int BALANCE_LEFT
          Node arrangement specifier.
static int BALANCE_RIGHT
          Node arrangement specifier.
static int LIST_DOUBLE
          Node arrangement specifier.
static int LIST_LEFT
          Node arrangement specifier.
static int LIST_RIGHT
          Node arrangement specifier.
static int STAFF
          Node arrangement specifier.
 
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
OrgChartLayoutController()
          Constructs a new OrgChartLayoutController instance.
 
Method Summary
 LayoutController deepCopy(VisualGraphObjectContainer visualgraphobject)
          Creates a new independent layout-controller associated with the given VisualGraphObjectContainer.
 int getNodeArrangement(Layoutable node)
          Gets the arrangement style of the specified node.
 boolean getNodePinned(LayoutableNode node)
          Indicates whether the specified node is a pinned.
protected  void init()
          This method must be overwritten by derived LayoutControllers.
 boolean isConnector(LayoutableEdge edge)
          Indicates whether the specified edge is a connector or a association link. association links have any effect on arrangement of the node which are connected by them.
protected  void onBeginLayout()
          Override this method with code that should be performed when the layout is about to begin.
 void setConnector(LayoutableEdge edge, boolean connector)
          Determines the type of specified edge.
 void setNodeArrangement(Layoutable node, int arrangement)
          Sets the arrangement style of the specified node.
 void setNodePinned(LayoutableNode node, boolean pinned)
          Sets the specified node to be pinned or not.
 
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, onBeginLoading, onBeginVisualSubgraphEdgeLayout, onBeginVisualSubgraphLayout, onEndLayout, onEndLoading, onEndVisualSubgraphEdgeLayout, onEndVisualSubgraphLayout, onLayoutEdgeSubgraph, onLayoutSubgraph, 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

BALANCE_CENTER

public static final int BALANCE_CENTER
Node arrangement specifier. The children will distribute balanced under the parent node

See Also:
Constant Field Values

BALANCE_LEFT

public static final int BALANCE_LEFT
Node arrangement specifier. The children will be distributed steady under the parent node. The parent node will be placed over the first child on the left.

See Also:
Constant Field Values

BALANCE_RIGHT

public static final int BALANCE_RIGHT
Node arrangement specifier. The children will be distributed balanced under the parent node. The parent node will be placed over the last child on the right.

See Also:
Constant Field Values

LIST_LEFT

public static final int LIST_LEFT
Node arrangement specifier. The children will distribute one below the other and on the left side of the parent center point.

See Also:
Constant Field Values

LIST_RIGHT

public static final int LIST_RIGHT
Node arrangement specifier. The children will be distributed one below the other and on the right side of the parent center point.

See Also:
Constant Field Values

LIST_DOUBLE

public static final int LIST_DOUBLE
Node arrangement specifier. The children will be distributed one below the other divided equally on the left and right side of the parent center point.

See Also:
Constant Field Values

STAFF

public static final int STAFF
Node arrangement specifier. The staff element will distribute under the parent node vertical and divided on the left and right side of the parent center point horizontally. The staff element are not allowed to have children.

See Also:
Constant Field Values
Constructor Detail

OrgChartLayoutController

public OrgChartLayoutController()
Constructs a new OrgChartLayoutController instance.

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

onBeginLayout

protected void onBeginLayout()
Description copied from class: LayoutController
Override this method with code that should be performed when the layout is about to begin.

Overrides:
onBeginLayout in class LayoutController

getNodeArrangement

public int getNodeArrangement(Layoutable node)
Gets the arrangement style of the specified node.

Parameters:
node - LayoutableNode which arrangement is requested
Returns:
the arrangement of the specified node. Possible values are BALANCE_CENTER, BALANCE_LEFT, BALANCE_RIGHT, LIST_LEFT, LIST_RIGHT, LIST_DOUBLE or STAFF;

setNodeArrangement

public void setNodeArrangement(Layoutable node,
                               int arrangement)
Sets the arrangement style of the specified node. Possible values are BALANCE_CENTER, BALANCE_LEFT, BALANCE_RIGHT, LIST_LEFT, LIST_RIGHT, LIST_DOUBLE and STAFF;

Parameters:
node - LayoutableNode which arrangement is to set.
arrangement - the arrangement that is to use.

isConnector

public boolean isConnector(LayoutableEdge edge)
Indicates whether the specified edge is a connector or a association link. association links have any effect on arrangement of the node which are connected by them.

Parameters:
edge - an LayoutableEdge object which taye is requested
Returns:
true if the edge is a connector, otherwise returns false.

setConnector

public void setConnector(LayoutableEdge edge,
                         boolean connector)
Determines the type of specified edge. A edge can be a connector or a association link. association links have any effect on arrangement of the node which are connected by them.

Parameters:
edge - an LayoutableEdge which type is to changed.
connector - true if the edge has behave as a connector, false if the edge has behave as an association link. association links have any effect on arrangement of the organization chart.

setNodePinned

public void setNodePinned(LayoutableNode node,
                          boolean pinned)
Sets the specified node to be pinned or not. The layout object will not change the position of pinned nodes.

Parameters:
node - LayoutableNode which should be pinned
pinned - determines whether node should pinned or not.

getNodePinned

public boolean getNodePinned(LayoutableNode node)
Indicates whether the specified node is a pinned.

Parameters:
node - LayoutableNode which state is requested.
Returns:
true if the node is pinned, otherwise false.

deepCopy

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

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


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