@Test public void testEnsureDragConstraints() throws Exception { tested.init(canvasHandler); Bounds bounds = Bounds.create(0d, 0d, 600d, 600d); when(canvasPanel.getLocationConstraints()).thenReturn(bounds); tested.register(element); verify(shapeView, times(1)).setDragBounds(eq(bounds)); }
@SuppressWarnings("unchecked") private static void ensureDragConstraints(final AbstractCanvas<?> canvas, final ShapeView shapeView) { final Bounds bounds = canvas.getView().getPanel().getLocationConstraints(); ShapeUtils.enforceLocationConstraints(shapeView, bounds); }
LocationControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements LocationControl<AbstractCanvasHandler, Element>,
                   CanvasControl.SessionAware<EditorSession> { @SuppressWarnings("unchecked") private static void ensureDragConstraints(final AbstractCanvas<?> canvas, final ShapeView shapeView) { final Bounds bounds = canvas.getView().getPanel().getLocationConstraints(); ShapeUtils.enforceLocationConstraints(shapeView, bounds); } }
LocationControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements LocationControl<AbstractCanvasHandler, Element>,
                   CanvasControl.SessionAware<EditorSession> { @SuppressWarnings("unchecked") private static void ensureDragConstraints(final AbstractCanvas<?> canvas, final ShapeView shapeView) { final Bounds bounds = canvas.getView().getPanel().getLocationConstraints(); ShapeUtils.enforceLocationConstraints(shapeView, bounds); } protected  LocationControlImpl(); @Inject  LocationControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                               final Event<ShapeLocationsChangedEvent> shapeLocationsChangedEvent,
                               final Event<CanvasSelectionEvent> selectionEvent); }
LocationControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements LocationControl<AbstractCanvasHandler, Element>,
                   CanvasControl.SessionAware<EditorSession> { @SuppressWarnings("unchecked") private static void ensureDragConstraints(final AbstractCanvas<?> canvas, final ShapeView shapeView) { final Bounds bounds = canvas.getView().getPanel().getLocationConstraints(); ShapeUtils.enforceLocationConstraints(shapeView, bounds); } protected  LocationControlImpl(); @Inject  LocationControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                               final Event<ShapeLocationsChangedEvent> shapeLocationsChangedEvent,
                               final Event<CanvasSelectionEvent> selectionEvent); Collection<String> getSelectedIDs(); @Override void bind(final EditorSession session); void handleArrowKeys(final Key... keys); @Override void setCommandManagerProvider(final CommandManagerProvider<AbstractCanvasHandler> provider); @Override @SuppressWarnings("unchecked") void register(final Element element); @Override @SuppressWarnings("unchecked") CommandResult<CanvasViolation> move(final Element[] elements,
                                               final Point2D[] locations); }
LocationControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements LocationControl<AbstractCanvasHandler, Element>,
                   CanvasControl.SessionAware<EditorSession> { @SuppressWarnings("unchecked") private static void ensureDragConstraints(final AbstractCanvas<?> canvas, final ShapeView shapeView) { final Bounds bounds = canvas.getView().getPanel().getLocationConstraints(); ShapeUtils.enforceLocationConstraints(shapeView, bounds); } protected  LocationControlImpl(); @Inject  LocationControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                               final Event<ShapeLocationsChangedEvent> shapeLocationsChangedEvent,
                               final Event<CanvasSelectionEvent> selectionEvent); Collection<String> getSelectedIDs(); @Override void bind(final EditorSession session); void handleArrowKeys(final Key... keys); @Override void setCommandManagerProvider(final CommandManagerProvider<AbstractCanvasHandler> provider); @Override @SuppressWarnings("unchecked") void register(final Element element); @Override @SuppressWarnings("unchecked") CommandResult<CanvasViolation> move(final Element[] elements,
                                               final Point2D[] locations);  }