com.mxgraph.layout.mxFastOrganicLayout Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AptSpringProcessor Show documentation
Show all versions of AptSpringProcessor Show documentation
This project contains the apt processor that implements all the checks enumerated in @Verify. It is a self contained, and
shaded jar.
The newest version!
/**
* Copyright (c) 2007, Gaudenz Alder
*/
package com.mxgraph.layout;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import com.mxgraph.model.mxGeometry;
import com.mxgraph.model.mxIGraphModel;
import com.mxgraph.util.mxRectangle;
import com.mxgraph.view.mxGraph;
/**
* Fast organic layout algorithm.
*/
public class mxFastOrganicLayout extends mxGraphLayout
{
/**
* Specifies if the top left corner of the input cells should be the origin
* of the layout result. Default is true.
*/
protected boolean useInputOrigin = true;
/**
* Specifies if all edge points of traversed edges should be removed.
* Default is true.
*/
protected boolean resetEdges = true;
/**
* Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are
* modified by the result. Default is true.
*/
protected boolean disableEdgeStyle = true;
/**
* The force constant by which the attractive forces are divided and the
* replusive forces are multiple by the square of. The value equates to the
* average radius there is of free space around each node. Default is 50.
*/
protected double forceConstant = 50;
/**
* Cache of ^2 for performance.
*/
protected double forceConstantSquared = 0;
/**
* Minimal distance limit. Default is 2. Prevents of
* dividing by zero.
*/
protected double minDistanceLimit = 2;
/**
* Cached version of squared.
*/
protected double minDistanceLimitSquared = 0;
/**
* The maximum distance between vertices, beyond which their
* repulsion no longer has an effect
*/
protected double maxDistanceLimit = 500;
/**
* Start value of temperature. Default is 200.
*/
protected double initialTemp = 200;
/**
* Temperature to limit displacement at later stages of layout.
*/
protected double temperature = 0;
/**
* Total number of iterations to run the layout though.
*/
protected double maxIterations = 0;
/**
* Current iteration count.
*/
protected double iteration = 0;
/**
* An array of all vertices to be laid out.
*/
protected Object[] vertexArray;
/**
* An array of locally stored X co-ordinate displacements for the vertices.
*/
protected double[] dispX;
/**
* An array of locally stored Y co-ordinate displacements for the vertices.
*/
protected double[] dispY;
/**
* An array of locally stored co-ordinate positions for the vertices.
*/
protected double[][] cellLocation;
/**
* The approximate radius of each cell, nodes only.
*/
protected double[] radius;
/**
* The approximate radius squared of each cell, nodes only.
*/
protected double[] radiusSquared;
/**
* Array of booleans representing the movable states of the vertices.
*/
protected boolean[] isMoveable;
/**
* Local copy of cell neighbours.
*/
protected int[][] neighbours;
/**
* Boolean flag that specifies if the layout is allowed to run. If this is
* set to false, then the layout exits in the following iteration.
*/
protected boolean allowedToRun = true;
/**
* Maps from vertices to indices.
*/
protected Hashtable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy