Class DomGraphLayout
java.lang.Object
de.saar.chorus.domgraph.layout.LayoutAlgorithm
de.saar.chorus.domgraph.layout.FragmentLayoutAlgorithm
de.saar.chorus.domgraph.layout.domgraphlayout.DomGraphLayout
A layout algorithm for a dominance graph represented by
a JDomGraph.
- Author:
- Alexander Koller, Michaela Regneri
-
Field Summary
Fields inherited from class de.saar.chorus.domgraph.layout.FragmentLayoutAlgorithm
canvas, domgraph, fragHeight, fragments, fragmentToHoles, fragOffset, fragWidth, fragXpos, fragYpos, nodelabels, nodesToShape, relXtoParent, relXtoRoot, relYposFields inherited from class de.saar.chorus.domgraph.layout.LayoutAlgorithm
nodeToLabel -
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new dominance graph layout of a given dominanc graph. -
Method Summary
Modifier and TypeMethodDescriptionstatic <E,T> void addToMapList(Map<E, List<T>> map, E key, T nVal) Generic method that handles maps from an Object to a list of objects and ads a new entry to the value list with the specified object key.protected voidcomputes the whole fragment graph.protected voidcomputes the position of all nodes considering their relative poitions within a fragment and the position of their fragment (cp. its fragment node).protected voidvoidinitialise(DomGraph gr, NodeLabels labels, Canvas canv) protected voidplaces the nodes in the graph model.Methods inherited from class de.saar.chorus.domgraph.layout.FragmentLayoutAlgorithm
addRelXtoParent, addRelXtoRoot, addRelYpos, getFragDegree, getFragHoles, getFragInEdges, getFragOutEdges, getNodesToShape, getNodesToShape, getRelXtoParent, getRelXtoRoot, layout, putNodeToShapeMethods inherited from class de.saar.chorus.domgraph.layout.LayoutAlgorithm
layout, removeRedundandEdges
-
Constructor Details
-
DomGraphLayout
public DomGraphLayout()Initializes a new dominance graph layout of a given dominanc graph.- Parameters:
gr- the graph to compute the layout for
-
-
Method Details
-
initialise
- Overrides:
initialisein classFragmentLayoutAlgorithm- Throws:
LayoutException
-
addToMapList
Generic method that handles maps from an Object to a list of objects and ads a new entry to the value list with the specified object key. If the map does not contain the key yet, it is added.- Type Parameters:
E- the key typeT- the type of the list elements- Parameters:
map- the mapkey- the key to which list the new value shall be addednVal- the new value
-
computeFragmentPositions
protected void computeFragmentPositions()computes the whole fragment graph. computes the fragment's x-position with undirected DFS, the fragment's later y-position performing directed DFS (for each root).- Specified by:
computeFragmentPositionsin classFragmentLayoutAlgorithm
-
computeNodePositions
protected void computeNodePositions()computes the position of all nodes considering their relative poitions within a fragment and the position of their fragment (cp. its fragment node).- Specified by:
computeNodePositionsin classFragmentLayoutAlgorithm
-
drawEdges
protected void drawEdges()- Specified by:
drawEdgesin classFragmentLayoutAlgorithm
-
placeNodes
protected void placeNodes()places the nodes in the graph model. Not meaningful without having computed the fragment graph as well as the relative x- and y-positions.- Specified by:
placeNodesin classFragmentLayoutAlgorithm
-