@Test public void testInitialize() { CanvasPanel panel = mock(CanvasPanel.class); CanvasSettings settings = mock(CanvasSettings.class); assertEquals(tested, tested.initialize(panel, settings)); verify(wiresManager, times(1)).setSpliceEnabled(eq(false)); verify(wiresManager, times(1)).setLocationAcceptor(eq(ILocationAcceptor.NONE)); verify(wiresManager, times(1)).setContainmentAcceptor(eq(IContainmentAcceptor.NONE)); verify(wiresManager, times(1)).setDockingAcceptor(eq(IDockingAcceptor.NONE)); verify(wiresManager, times(1)).setConnectionAcceptor(eq(IConnectionAcceptor.NONE)); verify(wiresManager, times(1)).setControlPointsAcceptor(eq(IControlPointsAcceptor.NONE)); verify(view, times(1)).use(eq(wiresManager)); verify(view, times(1)).initialize(eq(panel), eq(settings)); assertEquals(wiresManager, tested.getWiresManager()); }
@Override public AbstractCanvas<WiresCanvasView> initialize(final CanvasPanel panel, final CanvasSettings settings) { super.initialize(panel, settings); final WiresLayer layer = getView().getLayer(); wiresManager = wiresManagerFactory.newWiresManager(layer.getLienzoLayer()); wiresManager.setSpliceEnabled(false); wiresManager.setLocationAcceptor(ILocationAcceptor.NONE); wiresManager.setContainmentAcceptor(IContainmentAcceptor.NONE); wiresManager.setDockingAcceptor(IDockingAcceptor.NONE); wiresManager.setConnectionAcceptor(IConnectionAcceptor.NONE); wiresManager.setControlPointsAcceptor(IControlPointsAcceptor.NONE); view.use(wiresManager); return this; }
WiresCanvas extends LienzoCanvas<WiresCanvasView> { @Override public AbstractCanvas<WiresCanvasView> initialize(final CanvasPanel panel, final CanvasSettings settings) { super.initialize(panel, settings); final WiresLayer layer = getView().getLayer(); wiresManager = wiresManagerFactory.newWiresManager(layer.getLienzoLayer()); wiresManager.setSpliceEnabled(false); wiresManager.setLocationAcceptor(ILocationAcceptor.NONE); wiresManager.setContainmentAcceptor(IContainmentAcceptor.NONE); wiresManager.setDockingAcceptor(IDockingAcceptor.NONE); wiresManager.setConnectionAcceptor(IConnectionAcceptor.NONE); wiresManager.setControlPointsAcceptor(IControlPointsAcceptor.NONE); view.use(wiresManager); return this; } }
WiresCanvas extends LienzoCanvas<WiresCanvasView> { @Override public AbstractCanvas<WiresCanvasView> initialize(final CanvasPanel panel, final CanvasSettings settings) { super.initialize(panel, settings); final WiresLayer layer = getView().getLayer(); wiresManager = wiresManagerFactory.newWiresManager(layer.getLienzoLayer()); wiresManager.setSpliceEnabled(false); wiresManager.setLocationAcceptor(ILocationAcceptor.NONE); wiresManager.setContainmentAcceptor(IContainmentAcceptor.NONE); wiresManager.setDockingAcceptor(IDockingAcceptor.NONE); wiresManager.setConnectionAcceptor(IConnectionAcceptor.NONE); wiresManager.setControlPointsAcceptor(IControlPointsAcceptor.NONE); view.use(wiresManager); return this; } @Inject  WiresCanvas(final Event<CanvasClearEvent> canvasClearEvent,
                       final Event<CanvasShapeAddedEvent> canvasShapeAddedEvent,
                       final Event<CanvasShapeRemovedEvent> canvasShapeRemovedEvent,
                       final Event<CanvasDrawnEvent> canvasDrawnEvent,
                       final Event<CanvasFocusedEvent> canvasFocusedEvent,
                       final @Default WiresManagerFactory wiresManagerFactory,
                       final WiresCanvasView view); }
WiresCanvas extends LienzoCanvas<WiresCanvasView> { @Override public AbstractCanvas<WiresCanvasView> initialize(final CanvasPanel panel, final CanvasSettings settings) { super.initialize(panel, settings); final WiresLayer layer = getView().getLayer(); wiresManager = wiresManagerFactory.newWiresManager(layer.getLienzoLayer()); wiresManager.setSpliceEnabled(false); wiresManager.setLocationAcceptor(ILocationAcceptor.NONE); wiresManager.setContainmentAcceptor(IContainmentAcceptor.NONE); wiresManager.setDockingAcceptor(IDockingAcceptor.NONE); wiresManager.setConnectionAcceptor(IConnectionAcceptor.NONE); wiresManager.setControlPointsAcceptor(IControlPointsAcceptor.NONE); view.use(wiresManager); return this; } @Inject  WiresCanvas(final Event<CanvasClearEvent> canvasClearEvent,
                       final Event<CanvasShapeAddedEvent> canvasShapeAddedEvent,
                       final Event<CanvasShapeRemovedEvent> canvasShapeRemovedEvent,
                       final Event<CanvasDrawnEvent> canvasDrawnEvent,
                       final Event<CanvasFocusedEvent> canvasFocusedEvent,
                       final @Default WiresManagerFactory wiresManagerFactory,
                       final WiresCanvasView view); @Override AbstractCanvas<WiresCanvasView> initialize(final CanvasPanel panel,
                                                      final CanvasSettings settings); @Override WiresCanvasView getView(); WiresManager getWiresManager(); }
WiresCanvas extends LienzoCanvas<WiresCanvasView> { @Override public AbstractCanvas<WiresCanvasView> initialize(final CanvasPanel panel, final CanvasSettings settings) { super.initialize(panel, settings); final WiresLayer layer = getView().getLayer(); wiresManager = wiresManagerFactory.newWiresManager(layer.getLienzoLayer()); wiresManager.setSpliceEnabled(false); wiresManager.setLocationAcceptor(ILocationAcceptor.NONE); wiresManager.setContainmentAcceptor(IContainmentAcceptor.NONE); wiresManager.setDockingAcceptor(IDockingAcceptor.NONE); wiresManager.setConnectionAcceptor(IConnectionAcceptor.NONE); wiresManager.setControlPointsAcceptor(IControlPointsAcceptor.NONE); view.use(wiresManager); return this; } @Inject  WiresCanvas(final Event<CanvasClearEvent> canvasClearEvent,
                       final Event<CanvasShapeAddedEvent> canvasShapeAddedEvent,
                       final Event<CanvasShapeRemovedEvent> canvasShapeRemovedEvent,
                       final Event<CanvasDrawnEvent> canvasDrawnEvent,
                       final Event<CanvasFocusedEvent> canvasFocusedEvent,
                       final @Default WiresManagerFactory wiresManagerFactory,
                       final WiresCanvasView view); @Override AbstractCanvas<WiresCanvasView> initialize(final CanvasPanel panel,
                                                      final CanvasSettings settings); @Override WiresCanvasView getView(); WiresManager getWiresManager(); static final String WIRES_CANVAS_GROUP_ID; }