Package | com.yworks.yfiles.layout.genealogy |
Class | public class FamilyTreeLayouter |
Inheritance | FamilyTreeLayouter CanonicMultiStageLayouter YObject Object |
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:
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:See also
Property | Defined By | ||
---|---|---|---|
alignment : int
Specifies the vertical alignment of the individual nodes
| FamilyTreeLayouter | ||
componentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph. | CanonicMultiStageLayouter | ||
componentLayouterEnabled : 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 | ||
groupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm. | CanonicMultiStageLayouter | ||
hideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins. | CanonicMultiStageLayouter | ||
labelLayouter : LayoutStage
Getter:
Returns the algorithm used for placing labels. | CanonicMultiStageLayouter | ||
labelLayouterEnabled : Boolean
Getter:
Returns whether or not LabelLayouter is enabled. | CanonicMultiStageLayouter | ||
layoutOrientation : 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 | ||
orientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout. | CanonicMultiStageLayouter | ||
orientationLayouterEnabled : Boolean
Getter:
Returns whether or not the OrientationLayouter is enabled. | CanonicMultiStageLayouter | ||
parallelEdgeLayouter : LayoutStage
Getter:
Returns the LayoutStage responsible for routing parallel edges. | CanonicMultiStageLayouter | ||
parallelEdgeLayouterEnabled : 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 | ||
selfLoopLayouter : LayoutStage
Getter:
Returns the LayoutStage used for routing Self-loops. | CanonicMultiStageLayouter | ||
selfLoopLayouterEnabled : 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 | ||
subgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph. | CanonicMultiStageLayouter | ||
subgraphLayouterEnabled : 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 |
Method | Defined By | ||
---|---|---|---|
FamilyTreeLayouter(init:Boolean = true)
Creates a new instance of this
| FamilyTreeLayouter | ||
appendStage(stage:LayoutStage):void
Appends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
Returns a layout for the given layout graph. | CanonicMultiStageLayouter | ||
Returns a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
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 | ||
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph. | CanonicMultiStageLayouter | ||
Calculates a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
doLayoutCore(graph:LayoutGraph):void [override]
Main layout routine that assigns new layout information to the given graph. | FamilyTreeLayouter | ||
enableOnlyCore():void
Disables all layout stages and performs only the core layouter. | CanonicMultiStageLayouter | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | FamilyTreeLayouter | ||
hashCode():int | YObject | ||
[static]
Creates a new instance of this
| FamilyTreeLayouter | ||
prependStage(stage:LayoutStage):void
Prepends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
removeStage(stage:LayoutStage):void
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage(). | CanonicMultiStageLayouter |
Method | Defined By | ||
---|---|---|---|
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 | ||
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 | ||
CanonicMultiStageLayouter | |||
initFamilyTreeLayouter():void
Initializes this object. | FamilyTreeLayouter |
Constant | Defined 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 |
alignment | property |
alignment:int
Specifies the vertical alignment of the individual nodes
public function get alignment():int
public function set alignment(value:int):void
IllegalArgumentException — if the given value is not defined.
|
See also
familyNodesAlwaysBelow | property |
familyNodesAlwaysBelow:Boolean
Determines whether family/marriage nodes will be placed between the partners or below them.
public function get familyNodesAlwaysBelow():Boolean
public function set familyNodesAlwaysBelow(value:Boolean):void
offsetForFamilyNodes | property |
offsetForFamilyNodes:Number
Specifies the offset by which a family node will be shifted down if its parents are not direct neighbours.
public function get offsetForFamilyNodes():Number
public function set offsetForFamilyNodes(value:Number):void
partnerlessBelow | property |
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.
public function get partnerlessBelow():Boolean
public function set partnerlessBelow(value:Boolean):void
sortFamilyMembers | property |
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).
public function get sortFamilyMembers():int
public function set sortFamilyMembers(value:int):void
See also
spacingBetweenFamilyMembers | property |
spacingBetweenFamilyMembers:Number
Specifies the (horizontal) space between two nodes representing members of the same family.
public function get spacingBetweenFamilyMembers():Number
public function set spacingBetweenFamilyMembers(value:Number):void
topLayouter | property |
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.
public function get topLayouter():Layouter
public function set topLayouter(value:Layouter):void
See also
FamilyTreeLayouter | () | Constructor |
public function FamilyTreeLayouter(init:Boolean = true)
Creates a new instance of this
Parametersinit: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.
|
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 |
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
|
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
ReturnsClass |
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
ReturnsFamilyTreeLayouter |
ALIGN_BOTTOM | Constant |
ALIGN_CENTER | Constant |
ALIGN_TOP | Constant |
DO_NOT_SORT_BY_SEX | Constant |
public static const DO_NOT_SORT_BY_SEX:int = 0
Disables sorting the individuals according to their sex.
See also
DP_KEY_FAMILY_TYPE | Constant |
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_FIRST | Constant |
public static const FEMALE_ALWAYS_FIRST:int = 2
Places female individuals before their male siblings and partners.
See also
FEMALE_FIRST | Constant |
public static const FEMALE_FIRST:int = 1
Places female individuals before their male siblings and partners if possible.
See also
MALE_ALWAYS_FIRST | Constant |
public static const MALE_ALWAYS_FIRST:int = 4
Places female individuals before their male siblings and partners.
See also
MALE_FIRST | Constant |
public static const MALE_FIRST:int = 3
Places female individuals before their male siblings and partners if possible.
See also
TYPE_FAMILY | Constant |
public static const TYPE_FAMILY:String = FAMILY
Returned by the DataProvider DP_KEY_FAMILY_TYPE for nodes which represent a family.
See also
TYPE_FEMALE | Constant |
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_MALE | Constant |
public static const TYPE_MALE:String = MALE
Returned by the DataProvider DP_KEY_FAMILY_TYPE for nodes which represent a male individual.
See also