com.mxgraph.layout.mxParallelEdgeLayout Maven / Gradle / Ivy
package com.mxgraph.layout;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.mxgraph.model.mxCellPath;
import com.mxgraph.model.mxGeometry;
import com.mxgraph.model.mxICell;
import com.mxgraph.model.mxIGraphModel;
import com.mxgraph.util.mxPoint;
import com.mxgraph.view.mxCellState;
import com.mxgraph.view.mxGraph;
import com.mxgraph.view.mxGraphView;
public class mxParallelEdgeLayout extends mxGraphLayout
{
/**
* Specifies the spacing between the edges. Default is 20.
*/
protected int spacing;
/**
* Constructs a new stack layout layout for the specified graph,
* spacing, orientation and offset.
*/
public mxParallelEdgeLayout(mxGraph graph)
{
this(graph, 20);
}
/**
* Constructs a new stack layout layout for the specified graph,
* spacing, orientation and offset.
*/
public mxParallelEdgeLayout(mxGraph graph, int spacing)
{
super(graph);
this.spacing = spacing;
}
/*
* (non-Javadoc)
* @see com.mxgraph.layout.mxIGraphLayout#execute(java.lang.Object)
*/
public void execute(Object parent)
{
Map> lookup = findParallels(parent);
graph.getModel().beginUpdate();
try
{
Iterator> it = lookup.values().iterator();
while (it.hasNext())
{
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy