@Test public void testAcceptTarget() { tested.init(canvasHandler); final boolean allow = tested.acceptTarget(node, edge, connection); assertTrue(allow); verify(commandManager, times(1)).execute(eq(canvasHandler), eq(setConnectionTargetNodeCommand)); verify(commandManager, never()).allow(any(AbstractCanvasHandler.class), any(SetConnectionSourceNodeCommand.class)); assertEquals(node, setConnectionTargetNodeCommand.getNode()); assertEquals(edge, setConnectionTargetNodeCommand.getEdge()); assertEquals(connection, setConnectionTargetNodeCommand.getConnection()); verify(highlight, times(1)).unhighLight(); }
@Override @SuppressWarnings("unchecked") public boolean acceptTarget(final Node target, final Edge<ViewConnector<?>, Node> connector, final Connection connection) { ensureUnHighLight(); if (isTargetChanged(target, connector)) { final CommandResult<CanvasViolation> violations = getCommandManager().execute(getCanvasHandler(), canvasCommandFactory.setTargetNode(target, connector, connection)); return isAccept(violations); } return true; }
ConnectionAcceptorControlImpl extends AbstractAcceptorControl implements ConnectionAcceptorControl<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public boolean acceptTarget(final Node target, final Edge<ViewConnector<?>, Node> connector, final Connection connection) { ensureUnHighLight(); if (isTargetChanged(target, connector)) { final CommandResult<CanvasViolation> violations = getCommandManager().execute(getCanvasHandler(), canvasCommandFactory.setTargetNode(target, connector, connection)); return isAccept(violations); } return true; } }
ConnectionAcceptorControlImpl extends AbstractAcceptorControl implements ConnectionAcceptorControl<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public boolean acceptTarget(final Node target, final Edge<ViewConnector<?>, Node> connector, final Connection connection) { ensureUnHighLight(); if (isTargetChanged(target, connector)) { final CommandResult<CanvasViolation> violations = getCommandManager().execute(getCanvasHandler(), canvasCommandFactory.setTargetNode(target, connector, connection)); return isAccept(violations); } return true; } @Inject  ConnectionAcceptorControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                         final CanvasHighlight canvasHighlight); }
ConnectionAcceptorControlImpl extends AbstractAcceptorControl implements ConnectionAcceptorControl<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public boolean acceptTarget(final Node target, final Edge<ViewConnector<?>, Node> connector, final Connection connection) { ensureUnHighLight(); if (isTargetChanged(target, connector)) { final CommandResult<CanvasViolation> violations = getCommandManager().execute(getCanvasHandler(), canvasCommandFactory.setTargetNode(target, connector, connection)); return isAccept(violations); } return true; } @Inject  ConnectionAcceptorControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                         final CanvasHighlight canvasHighlight); @Override @SuppressWarnings("unchecked") boolean allowSource(final Node source,
                               final Edge<ViewConnector<?>, Node> connector,
                               final Connection connection); @Override @SuppressWarnings("unchecked") boolean allowTarget(final Node target,
                               final Edge<ViewConnector<?>, Node> connector,
                               final Connection connection); @Override @SuppressWarnings("unchecked") boolean acceptSource(final Node source,
                                final Edge<ViewConnector<?>, Node> connector,
                                final Connection connection); @Override @SuppressWarnings("unchecked") boolean acceptTarget(final Node target,
                                final Edge<ViewConnector<?>, Node> connector,
                                final Connection connection); static Connection createConnection(final WiresConnection wiresConnection,
                                              final WiresMagnet wiresMagnet); @SuppressWarnings("unchecked") static MagnetConnection createConnection(final Element element); }
ConnectionAcceptorControlImpl extends AbstractAcceptorControl implements ConnectionAcceptorControl<AbstractCanvasHandler> { @Override @SuppressWarnings("unchecked") public boolean acceptTarget(final Node target, final Edge<ViewConnector<?>, Node> connector, final Connection connection) { ensureUnHighLight(); if (isTargetChanged(target, connector)) { final CommandResult<CanvasViolation> violations = getCommandManager().execute(getCanvasHandler(), canvasCommandFactory.setTargetNode(target, connector, connection)); return isAccept(violations); } return true; } @Inject  ConnectionAcceptorControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                         final CanvasHighlight canvasHighlight); @Override @SuppressWarnings("unchecked") boolean allowSource(final Node source,
                               final Edge<ViewConnector<?>, Node> connector,
                               final Connection connection); @Override @SuppressWarnings("unchecked") boolean allowTarget(final Node target,
                               final Edge<ViewConnector<?>, Node> connector,
                               final Connection connection); @Override @SuppressWarnings("unchecked") boolean acceptSource(final Node source,
                                final Edge<ViewConnector<?>, Node> connector,
                                final Connection connection); @Override @SuppressWarnings("unchecked") boolean acceptTarget(final Node target,
                                final Edge<ViewConnector<?>, Node> connector,
                                final Connection connection); static Connection createConnection(final WiresConnection wiresConnection,
                                              final WiresMagnet wiresMagnet); @SuppressWarnings("unchecked") static MagnetConnection createConnection(final Element element);  }