01: package org.drools.eclipse.flow.common.editor.editpart;
02:
03: import org.eclipse.draw2d.AbstractLayout;
04: import org.eclipse.draw2d.IFigure;
05: import org.eclipse.draw2d.geometry.Dimension;
06:
07: public class GraphLayoutManager extends AbstractLayout {
08:
09: private ProcessEditPart diagram;
10:
11: public GraphLayoutManager(ProcessEditPart diagram) {
12: this .diagram = diagram;
13: }
14:
15: protected Dimension calculatePreferredSize(IFigure container,
16: int wHint, int hHint) {
17: container.validate();
18: return container.getSize();
19: }
20:
21: public void layout(IFigure container) {
22: new DirectedGraphLayoutVisitor().layoutDiagram(diagram);
23: // diagram.setTableModelBounds();
24: }
25:
26: }
|