src/main/java/com/mxgraph/layout/mxFastOrganicLayout.java
protected void calcPositions()
	{
		for (int index = 0; index < vertexArray.length; index++)
		{
			if (isMoveable[index])
			{
				// Get the distance of displacement for this node for this
				// iteration
				double deltaLength = Math.sqrt(dispX[index] * dispX[index]
						+ dispY[index] * dispY[index]);

				if (deltaLength < 0.001)
				{
					deltaLength = 0.001;
				}

				// Scale down by the current temperature if less than the
				// displacement distance
				double newXDisp = dispX[index] / deltaLength
						* Math.min(deltaLength, temperature);
				double newYDisp = dispY[index] / deltaLength
						* Math.min(deltaLength, temperature);

				// reset displacements
				dispX[index] = 0;
				dispY[index] = 0;

				// Update the cached cell locations
				cellLocation[index][0] += newXDisp;
				cellLocation[index][1] += newYDisp;
			}
		}
	}
/**
	 * Takes the displacements calculated for each cell and applies them to the
	 * local cache of cell positions. Limits the displacement to the current
	 * temperature.
	 */
Takes the displacements calculated for each cell and applies them to the
local cache of cell positions. Limits the displacement to the current
temperature.
Takes the displacements calculated for each cell and applies them to the local cache of cell positions . Limits the displacement to the current temperature .
protected void calcPositions()
	{
		for (int index = 0; index < vertexArray.length; index++)
		{
			if (isMoveable[index])
			{
				double deltaLength = Math.sqrt(dispX[index] * dispX[index]
						+ dispY[index] * dispY[index]);
				if (deltaLength < 0.001)
				{
					deltaLength = 0.001;
				}
				double newXDisp = dispX[index] / deltaLength
						* Math.min(deltaLength, temperature);
				double newYDisp = dispY[index] / deltaLength
						* Math.min(deltaLength, temperature);
				dispX[index] = 0;
				dispY[index] = 0;
				cellLocation[index][0] += newXDisp;
				cellLocation[index][1] += newYDisp;
			}
		}
	}
protected void calcPositions ( ) { for ( int index = 0 ; index < vertexArray . length ; index ++ ) { if ( isMoveable [ index ] ) { double deltaLength = Math . sqrt ( dispX [ index ] * dispX [ index ] + dispY [ index ] * dispY [ index ] ) ; if ( deltaLength < 0.001 ) { deltaLength = 0.001 ; } double newXDisp = dispX [ index ] / deltaLength * Math . min ( deltaLength , temperature ) ; double newYDisp = dispY [ index ] / deltaLength * Math . min ( deltaLength , temperature ) ; dispX [ index ] = 0 ; dispY [ index ] = 0 ; cellLocation [ index ] [ 0 ] += newXDisp ; cellLocation [ index ] [ 1 ] += newYDisp ; } } }
Takes the displacements calculated for each cell and applies them to the
 local cache of cell positions.
Takes the displacements calculated for each cell and applies them to the local cache of cell positions .
// Get the distance of displacement for this node for this // iteration // Scale down by the current temperature if less than the // displacement distance // reset displacements // Update the cached cell locations