Search in sources :

Example 1 with DiagramView

use of org.kie.workbench.common.stunner.cm.client.shape.view.DiagramView in project kie-wb-common by kiegroup.

the class CaseManagementShapeDefFactory method newDiagramShape.

@SuppressWarnings("unchecked")
private Shape newDiagramShape(final Object instance, final ShapeDef shapeDef) {
    final CaseManagementDiagram diagram = (CaseManagementDiagram) instance;
    final CaseManagementDiagramShapeDef cmShapeDef = (CaseManagementDiagramShapeDef) shapeDef;
    final double width = cmShapeDef.getWidth(diagram);
    final double height = cmShapeDef.getHeight(diagram);
    final DiagramView view = cmShapeViewFactory.newDiagramView(width, height);
    return new CMContainerShape(cmShapeDef, view);
}
Also used : DiagramView(org.kie.workbench.common.stunner.cm.client.shape.view.DiagramView) CaseManagementDiagram(org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram) CaseManagementDiagramShapeDef(org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementDiagramShapeDef) CMContainerShape(org.kie.workbench.common.stunner.cm.client.shape.CMContainerShape)

Example 2 with DiagramView

use of org.kie.workbench.common.stunner.cm.client.shape.view.DiagramView in project kie-wb-common by kiegroup.

the class CaseManagementShapeViewFactoryTest method testBuildViews.

@Test
public void testBuildViews() {
    final NullView nullView = tested.newNullView();
    assertNotNull(nullView);
    final ActivityView activityView = tested.newActivityView(100, 200);
    assertNotNull(nullView);
    assertEquals(100, activityView.getWidth(), 0);
    assertEquals(200, activityView.getHeight(), 0);
    final StageView stageView = tested.newStageView(100, 200, 25);
    assertNotNull(stageView);
    assertEquals(100, stageView.getWidth(), 0);
    assertEquals(200, stageView.getHeight(), 0);
    final DiagramView diagramView = tested.newDiagramView(100, 200);
    assertNotNull(diagramView);
    assertEquals(100, diagramView.getWidth(), 0);
    assertEquals(200, diagramView.getHeight(), 0);
}
Also used : DiagramView(org.kie.workbench.common.stunner.cm.client.shape.view.DiagramView) ActivityView(org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView) NullView(org.kie.workbench.common.stunner.cm.client.shape.view.NullView) StageView(org.kie.workbench.common.stunner.cm.client.shape.view.StageView) Test(org.junit.Test)

Aggregations

DiagramView (org.kie.workbench.common.stunner.cm.client.shape.view.DiagramView)2 Test (org.junit.Test)1 CMContainerShape (org.kie.workbench.common.stunner.cm.client.shape.CMContainerShape)1 CaseManagementDiagramShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementDiagramShapeDef)1 ActivityView (org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView)1 NullView (org.kie.workbench.common.stunner.cm.client.shape.view.NullView)1 StageView (org.kie.workbench.common.stunner.cm.client.shape.view.StageView)1 CaseManagementDiagram (org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram)1