
org.eclipse.draw2d.graph.CompoundDirectedGraphLayout Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of draw2d-swt Show documentation
Show all versions of draw2d-swt Show documentation
NetXMS fork of Draw2D for SWT
The newest version!
/*******************************************************************************
* Copyright (c) 2003, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.draw2d.graph;
/**
* Performs a graph layout on a CompoundDirectedGraph
. The input
* format is the same as for {@link DirectedGraphLayout}. All nodes, including
* subgraphs and their children, should be added to the
* {@link DirectedGraph#nodes} field.
*
* The requirements for this algorithm are the same as those of
* DirectedGraphLayout
, with the following exceptions:
*
* - There is an implied edge between a subgraph and each of its member nodes.
* These edges form the containment graph T. Thus, the compound
* directed graph CG is said to be connected iff Union(G,
* T) is connected, where G represents the given nodes (including
* subgraphs) and edges.
*
*
- This algorithm will remove any compound cycles found in the input graph
* G by inverting edges according to a heuristic until no more cycles
* are found. A compound cycle is defined as: a cycle comprised of edges from
* G, T, and T-1, in the form
* (c*e+p*e+)*, where
* T-1 is the backwards graph of T, c element of T,
* e element of G, and p element of T-1.
*
*
* @author Randy Hudson
* @since 2.1.2
*/
public final class CompoundDirectedGraphLayout extends DirectedGraphLayout {
void init() {
steps.add(new CompoundTransposeMetrics());
steps.add(new CompoundBreakCycles());
steps.add(new RouteEdges());
steps.add(new ConvertCompoundGraph());
steps.add(new InitialRankSolver());
steps.add(new TightSpanningTreeSolver());
steps.add(new RankAssignmentSolver());
steps.add(new CompoundPopulateRanks());
steps.add(new CompoundVerticalPlacement());
steps.add(new MinCross(new CompoundRankSorter()));
steps.add(new SortSubgraphs());
steps.add(new CompoundHorizontalPlacement());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy