pl.edu.agh.cast.schema.editor.layout.algorithm
Class RandomLayoutAlgorithm

java.lang.Object
  extended by pl.edu.agh.cast.schema.editor.layout.algorithm.AbstractLayoutAlgorithm
      extended by pl.edu.agh.cast.schema.editor.layout.algorithm.RandomLayoutAlgorithm
All Implemented Interfaces:
ILayoutAlgorithm

public class RandomLayoutAlgorithm
extends AbstractLayoutAlgorithm

An example algorithm, laying out nodes randomly.

Author:
AGH CAST Team

Constructor Summary
RandomLayoutAlgorithm()
           
 
Method Summary
protected  int getWorkUnits(int nodesCount)
          Queries for number of planned work units in the algorithm
protected  void setNodesPositions(Collection<ISchemaNode> positionNodes, org.eclipse.core.runtime.IProgressMonitor monitor)
          Sets positions of given nodes.
 
Methods inherited from class pl.edu.agh.cast.schema.editor.layout.algorithm.AbstractLayoutAlgorithm
getCenterOfGravity, getUpperLeftCorner, layoutNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomLayoutAlgorithm

public RandomLayoutAlgorithm()
Method Detail

setNodesPositions

protected void setNodesPositions(Collection<ISchemaNode> positionNodes,
                                 org.eclipse.core.runtime.IProgressMonitor monitor)
Sets positions of given nodes.

Specified by:
setNodesPositions in class AbstractLayoutAlgorithm
Parameters:
positionNodes - nodes to layout
monitor - non-null progress monitor
See Also:
#setNodesPositions(java.util.Collection, org.eclipse.core.runtime.IProgressMonitor)

getWorkUnits

protected int getWorkUnits(int nodesCount)
Description copied from class: AbstractLayoutAlgorithm
Queries for number of planned work units in the algorithm

Specified by:
getWorkUnits in class AbstractLayoutAlgorithm
Parameters:
nodesCount - number of nodes to layout
Returns:
number of units that will be added to progress monitor's maximum range


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.