use of org.eclipse.gef.ui.parts.GraphicalViewerImpl in project archi by archimatetool.
the class DiagramUtilsTests method testGetDiagramExtents.
@Test
public void testGetDiagramExtents() {
IDiagramModel dm = model.getDiagramModels().get(2);
// x of furthest object in diagram, and its width
int width = 720 + 193;
// x of furthest object in diagram, and its height
int height = 468 + 85;
Shell shell = new Shell();
GraphicalViewerImpl viewer = DiagramUtils.createViewer(dm, shell);
shell.dispose();
org.eclipse.draw2d.geometry.Rectangle rect = DiagramUtils.getDiagramExtents(viewer);
assertEquals(new org.eclipse.draw2d.geometry.Rectangle(0, 0, width, height), rect);
}
use of org.eclipse.gef.ui.parts.GraphicalViewerImpl in project archi by archimatetool.
the class DiagramUtilsTests method testCreateViewer_ArchimateModel.
@Test
public void testCreateViewer_ArchimateModel() {
IDiagramModel dm = model.getDiagramModels().get(0);
assertTrue(dm instanceof IArchimateDiagramModel);
Shell shell = new Shell();
GraphicalViewerImpl viewer = DiagramUtils.createViewer(dm, shell);
assertNotNull(viewer);
assertTrue(viewer.getEditPartFactory() instanceof ArchimateDiagramEditPartFactory);
assertTrue(viewer.getRootEditPart() instanceof FreeformGraphicalRootEditPart);
assertSame(dm, viewer.getContents().getModel());
assertSame(shell, viewer.getControl().getShell());
shell.dispose();
}
use of org.eclipse.gef.ui.parts.GraphicalViewerImpl in project liferay-ide by liferay.
the class LayoutTplPreviewEditor method createGraphicalViewer.
protected void createGraphicalViewer(Composite parent) {
GraphicalViewer viewer = new GraphicalViewerImpl();
viewer.createControl(parent);
setGraphicalViewer(viewer);
configureGraphicalViewer();
hookGraphicalViewer();
initializeGraphicalViewer();
}
Aggregations