protected static SVGPrimitiveShape newSVGPrimitiveShape(final Shape<?> primitive, final boolean scalable, final LayoutContainer.Layout layout) { return new SVGPrimitiveShape(primitive, scalable, layout); } }
public static SVGPrimitiveShape newSVGPrimitiveShape(final Shape<?> primitive, final boolean scalable, final LayoutContainer.Layout layout) { return new SVGPrimitiveShape(primitive, scalable, layout); } }
@Override protected CaseManagementShapeView createGhostShapeView(String shapeLabel, double width, double height) { return new CaseManagementDiagramShapeView(shapeLabel, new SVGPrimitiveShape(getShape().copy()), width, height, false); }
@Override protected CaseManagementShapeView createGhostShapeView(String shapeLabel, double width, double height) { return new CaseManagementStageShapeView(shapeLabel, new SVGPrimitiveShape(getShape().copy()), width, height, false); }
protected CaseManagementShapeView createGhostShapeView(String shapeLabel, double width, double height) { return new CaseManagementShapeView(shapeLabel, new SVGPrimitiveShape(getShape().copy()), width, height, false); }
private CaseManagementShapeView createShapeView(String name) { final Shape primitiveShapes = new MockShape(); primitiveShapes.setID(UUID.randomUUID().toString()); final CaseManagementShapeView view = new CaseManagementShapeView(name, new SVGPrimitiveShape(primitiveShapes), 0d, 0d, false); view.setUUID(UUID.randomUUID().toString()); return spy(view); }
@Test public void testRemoveShadow() { Shape<?> instance = mock(Shape.class); tested = new SVGPrimitiveShape(instance); tested.removeShadow(); verify(instance, times(1)).setShadow(eq(null)); } }
@Before public void setUp() throws Exception { Shape primitiveShapes = new MockShape(); primitiveShapes.setID(UUID.randomUUID().toString()); tested = new CaseManagementDiagramShapeView("", new SVGPrimitiveShape(primitiveShapes), 0d, 0d, false); tested.setUUID(UUID.randomUUID().toString()); }
@Test public void testAddChild() { primitiveShape = new SVGPrimitiveShape(rectangle); tested.addChild(primitiveShape); verify(shapeView, times(1)).addChild(eq(rectangle)); assertEquals(1, tested.getChildren().size()); assertEquals(primitiveShape, tested.getChildren().iterator().next()); }
@Test public void testAddChildScalable() { primitiveShape = new SVGPrimitiveShape(rectangle, true, null); tested.addChild(primitiveShape); verify(shapeView, times(1)).addScalableChild(eq(rectangle)); assertEquals(1, tested.getChildren().size()); assertEquals(primitiveShape, tested.getChildren().iterator().next()); }
@Test public void testAddChildLayout() { primitiveShape = new SVGPrimitiveShape(rectangle, false, LayoutContainer.Layout.BOTTOM); tested.addChild(primitiveShape); verify(shapeView, times(1)).addChild(eq(rectangle), eq(LayoutContainer.Layout.BOTTOM)); assertEquals(1, tested.getChildren().size()); assertEquals(primitiveShape, tested.getChildren().iterator().next()); } }
private CaseManagementShapeView makeWiresShape(Optional<String> uuid) { final CaseManagementShapeView shape = new CaseManagementShapeView("mock", new SVGPrimitiveShape(new Rectangle(0d, 0d)), 0d, 0d, false); uuid.ifPresent(shape::setUUID); WiresUtils.assertShapeGroup(shape.getGroup(), WiresCanvas.WIRES_CANVAS_GROUP_ID); return shape; }
@Test public void testMoveMethods() { Shape<?> instance = mock(Shape.class); tested = new SVGPrimitiveShape(instance); tested.moveToTop(); verify(instance, times(1)).moveToTop(); tested.moveToBottom(); verify(instance, times(1)).moveToBottom(); tested.moveDown(); verify(instance, times(1)).moveDown(); tested.moveUp(); verify(instance, times(1)).moveUp(); }
@Test public void testBuild_subprocess() throws Exception { final SVGShapeView shapeView = tested.build("subprocess", new SVGPrimitiveShape(new Rectangle(0d, 0d)), 10d, 10d, false); assertTrue(shapeView instanceof CaseManagementShapeView); }
@Test public void testBuild_rectangle() throws Exception { final SVGShapeView shapeView = tested.build("rectangle", new SVGPrimitiveShape(new Rectangle(0d, 0d)), 10d, 10d, false); assertTrue(shapeView instanceof CaseManagementDiagramShapeView); }
@Test public void testBuild_stage() throws Exception { final SVGShapeView shapeView = tested.build("stage", new SVGPrimitiveShape(new Rectangle(0d, 0d)), 10d, 10d, false); assertTrue(shapeView instanceof CaseManagementStageShapeView); }
@Test public void testBuild_subcase() throws Exception { final SVGShapeView shapeView = tested.build("subcase", new SVGPrimitiveShape(new Rectangle(0d, 0d)), 10d, 10d, false); assertTrue(shapeView instanceof CaseManagementShapeView); }
@Test public void testBuild_task() throws Exception { final SVGShapeView shapeView = tested.build("task", new SVGPrimitiveShape(new Rectangle(0d, 0d)), 10d, 10d, false); assertTrue(shapeView instanceof CaseManagementShapeView); } }
@Before public void setup() throws Exception { group = new Group().setID("cont1"); rectangle = new Rectangle(10d, 10d).setID("rect1"); someShape = new SVGPrimitiveShape(rectangle); tested = new SVGContainer("cont1", group, true, LayoutContainer.Layout.BOTTOM); }
@Before public void setup() throws Exception { shape = new Rectangle(10, 10) .setID("theShape") .setAlpha(0.5d) .setX(100d) .setY(200d) .setFillColor("fillColor") .setFillAlpha(0.1d) .setStrokeColor("strokeColor") .setStrokeAlpha(0.2d) .setStrokeWidth(0.3d); tested = new SVGPrimitiveShape(shape); }