Packagecom.yworks.yfiles.layout.genealogy
Classpublic class FamilyTreeLayouter
InheritanceFamilyTreeLayouter Inheritance CanonicMultiStageLayouter Inheritance YObject Inheritance Object

This class implements a layout algorithm for genealogical data (family trees).

To be suitable for this layouter the graphs have to be organized in the following way: Individuals as well as their marriage or partnership are represented by nodes, in the following referred to as INDI nodes for individuals and FAM nodes for family nodes, corresponding to the INDI and FAM entries in Gedcom encoded genealogical data (GEDCOM is a widely used format to store genealogical data, see http://www.phpgedview.net/ged551-5.pdf for the most recent specifications).

In order to determine whether a node represents an individual or a partnership, the data provider DP_KEY_FAMILY_TYPE has to be registered, otherwise an com.yworks.bridge.util.IllegalArgumentException will be thrown. That data provider should return:

All other values will be interpreted as if the node represents an individual.

A FAM node is linked to the INDI nodes representing husband and wife by ingoing edges and to INDI nodes representing the children by outgoing edges. Two nodes of the same type (INDI or FAM) which are linked directly together will cause a com.yworks.yfiles.base.InvalidGraphStructureException exception. A FAM node with more than two parents will also cause a com.yworks.yfiles.base.InvalidGraphStructureException exception.

The layout is calculated basically in two steps: The top layouter can be accessed by topLayouter and topLayouter. By default, an com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter is used.

See also

DP_KEY_FAMILY_TYPE
com.yworks.bridge.util.IllegalArgumentException
TYPE_MALE
TYPE_FEMALE
TYPE_FAMILY
com.yworks.yfiles.base.InvalidGraphStructureException
topLayouter
com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter


Public Properties
 PropertyDefined By
  alignment : int
Specifies the vertical alignment of the individual nodes
FamilyTreeLayouter
 InheritedcomponentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph.
CanonicMultiStageLayouter
 InheritedcomponentLayouterEnabled : Boolean
Getter: Returns whether or not ComponentLayouter is enabled.
CanonicMultiStageLayouter
  familyNodesAlwaysBelow : Boolean
Determines whether family/marriage nodes will be placed between the partners or below them.
FamilyTreeLayouter
 InheritedgroupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm.
CanonicMultiStageLayouter
 InheritedhideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins.
CanonicMultiStageLayouter
 InheritedlabelLayouter : LayoutStage
Getter: Returns the algorithm used for placing labels.
CanonicMultiStageLayouter
 InheritedlabelLayouterEnabled : Boolean
Getter: Returns whether or not LabelLayouter is enabled.
CanonicMultiStageLayouter
 InheritedlayoutOrientation : int
Specifies the main layout orientation.
CanonicMultiStageLayouter
  offsetForFamilyNodes : Number
Specifies the offset by which a family node will be shifted down if its parents are not direct neighbours.
FamilyTreeLayouter
 InheritedorientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout.
CanonicMultiStageLayouter
 InheritedorientationLayouterEnabled : Boolean
Getter: Returns whether or not the OrientationLayouter is enabled.
CanonicMultiStageLayouter
 InheritedparallelEdgeLayouter : LayoutStage
Getter: Returns the LayoutStage responsible for routing parallel edges.
CanonicMultiStageLayouter
 InheritedparallelEdgeLayouterEnabled : Boolean
Getter: Returns whether or not the ParallelEdgeLayouter is enabled.
CanonicMultiStageLayouter
  partnerlessBelow : Boolean
Determines the treatment of individuals who have only children but no partners.
FamilyTreeLayouter
 InheritedselfLoopLayouter : LayoutStage
Getter: Returns the LayoutStage used for routing Self-loops.
CanonicMultiStageLayouter
 InheritedselfLoopLayouterEnabled : Boolean
Getter: Returns whether or not the SelfLoopLayouter is enabled.
CanonicMultiStageLayouter
  sortFamilyMembers : int
Specifies the policy the individuals of a family will be sorted by their sex.
FamilyTreeLayouter
  spacingBetweenFamilyMembers : Number
Specifies the (horizontal) space between two nodes representing members of the same family.
FamilyTreeLayouter
 InheritedsubgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph.
CanonicMultiStageLayouter
 InheritedsubgraphLayouterEnabled : Boolean
Getter: Returns whether or not the SubgraphLayouter is enabled.
CanonicMultiStageLayouter
  topLayouter : Layouter
Specifies the layouter which is responsible for the layout between the family groups.
FamilyTreeLayouter
Public Methods
 MethodDefined By
  
FamilyTreeLayouter(init:Boolean = true)
Creates a new instance of this
FamilyTreeLayouter
 Inherited
Appends a stage to the layout pipeline.
CanonicMultiStageLayouter
 Inherited
Returns a layout for the given layout graph.
CanonicMultiStageLayouter
 Inherited
Returns a layout for the given graph interface and layout.
CanonicMultiStageLayouter
 Inherited
canLayout(graph:LayoutGraph):Boolean
Tests whether or not the given graph can be laid out by this layouter.
CanonicMultiStageLayouter
  
canLayoutCore(graph:LayoutGraph):Boolean
[override] Returns true if the given graph can be laid out by this algorithm.
FamilyTreeLayouter
 Inherited
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph.
CanonicMultiStageLayouter
 Inherited
Calculates a layout for the given graph interface and layout.
CanonicMultiStageLayouter
  
[override] Main layout routine that assigns new layout information to the given graph.
FamilyTreeLayouter
 Inherited
Disables all layout stages and performs only the core layouter.
CanonicMultiStageLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
FamilyTreeLayouter
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of this
FamilyTreeLayouter
 Inherited
Prepends a stage to the layout pipeline.
CanonicMultiStageLayouter
 Inherited
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage().
CanonicMultiStageLayouter
Protected Methods
 MethodDefined By
 Inherited
checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero.
CanonicMultiStageLayouter
 Inherited
checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero.
CanonicMultiStageLayouter
 Inherited
CanonicMultiStageLayouter
  
Initializes this object.
FamilyTreeLayouter
Public Constants
 ConstantDefined By
  ALIGN_BOTTOM : int = 1
[static]
FamilyTreeLayouter
  ALIGN_CENTER : int = 0
[static]
FamilyTreeLayouter
  ALIGN_TOP : int = -1
[static]
FamilyTreeLayouter
  DO_NOT_SORT_BY_SEX : int = 0
[static] Disables sorting the individuals according to their sex.
FamilyTreeLayouter
  DP_KEY_FAMILY_TYPE : String = y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE
[static] Data provider key which defines a data provider for nodes which returns a String which defines the type of the node as defined in TYPE_FAMILY, TYPE_MALE, TYPE_FEMALE.
FamilyTreeLayouter
  FEMALE_ALWAYS_FIRST : int = 2
[static] Places female individuals before their male siblings and partners.
FamilyTreeLayouter
  FEMALE_FIRST : int = 1
[static] Places female individuals before their male siblings and partners if possible.
FamilyTreeLayouter
  MALE_ALWAYS_FIRST : int = 4
[static] Places female individuals before their male siblings and partners.
FamilyTreeLayouter
  MALE_FIRST : int = 3
[static] Places female individuals before their male siblings and partners if possible.
FamilyTreeLayouter
  TYPE_FAMILY : String = FAMILY
[static] Returned by the DataProvider DP_KEY_FAMILY_TYPE for nodes which represent a family.
FamilyTreeLayouter
  TYPE_FEMALE : String = FEMALE
[static] Returned by the DataProvider DP_KEY_FAMILY_TYPE for nodes which represent a female individual.
FamilyTreeLayouter
  TYPE_MALE : String = MALE
[static] Returned by the DataProvider DP_KEY_FAMILY_TYPE for nodes which represent a male individual.
FamilyTreeLayouter
Property Detail
alignmentproperty
alignment:int

Specifies the vertical alignment of the individual nodes


Implementation
    public function get alignment():int
    public function set alignment(value:int):void

Throws
IllegalArgumentException — if the given value is not defined.

See also

familyNodesAlwaysBelowproperty 
familyNodesAlwaysBelow:Boolean

Determines whether family/marriage nodes will be placed between the partners or below them.


Implementation
    public function get familyNodesAlwaysBelow():Boolean
    public function set familyNodesAlwaysBelow(value:Boolean):void
offsetForFamilyNodesproperty 
offsetForFamilyNodes:Number

Specifies the offset by which a family node will be shifted down if its parents are not direct neighbours.


Implementation
    public function get offsetForFamilyNodes():Number
    public function set offsetForFamilyNodes(value:Number):void
partnerlessBelowproperty 
partnerlessBelow:Boolean

Determines the treatment of individuals who have only children but no partners. If set to true, the family node will be placed centered below the individual node. Thus, a direct male inheritance line for example will be depicted in a more obvious way.


Implementation
    public function get partnerlessBelow():Boolean
    public function set partnerlessBelow(value:Boolean):void
sortFamilyMembersproperty 
sortFamilyMembers:int

Specifies the policy the individuals of a family will be sorted by their sex. Default is no sorting ( DO_NOT_SORT_BY_SEX).


Implementation
    public function get sortFamilyMembers():int
    public function set sortFamilyMembers(value:int):void

See also

spacingBetweenFamilyMembersproperty 
spacingBetweenFamilyMembers:Number

Specifies the (horizontal) space between two nodes representing members of the same family.


Implementation
    public function get spacingBetweenFamilyMembers():Number
    public function set spacingBetweenFamilyMembers(value:Number):void
topLayouterproperty 
topLayouter:Layouter

Specifies the layouter which is responsible for the layout between the family groups. If no layouter is set, a new instance of com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter is created.


Implementation
    public function get topLayouter():Layouter
    public function set topLayouter(value:Layouter):void

See also

Constructor Detail
FamilyTreeLayouter()Constructor
public function FamilyTreeLayouter(init:Boolean = true)

Creates a new instance of this

Parameters
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
canLayoutCore()method
override public function canLayoutCore(graph:LayoutGraph):Boolean

Returns true if the given graph can be laid out by this algorithm. Calling doLayout with the given graph as it's argument will only succeed if this method returns true.

Parameters

graph:LayoutGraph

Returns
Boolean
doLayoutCore()method 
override public function doLayoutCore(graph:LayoutGraph):void

Main layout routine that assigns new layout information to the given graph.

Parameters

graph:LayoutGraph — The graph to run the layout on


Throws
Error — If the data provider DP_KEY_FAMILY_TYPE is not registered
 
InvalidGraphStructureException — If a family node has more than two parents, or two nodes of the same type are linked together

See also

getClass()method 
override public function getClass():Class

Returns
Class
initFamilyTreeLayouter()method 
protected final function initFamilyTreeLayouter():void

Initializes this object. See the documentation of the corresponding factory method newFamilyTreeLayouter() for details.

See also

newFamilyTreeLayouter()method 
public static function newFamilyTreeLayouter():FamilyTreeLayouter

Creates a new instance of this

Returns
FamilyTreeLayouter
Constant Detail
ALIGN_BOTTOMConstant
public static const ALIGN_BOTTOM:int = 1

See also

ALIGN_CENTERConstant 
public static const ALIGN_CENTER:int = 0

See also

ALIGN_TOPConstant 
public static const ALIGN_TOP:int = -1

See also

DO_NOT_SORT_BY_SEXConstant 
public static const DO_NOT_SORT_BY_SEX:int = 0

Disables sorting the individuals according to their sex.

See also

DP_KEY_FAMILY_TYPEConstant 
public static const DP_KEY_FAMILY_TYPE:String = y.layout.genealogy.FamilyTreeLayouter.DP_KEY_FAMILY_TYPE

Data provider key which defines a data provider for nodes which returns a String which defines the type of the node as defined in TYPE_FAMILY, TYPE_MALE, TYPE_FEMALE. Nodes for which null is returned will be treated like nodes which represent individuals.

See also

FEMALE_ALWAYS_FIRSTConstant 
public static const FEMALE_ALWAYS_FIRST:int = 2

Places female individuals before their male siblings and partners.

See also

FEMALE_FIRSTConstant 
public static const FEMALE_FIRST:int = 1

Places female individuals before their male siblings and partners if possible.

See also

MALE_ALWAYS_FIRSTConstant 
public static const MALE_ALWAYS_FIRST:int = 4

Places female individuals before their male siblings and partners.

See also

MALE_FIRSTConstant 
public static const MALE_FIRST:int = 3

Places female individuals before their male siblings and partners if possible.

See also

TYPE_FAMILYConstant 
public static const TYPE_FAMILY:String = FAMILY

Returned by the DataProvider DP_KEY_FAMILY_TYPE for nodes which represent a family.

See also

TYPE_FEMALEConstant 
public static const TYPE_FEMALE:String = FEMALE

Returned by the DataProvider DP_KEY_FAMILY_TYPE for nodes which represent a female individual.

See also

TYPE_MALEConstant 
public static const TYPE_MALE:String = MALE

Returned by the DataProvider DP_KEY_FAMILY_TYPE for nodes which represent a male individual.

See also