com.jgraph.layout.hierarchical.model

Class JGraphHierarchyNode

public class JGraphHierarchyNode extends JGraphAbstractHierarchyCell

An abstraction of an internal node in the hierarchy layout
Field Summary
Objectcell
The graph cell this object represents.
intcellType
For future use
CollectionconnectsAsSource
Collection of hierarchy edges that have this node as a source
CollectionconnectsAsTarget
Collection of hierarchy edges that have this node as a target
static intCELL_TYPE_BRANCH
static intCELL_TYPE_END
static intCELL_TYPE_JOIN
static intCELL_TYPE_NONE
static intCELL_TYPE_START
static CollectionemptyConnectionMap
Shared empty connection map to return instead of null in applyMap.
int[]hashCode
Assigns a unique hashcode for each node.
Constructor Summary
JGraphHierarchyNode(Object cell)
Constructs an internal node to represent the specified real graph cell
Method Summary
intgetGeneralPurposeVariable(int layer)
Gets the value of temp for the specified layer
ListgetNextLayerConnectedCells(int layer)
Returns the cells this cell connects to on the next layer up
ListgetPreviousLayerConnectedCells(int layer)
Returns the cells this cell connects to on the next layer down
intgetRankValue()
Returns the integer value of the layer that this node resides in
booleanisAncestor(JGraphHierarchyNode otherNode)
booleanisEdge()
booleanisVertex()
voidsetGeneralPurposeVariable(int layer, int value)
Set the value of temp for the specified layer

Field Detail

cell

public Object cell
The graph cell this object represents.

cellType

public int cellType
For future use

connectsAsSource

public Collection connectsAsSource
Collection of hierarchy edges that have this node as a source

connectsAsTarget

public Collection connectsAsTarget
Collection of hierarchy edges that have this node as a target

CELL_TYPE_BRANCH

public static final int CELL_TYPE_BRANCH

CELL_TYPE_END

public static final int CELL_TYPE_END

CELL_TYPE_JOIN

public static final int CELL_TYPE_JOIN

CELL_TYPE_NONE

public static final int CELL_TYPE_NONE

CELL_TYPE_START

public static final int CELL_TYPE_START

emptyConnectionMap

public static transient Collection emptyConnectionMap
Shared empty connection map to return instead of null in applyMap.

hashCode

public int[] hashCode
Assigns a unique hashcode for each node. Used by the model dfs instead of copying HashSets

Constructor Detail

JGraphHierarchyNode

public JGraphHierarchyNode(Object cell)
Constructs an internal node to represent the specified real graph cell

Parameters: cell the real graph cell this node represents

Method Detail

getGeneralPurposeVariable

public int getGeneralPurposeVariable(int layer)
Gets the value of temp for the specified layer

Parameters: layer the layer relating to a specific entry into temp

Returns: the value for that layer

getNextLayerConnectedCells

public List getNextLayerConnectedCells(int layer)
Returns the cells this cell connects to on the next layer up

Parameters: layer the layer this cell is on

Returns: the cells this cell connects to on the next layer up

getPreviousLayerConnectedCells

public List getPreviousLayerConnectedCells(int layer)
Returns the cells this cell connects to on the next layer down

Parameters: layer the layer this cell is on

Returns: the cells this cell connects to on the next layer down

getRankValue

public int getRankValue()
Returns the integer value of the layer that this node resides in

Returns: the integer value of the layer that this node resides in

isAncestor

public boolean isAncestor(JGraphHierarchyNode otherNode)

isEdge

public boolean isEdge()

Returns: whether or not this cell is an edge

isVertex

public boolean isVertex()

Returns: whether or not this cell is a node

setGeneralPurposeVariable

public void setGeneralPurposeVariable(int layer, int value)
Set the value of temp for the specified layer

Parameters: layer the layer relating to a specific entry into temp value the value for that layer

Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.