gdl.base
Class GraphEdge

java.lang.Object
  extended by gdl.base.GraphEdge

public class GraphEdge
extends java.lang.Object

A Graph Edge is an extended representation object for graph edges. these graph edge objects know the id of the nodes they connect, whether they are cross references or direct tree hierarchy connections and their index in the canvas.

Author:
Martin Suntinger

Constructor Summary
GraphEdge(int from, int to, int type, boolean inTree, int indexInEdgeLayer)
           
 
Method Summary
 int getFromNodeAddress()
          returns the id of the first node, the edge connects
 int getIndexInEdgeLayer()
           
 int getToNodeAddress()
          returns the id of the second node, the edge connects
 int getType()
           
 boolean isInTree()
           
 void setFromNodeAddress(int fromNodeAddress)
           
 void setIndexInEdgeLayer(int indexInEdgeLayer)
           
 void setInTree(boolean inTree)
           
 void setToNodeAddress(int toNodeAddress)
           
 void setType(int type)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphEdge

public GraphEdge(int from,
                 int to,
                 int type,
                 boolean inTree,
                 int indexInEdgeLayer)
Parameters:
from - the id of the first node the edge starts from
to - the id of the node the edge ends
type - the connection type
inTree - boolean flag whether the edge is a cross reference (false) or not (true)
indexInEdgeLayer - (the index of the edge on the edgelayer in the PCanvas
Method Detail

getFromNodeAddress

public int getFromNodeAddress()
returns the id of the first node, the edge connects

Returns:
a node address (its position in the allNodes list)

setFromNodeAddress

public void setFromNodeAddress(int fromNodeAddress)

getIndexInEdgeLayer

public int getIndexInEdgeLayer()
Returns:
the index of the node in the edge layer

setIndexInEdgeLayer

public void setIndexInEdgeLayer(int indexInEdgeLayer)
Parameters:
indexInEdgeLayer - the index of the edge on the canvas

isInTree

public boolean isInTree()
Returns:
true if the connection is a direct, hierarchical connection between nodes, false, if the connection is a cross reference

setInTree

public void setInTree(boolean inTree)
Parameters:
inTree - true if the connection is a direct, hierarchical connection between nodes, false, if the connection is a cross reference

getToNodeAddress

public int getToNodeAddress()
returns the id of the second node, the edge connects

Returns:
a node address (its position in the allNodes list)

setToNodeAddress

public void setToNodeAddress(int toNodeAddress)

getType

public int getType()
Returns:
the type of connection that can then be mapped to a color by the connections color mapper

setType

public void setType(int type)
Parameters:
type - the type of the connection