@Test public void testDeleteRoot() { WiresShapeView shapeView = new WiresShapeView(new MultiPath().rect(0, 0, 50, 50)); tested.deleteRoot(shapeView); verify(wiresLayer, times(1)).delete(eq(shapeView.getGroup())); }
public LienzoCanvasView deleteRoot(final ShapeView<?> shape) { if (WiresUtils.isWiresShape(shape)) { layer.delete(((WiresShape) shape).getGroup()); } else if (WiresUtils.isWiresConnector(shape)) { layer.delete(((WiresConnector) shape).getGroup()); } else { return super.delete(shape); } return this; }
WiresCanvasView extends LienzoCanvasView<WiresLayer> { public LienzoCanvasView deleteRoot(final ShapeView<?> shape) { if (WiresUtils.isWiresShape(shape)) { layer.delete(((WiresShape) shape).getGroup()); } else if (WiresUtils.isWiresConnector(shape)) { layer.delete(((WiresConnector) shape).getGroup()); } else { return super.delete(shape); } return this; } }
WiresCanvasView extends LienzoCanvasView<WiresLayer> { public LienzoCanvasView deleteRoot(final ShapeView<?> shape) { if (WiresUtils.isWiresShape(shape)) { layer.delete(((WiresShape) shape).getGroup()); } else if (WiresUtils.isWiresConnector(shape)) { layer.delete(((WiresConnector) shape).getGroup()); } else { return super.delete(shape); } return this; } @Inject  WiresCanvasView(final WiresLayer layer); }
WiresCanvasView extends LienzoCanvasView<WiresLayer> { public LienzoCanvasView deleteRoot(final ShapeView<?> shape) { if (WiresUtils.isWiresShape(shape)) { layer.delete(((WiresShape) shape).getGroup()); } else if (WiresUtils.isWiresConnector(shape)) { layer.delete(((WiresConnector) shape).getGroup()); } else { return super.delete(shape); } return this; } @Inject  WiresCanvasView(final WiresLayer layer); void use(final WiresManager wiresManager); @Override LienzoCanvasView<WiresLayer> add(final ShapeView<?> shape); LienzoCanvasView addRoot(final ShapeView<?> shape); @Override LienzoCanvasView<WiresLayer> delete(final ShapeView<?> shape); LienzoCanvasView deleteRoot(final ShapeView<?> shape); @Override LienzoCanvasView addChild(final ShapeView<?> parent,
                                     final ShapeView<?> child); @Override LienzoCanvasView deleteChild(final ShapeView<?> parent,
                                        final ShapeView<?> child); @Override LienzoCanvasView dock(final ShapeView<?> parent,
                                 final ShapeView<?> child); @Override LienzoCanvasView undock(final ShapeView<?> childParent,
                                   final ShapeView<?> child); @Override WiresLayer getLayer(); }
WiresCanvasView extends LienzoCanvasView<WiresLayer> { public LienzoCanvasView deleteRoot(final ShapeView<?> shape) { if (WiresUtils.isWiresShape(shape)) { layer.delete(((WiresShape) shape).getGroup()); } else if (WiresUtils.isWiresConnector(shape)) { layer.delete(((WiresConnector) shape).getGroup()); } else { return super.delete(shape); } return this; } @Inject  WiresCanvasView(final WiresLayer layer); void use(final WiresManager wiresManager); @Override LienzoCanvasView<WiresLayer> add(final ShapeView<?> shape); LienzoCanvasView addRoot(final ShapeView<?> shape); @Override LienzoCanvasView<WiresLayer> delete(final ShapeView<?> shape); LienzoCanvasView deleteRoot(final ShapeView<?> shape); @Override LienzoCanvasView addChild(final ShapeView<?> parent,
                                     final ShapeView<?> child); @Override LienzoCanvasView deleteChild(final ShapeView<?> parent,
                                        final ShapeView<?> child); @Override LienzoCanvasView dock(final ShapeView<?> parent,
                                 final ShapeView<?> child); @Override LienzoCanvasView undock(final ShapeView<?> childParent,
                                   final ShapeView<?> child); @Override WiresLayer getLayer();  }