JGraph
v5.13.0.4


com.jgraph.layout.hierarchical.model
Class JGraphHierarchyNode

java.lang.Object
  extended by com.jgraph.layout.hierarchical.model.JGraphAbstractHierarchyCell
      extended by com.jgraph.layout.hierarchical.model.JGraphHierarchyNode

public class JGraphHierarchyNode
extends JGraphAbstractHierarchyCell

An abstraction of an internal node in the hierarchy layout


Field Summary
 java.lang.Object cell
          The graph cell this object represents.
static int CELL_TYPE_BRANCH
           
static int CELL_TYPE_END
           
static int CELL_TYPE_JOIN
           
static int CELL_TYPE_NONE
           
static int CELL_TYPE_START
           
 int cellType
          For future use
 java.util.Collection connectsAsSource
          Collection of hierarchy edges that have this node as a source
 java.util.Collection connectsAsTarget
          Collection of hierarchy edges that have this node as a target
static java.util.Collection emptyConnectionMap
          Shared empty connection map to return instead of null in applyMap.
 int[] hashCode
          Assigns a unique hashcode for each node.
 
Fields inherited from class com.jgraph.layout.hierarchical.model.JGraphAbstractHierarchyCell
height, maxRank, minRank, nextLayerConnectedCells, previousLayerConnectedCells, temp, width, x, y
 
Constructor Summary
JGraphHierarchyNode(java.lang.Object cell)
          Constructs an internal node to represent the specified real graph cell
 
Method Summary
 int getGeneralPurposeVariable(int layer)
          Gets the value of temp for the specified layer
 java.util.List getNextLayerConnectedCells(int layer)
          Returns the cells this cell connects to on the next layer up
 java.util.List getPreviousLayerConnectedCells(int layer)
          Returns the cells this cell connects to on the next layer down
 int getRankValue()
          Returns the integer value of the layer that this node resides in
 boolean isAncestor(JGraphHierarchyNode otherNode)
           
 boolean isEdge()
           
 boolean isVertex()
           
 void setGeneralPurposeVariable(int layer, int value)
          Set the value of temp for the specified layer
 
Methods inherited from class com.jgraph.layout.hierarchical.model.JGraphAbstractHierarchyCell
getX, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

emptyConnectionMap

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


CELL_TYPE_NONE

public static final int CELL_TYPE_NONE
See Also:
Constant Field Values

CELL_TYPE_START

public static final int CELL_TYPE_START
See Also:
Constant Field Values

CELL_TYPE_END

public static final int CELL_TYPE_END
See Also:
Constant Field Values

CELL_TYPE_BRANCH

public static final int CELL_TYPE_BRANCH
See Also:
Constant Field Values

CELL_TYPE_JOIN

public static final int CELL_TYPE_JOIN
See Also:
Constant Field Values

cell

public java.lang.Object cell
The graph cell this object represents.


cellType

public int cellType
For future use


connectsAsTarget

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


connectsAsSource

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


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(java.lang.Object cell)
Constructs an internal node to represent the specified real graph cell

Parameters:
cell - the real graph cell this node represents
Method Detail

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

getNextLayerConnectedCells

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

Specified by:
getNextLayerConnectedCells in class JGraphAbstractHierarchyCell
Parameters:
layer - the layer this cell is on
Returns:
the cells this cell connects to on the next layer up

getPreviousLayerConnectedCells

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

Specified by:
getPreviousLayerConnectedCells in class JGraphAbstractHierarchyCell
Parameters:
layer - the layer this cell is on
Returns:
the cells this cell connects to on the next layer down

isEdge

public boolean isEdge()
Specified by:
isEdge in class JGraphAbstractHierarchyCell
Returns:
whether or not this cell is an edge

isVertex

public boolean isVertex()
Specified by:
isVertex in class JGraphAbstractHierarchyCell
Returns:
whether or not this cell is a node

getGeneralPurposeVariable

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

Specified by:
getGeneralPurposeVariable in class JGraphAbstractHierarchyCell
Parameters:
layer - the layer relating to a specific entry into temp
Returns:
the value for that layer

setGeneralPurposeVariable

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

Specified by:
setGeneralPurposeVariable in class JGraphAbstractHierarchyCell
Parameters:
layer - the layer relating to a specific entry into temp
value - the value for that layer

isAncestor

public boolean isAncestor(JGraphHierarchyNode otherNode)

JGraph
v5.13.0.4


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