Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
JGraphX Swing Component - Java Graph Visualization Library
This is a binary & source redistribution of the original, unmodified JGraphX library originating from:
"https://github.com/jgraph/jgraphx/archive/v3.4.1.3.zip".
The purpose of this redistribution is to make the library available to other Maven projects.
/**
* $Id: mxFastOrganicLayout.java,v 1.29 2012/10/31 23:23:21 david Exp $
* 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