com.jgraph.layout.organic

Class JGraphOrganicLayout.CellWrapper

public class JGraphOrganicLayout.CellWrapper extends Object

Internal representation of a node or edge that holds cached information to enable the layout to perform more quickly and to simplify the code
Field Summary
protected Objectcell
The actual graph cell this wrapper represents
protected int[]connectedEdges
the index of all connected edges in the e array to this node.
protected doubleheightSquared
The height of the node squared, only used if approxNodeDimensions is set to true.
protected doubleradiusSquared
The approximate radius squared of this cell, nodes only.
protected int[]relevantEdges
All edge that repel this cell, only used for nodes.
protected intsource
The index of the node attached to this edge as source, edges only
protected inttarget
The index of the node attached to this edge as target, edges only
protected doublex
The x-coordinate position of this cell, nodes only
protected doubley
The y-coordinate position of this cell, nodes only
Constructor Summary
CellWrapper(Object cell)
Constructs a new CellWrapper
Method Summary
ObjectgetCell()
int[]getConnectedEdges()
doublegetHeightSquared()
doublegetRadiusSquared()
int[]getRelevantEdges()
intgetSource()
intgetTarget()
doublegetX()
doublegetY()
voidsetConnectedEdges(int[] connectedEdges)
voidsetHeightSquared(double heightSquared)
voidsetRadiusSquared(double radiusSquared)
voidsetRelevantEdges(int[] relevantEdges)
voidsetSource(int source)
voidsetTarget(int target)
voidsetX(double x)
voidsetY(double y)

Field Detail

cell

protected Object cell
The actual graph cell this wrapper represents

connectedEdges

protected int[] connectedEdges
the index of all connected edges in the e array to this node. This is only used for nodes.

heightSquared

protected double heightSquared
The height of the node squared, only used if approxNodeDimensions is set to true.

radiusSquared

protected double radiusSquared
The approximate radius squared of this cell, nodes only. If approxNodeDimensions is true on the layout this value holds the width of the node squared

relevantEdges

protected int[] relevantEdges
All edge that repel this cell, only used for nodes. This array is equivalent to all edges unconnected to this node

source

protected int source
The index of the node attached to this edge as source, edges only

target

protected int target
The index of the node attached to this edge as target, edges only

x

protected double x
The x-coordinate position of this cell, nodes only

y

protected double y
The y-coordinate position of this cell, nodes only

Constructor Detail

CellWrapper

public CellWrapper(Object cell)
Constructs a new CellWrapper

Parameters: cell the graph cell this wrapper represents

Method Detail

getCell

public Object getCell()

Returns: the cell

getConnectedEdges

public int[] getConnectedEdges()

Returns: the connectedEdges

getHeightSquared

public double getHeightSquared()

Returns: the heightSquared

getRadiusSquared

public double getRadiusSquared()

Returns: the radiusSquared

getRelevantEdges

public int[] getRelevantEdges()

Returns: the relevantEdges

getSource

public int getSource()

Returns: the source

getTarget

public int getTarget()

Returns: the target

getX

public double getX()

Returns: the x

getY

public double getY()

Returns: the y

setConnectedEdges

public void setConnectedEdges(int[] connectedEdges)

Parameters: connectedEdges the connectedEdges to set

setHeightSquared

public void setHeightSquared(double heightSquared)

Parameters: heightSquared the heightSquared to set

setRadiusSquared

public void setRadiusSquared(double radiusSquared)

Parameters: radiusSquared the radiusSquared to set

setRelevantEdges

public void setRelevantEdges(int[] relevantEdges)

Parameters: relevantEdges the relevantEdges to set

setSource

public void setSource(int source)

Parameters: source the source to set

setTarget

public void setTarget(int target)

Parameters: target the target to set

setX

public void setX(double x)

Parameters: x the x to set

setY

public void setY(double y)

Parameters: y the y to set

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