@Test public void testDockButNoContext() { WiresShapeControl control = mock(WiresShapeControl.class); WiresDockingControl dockingControl = mock(WiresDockingControl.class); when(control.getDockingControl()).thenReturn(dockingControl); when(shape.getControl()).thenReturn(control); when(dockingControl.getCandidateLocation()).thenReturn(null); WiresShape parent = mock(WiresShape.class); tested.dock(parent, shape); verify(dockingControl, times(1)).dock(eq(parent)); verify(shape, never()).setLocation(any(Point2D.class)); }
public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); final Point2D candidateLocation = dockingControl.getCandidateLocation(); if (null != candidateLocation) { child.setLocation(candidateLocation); } return this; }
WiresLayer extends LienzoLayer { public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); final Point2D candidateLocation = dockingControl.getCandidateLocation(); if (null != candidateLocation) { child.setLocation(candidateLocation); } return this; } }
WiresLayer extends LienzoLayer { public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); final Point2D candidateLocation = dockingControl.getCandidateLocation(); if (null != candidateLocation) { child.setLocation(candidateLocation); } return this; }  }
WiresLayer extends LienzoLayer { public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); final Point2D candidateLocation = dockingControl.getCandidateLocation(); if (null != candidateLocation) { child.setLocation(candidateLocation); } return this; }  WiresLayer use(final WiresManager wiresManager); LienzoLayer add(final WiresShape wiresShape); LienzoLayer add(final WiresConnector wiresConnector); LienzoLayer delete(final WiresShape wiresShape); LienzoLayer delete(final WiresConnector wiresConnector); WiresLayer addChild(final WiresContainer parent,
                               final WiresShape child); WiresLayer deleteChild(final WiresContainer parent,
                                  final WiresShape child); WiresLayer dock(final WiresContainer parent,
                           final WiresShape child); WiresLayer undock(final WiresShape child); WiresManager getWiresManager(); @Override void destroy(); }
WiresLayer extends LienzoLayer { public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); final Point2D candidateLocation = dockingControl.getCandidateLocation(); if (null != candidateLocation) { child.setLocation(candidateLocation); } return this; }  WiresLayer use(final WiresManager wiresManager); LienzoLayer add(final WiresShape wiresShape); LienzoLayer add(final WiresConnector wiresConnector); LienzoLayer delete(final WiresShape wiresShape); LienzoLayer delete(final WiresConnector wiresConnector); WiresLayer addChild(final WiresContainer parent,
                               final WiresShape child); WiresLayer deleteChild(final WiresContainer parent,
                                  final WiresShape child); WiresLayer dock(final WiresContainer parent,
                           final WiresShape child); WiresLayer undock(final WiresShape child); WiresManager getWiresManager(); @Override void destroy();  }