org.jgraph.util

Class ParallelEdgeRouter

Implemented Interfaces:
Edge.Routing, Serializable

public class ParallelEdgeRouter
extends DefaultEdge.LoopRouting

A routing algorithm that

Field Summary

protected static ParallelEdgeRouter
sharedInstance
Singleton to reach parallel edge router

Fields inherited from interface org.jgraph.graph.Edge.Routing

NO_PREFERENCE

Method Summary

static double
getEdgeDeparture()
Getter to obtain the distance between intermediate and source/target points
static double
getEdgeSeparation()
Getter to obtain the distance between each parallel edge
protected Object[]
getParallelEdges(GraphLayoutCache cache, EdgeView edge, CellView cellView1, CellView cellView2)
Getter to obtain the list of parallel edges
static ParallelEdgeRouter
getSharedInstance()
Getter for singleton managing parallel edges
List
routeEdge(GraphLayoutCache cache, EdgeView edge)
Calc of intermediates points
static void
setEdgeDeparture(double edgeDeparture)
Setter to define distance between intermediate and source/target points
static void
setEdgeSeparation(double edgeSeparation)
Setter to define distance between each parallel edge
static void
setGraph(JGraph graph)
Deprecated. graph instance retained internally

Methods inherited from class org.jgraph.graph.DefaultEdge.LoopRouting

getEdgeStyle, getLoopStyle, getPreferredLineStyle, route, routeEdge, routeLoop

Field Details

sharedInstance

protected static final ParallelEdgeRouter sharedInstance
Singleton to reach parallel edge router

Method Details

getEdgeDeparture

public static double getEdgeDeparture()
Getter to obtain the distance between intermediate and source/target points
Returns:
Distance

getEdgeSeparation

public static double getEdgeSeparation()
Getter to obtain the distance between each parallel edge
Returns:
Distance

getParallelEdges

protected Object[] getParallelEdges(GraphLayoutCache cache,
                                    EdgeView edge,
                                    CellView cellView1,
                                    CellView cellView2)
Getter to obtain the list of parallel edges
Parameters:
edge - Edge on which one wants to know parallel edges
Returns:
Object[] Array of parallel edges (include edge passed on argument)

getSharedInstance

public static ParallelEdgeRouter getSharedInstance()
Getter for singleton managing parallel edges
Returns:
ParallelEdgeRouter for parallel edges

routeEdge

public List routeEdge(GraphLayoutCache cache,
                      EdgeView edge)
Calc of intermediates points
Overrides:
routeEdge in interface DefaultEdge.LoopRouting
Parameters:
edge - Edge for which routing is demanding

setEdgeDeparture

public static void setEdgeDeparture(double edgeDeparture)
Setter to define distance between intermediate and source/target points
Parameters:
edgeDeparture - New distance

setEdgeSeparation

public static void setEdgeSeparation(double edgeSeparation)
Setter to define distance between each parallel edge
Parameters:
edgeSeparation - New distance

setGraph

public static void setGraph(JGraph graph)

Deprecated. graph instance retained internally

Parameters:
graph - The graph to set.

Copyright (C) 2001-2006 Gaudenz Alder. All rights reserved.