use of org.eclipse.draw2d.FreeformLayer in project archi by archimatetool.
the class FreeformGraphicalRootEditPart method createLayers.
/**
* Creates the top-most set of layers on the given layered pane.
*
* @param layeredPane
* the parent for the created layers
*/
protected void createLayers(LayeredPane layeredPane) {
layeredPane.add(createGridLayer(), GRID_LAYER);
layeredPane.add(getPrintableLayers(), PRINTABLE_LAYERS);
layeredPane.add(new FreeformLayer(), HANDLE_LAYER);
layeredPane.add(new FeedbackLayer(), FEEDBACK_LAYER);
layeredPane.add(new GuideLayer(), GUIDE_LAYER);
}
use of org.eclipse.draw2d.FreeformLayer in project archi by archimatetool.
the class AbstractDiagramPart method createFigure.
@Override
protected IFigure createFigure() {
FreeformLayer figure = new FreeformLayer();
// Provide an edge when in negative space
// Causes snap to grid problems when in negative space
figure.setBorder(new MarginBorder(5));
figure.setLayoutManager(new FreeformLayout());
// Have to add this if we want Animation to work on figures!
AnimationUtil.addFigureForAnimation(figure);
// Anti-aliasing
setAntiAlias();
return figure;
}
use of org.eclipse.draw2d.FreeformLayer in project archi by archimatetool.
the class AbstractContainerFigure method getMainFigure.
/**
* @return The main figure to draw on
*/
public IFigure getMainFigure() {
if (fMainFigure == null) {
fMainFigure = new FreeformLayer();
fMainFigure.setLayoutManager(new XYLayout());
// Have to add this if we want Animation to work on figures
AnimationUtil.addFigureForAnimation(fMainFigure);
}
return fMainFigure;
}
use of org.eclipse.draw2d.FreeformLayer in project archi by archimatetool.
the class AbstractExportProviderTests method runOnceBeforeEachTest.
public void runOnceBeforeEachTest() {
shell = new Shell();
rootFigure = new FreeformLayer();
rootFigure.setBounds(new Rectangle(0, 0, 500, 500));
}
use of org.eclipse.draw2d.FreeformLayer in project archi by archimatetool.
the class DiagramUtilsTests method testGetMinimumBounds_FreeformLayer.
@Test
public void testGetMinimumBounds_FreeformLayer() {
IFigure rootFigure = new FreeformLayer();
org.eclipse.draw2d.geometry.Rectangle rect1 = new org.eclipse.draw2d.geometry.Rectangle(0, 0, 1000, 1000);
rootFigure.setBounds(rect1);
assertNull(DiagramUtils.getMinimumBounds(rootFigure));
IFigure childFigure = new Figure();
org.eclipse.draw2d.geometry.Rectangle rect2 = new org.eclipse.draw2d.geometry.Rectangle(10, 10, 50, 50);
childFigure.setBounds(rect2);
rootFigure.add(childFigure);
childFigure = new Figure();
org.eclipse.draw2d.geometry.Rectangle rect3 = new org.eclipse.draw2d.geometry.Rectangle(200, 220, 100, 100);
childFigure.setBounds(rect3);
rootFigure.add(childFigure);
assertEquals(new org.eclipse.draw2d.geometry.Rectangle(10, 10, 290, 310), DiagramUtils.getMinimumBounds(rootFigure));
}
Aggregations