|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.schema.editor.layout.algorithm.AbstractLayoutAlgorithm
public abstract class AbstractLayoutAlgorithm
Abstract algorithm positioning nodes taking under consideration their original position.
Constructor Summary | |
---|---|
AbstractLayoutAlgorithm()
|
Method Summary | |
---|---|
protected org.eclipse.draw2d.geometry.Point |
getCenterOfGravity(Collection<ISchemaNode> nodes)
Returns coordinates of the center of gravity of nodes |
protected org.eclipse.draw2d.geometry.Point |
getUpperLeftCorner(Collection<ISchemaNode> positionedNodes)
Returns coordinates of the upper left and bottom right corner of area occupied by nodes. |
protected abstract int |
getWorkUnits(int nodesCount)
Queries for number of planned work units in the algorithm |
void |
layoutNodes(Collection<ISchemaNode> nodes,
org.eclipse.core.runtime.IProgressMonitor monitor)
Lays out nodes, preserving their center of gravity. |
protected abstract void |
setNodesPositions(Collection<ISchemaNode> positionNodes,
org.eclipse.core.runtime.IProgressMonitor monitor)
Sets positions of given nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractLayoutAlgorithm()
Method Detail |
---|
protected abstract void setNodesPositions(Collection<ISchemaNode> positionNodes, org.eclipse.core.runtime.IProgressMonitor monitor)
positionNodes
- nodes to layoutmonitor
- non-null progress monitorpublic void layoutNodes(Collection<ISchemaNode> nodes, org.eclipse.core.runtime.IProgressMonitor monitor)
ILayoutAlgorithm#setNodesPositions(Collection)
to perform the actual layout. Ensures that the new layout preserves the center of gravity of the old one, and
that no node is moved behind the left and top borders of the diagram
Method executed to layout a collection of visual nodes.
layoutNodes
in interface ILayoutAlgorithm
nodes
- nodes on which layout will be performedmonitor
- progress monitor used to report progress of layout operation; MUST NOT be nullprotected org.eclipse.draw2d.geometry.Point getCenterOfGravity(Collection<ISchemaNode> nodes)
nodes
- collection of nodes whose center will be calculated
protected org.eclipse.draw2d.geometry.Point getUpperLeftCorner(Collection<ISchemaNode> positionedNodes)
positionedNodes
- collection of visual schema nodes nodes
protected abstract int getWorkUnits(int nodesCount)
nodesCount
- number of nodes to layout
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |