use of org.kie.workbench.common.stunner.core.client.canvas.controls.zoom.ZoomControl in project kie-wb-common by kiegroup.
the class SessionPreviewImplTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() {
this.preview = new SessionPreviewImpl(definitionManager, shapeManager, textPropertyProviderFactory, canvasCommandManager, definitionUtils, graphUtils, canvasHandlerFactories, canvasCommandFactories, selectionControl, view);
final DiagramImpl diagram = new DiagramImpl("diagram", new MetadataImpl());
final GraphImpl graph = new GraphImpl("graph", new GraphNodeStoreImpl());
final DefinitionSetImpl definitionSet = new DefinitionSetImpl("id");
diagram.setGraph(graph);
graph.setContent(definitionSet);
definitionSet.setBounds(new BoundsImpl(new BoundImpl(0.0, 0.0), new BoundImpl(100.0, 100.0)));
when(session.getCanvasHandler()).thenReturn(canvasHandler);
when(session.getCanvas()).thenReturn(canvas);
when(canvasHandler.getDiagram()).thenReturn(diagram);
when(shapeManager.getCanvasFactory(any(Diagram.class))).thenReturn(canvasFactory);
when(canvasFactory.newCanvas()).thenReturn(canvas);
when(canvasFactory.newControl(eq(ZoomControl.class))).thenReturn(zoomControl);
when(canvasHandlerFactories.select(any(Annotation.class))).thenReturn(canvasHandlerFactories);
when(canvasHandlerFactories.get()).thenReturn(canvasHandler);
when(canvas.getView()).thenReturn(canvasView);
preview.open(session, callback);
}
use of org.kie.workbench.common.stunner.core.client.canvas.controls.zoom.ZoomControl in project kie-wb-common by kiegroup.
the class CaseManagementCanvasFactoryTest method testControls.
@Test
public void testControls() {
ConnectionAcceptorControl connectionAcceptorControl = factory.newControl(ConnectionAcceptorControl.class);
assertNotNull(connectionAcceptorControl);
ContainmentAcceptorControl containmentAcceptorControl = factory.newControl(ContainmentAcceptorControl.class);
assertNotNull(containmentAcceptorControl);
DockingAcceptorControl dockingAcceptorControl = factory.newControl(DockingAcceptorControl.class);
assertNotNull(dockingAcceptorControl);
CanvasInPlaceTextEditorControl canvasInPlaceTextEditorControl = factory.newControl(CanvasInPlaceTextEditorControl.class);
assertNotNull(canvasInPlaceTextEditorControl);
SelectionControl selectionControl = factory.newControl(SelectionControl.class);
assertNotNull(selectionControl);
ElementBuilderControl elementBuilderControl = factory.newControl(ElementBuilderControl.class);
assertNotNull(elementBuilderControl);
NodeBuilderControl nodeBuilderControl = factory.newControl(NodeBuilderControl.class);
assertNotNull(nodeBuilderControl);
EdgeBuilderControl edgeBuilderControl = factory.newControl(EdgeBuilderControl.class);
assertNotNull(edgeBuilderControl);
ZoomControl zoomControl = factory.newControl(ZoomControl.class);
assertNotNull(zoomControl);
PanControl panControl = factory.newControl(PanControl.class);
assertNotNull(panControl);
KeyboardControl keyboardControl = factory.newControl(KeyboardControl.class);
assertNotNull(keyboardControl);
}
Aggregations