Class DomGraphChartLayout
java.lang.Object
de.saar.chorus.domgraph.layout.LayoutAlgorithm
de.saar.chorus.domgraph.layout.FragmentLayoutAlgorithm
de.saar.chorus.domgraph.layout.chartlayout.DomGraphChartLayout
This is a draft for a new chart-based layout algorithm.
NOTE: Fragments are now represented by their ROOT NODE
- Author:
- Alexander Koller, Michaela Regneri
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassComparator sorting a Collection of Fragments according to their number of incombing edges.classComparator sorting a collection of fragments ascending according to their number of outgoing edges. -
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.voidcomputes 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).voidcomputes the position of all nodes considering their relative poitions within a fragment and the position of their fragment (cp. its fragment node).voidvoidinitialise(DomGraph graph, NodeLabels labels, Canvas canv) 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
-
DomGraphChartLayout
public DomGraphChartLayout()Initializes a new dominance graph layout of a given dominanc graph.- Parameters:
gr- the graph to compute the layout for
-
-
Method Details
-
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
public 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
public 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
-
placeNodes
public 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
-
drawEdges
public void drawEdges()- Specified by:
drawEdgesin classFragmentLayoutAlgorithm
-
initialise
- Overrides:
initialisein classFragmentLayoutAlgorithm- Throws:
LayoutException
-