@Override public void onNodeDragEnd(final NodeDragEndEvent event) { updateSelectionShapeForExternallyConnectedConnectors(m_adjustX, m_adjustY, m_selectionManager.m_startBoundingBox); if (m_selectionManager.m_startBoundingBox != null) { m_selectionManager.m_startBoundingBox.offset(m_adjustX, m_adjustY); } m_selectionManager.m_ignoreMouseClick = true; // need to ignore the click event after multipleShapeHandler.onNodeDragEnd(event); m_selectionManager.rebuildSelectionArea(); m_running = false; }
@Override public void onNodeDragEnd(final NodeDragEndEvent event) { updateSelectionShapeForExternallyConnectedConnectors(m_adjustX, m_adjustY, m_selectionManager.m_startBoundingBox); if (m_selectionManager.m_startBoundingBox != null) { m_selectionManager.m_startBoundingBox.offset(m_adjustX, m_adjustY); } m_selectionManager.m_ignoreMouseClick = true; // need to ignore the click event after multipleShapeHandler.onNodeDragEnd(event); m_selectionManager.rebuildSelectionArea(); m_running = false; }
@Override public void onNodeDragEnd(final NodeDragEndEvent event) { updateSelectionShapeForExternallyConnectedConnectors(m_adjustX, m_adjustY, m_selectionManager.m_startBoundingBox); if (m_selectionManager.m_startBoundingBox != null) { m_selectionManager.m_startBoundingBox.offset(m_adjustX, m_adjustY); } m_selectionManager.m_ignoreMouseClick = true; // need to ignore the click event after multipleShapeHandler.onNodeDragEnd(event); m_selectionManager.rebuildSelectionArea(); m_running = false; }
private double[] calculateSelectionShapeForExternallyConnectedConnectors(final int dx, final int dy, final BoundingBox originalBox) { final BoundingBox box = new BoundingBox(); if (null != originalBox) { box.add(originalBox); } box.offset(dx, dy); if (m_selected.m_externallyConnected.isEmpty()) { return new double[] { box.getMinX() - SELECTION_PADDING, box.getMinY() - SELECTION_PADDING }; } double width = null != originalBox ? originalBox.getWidth() : 0d; double height = null != originalBox ? originalBox.getHeight() : 0d; if (!m_selected.m_externallyConnected.isEmpty()) { for (final WiresConnector connector : m_selected.m_externallyConnected) { box.add(connector.getHead().getComputedBoundingPoints().getBoundingBox()); box.add(connector.getTail().getComputedBoundingPoints().getBoundingBox()); box.add(connector.getLine().getComputedBoundingPoints().getBoundingBox()); } width = box.getMaxX() - box.getMinX(); height = box.getMaxY() - box.getMinY(); } return new double[] { box.getMinX(), box.getMinY(), width, height }; }
private double[] calculateSelectionShapeForExternallyConnectedConnectors(final int dx, final int dy, final BoundingBox originalBox) { final BoundingBox box = new BoundingBox(); if (null != originalBox) { box.add(originalBox); } box.offset(dx, dy); if (m_selected.m_externallyConnected.isEmpty()) { return new double[] { box.getMinX() - SELECTION_PADDING, box.getMinY() - SELECTION_PADDING }; } double width = null != originalBox ? originalBox.getWidth() : 0d; double height = null != originalBox ? originalBox.getHeight() : 0d; if (!m_selected.m_externallyConnected.isEmpty()) { for (final WiresConnector connector : m_selected.m_externallyConnected) { box.add(connector.getHead().getComputedBoundingPoints().getBoundingBox()); box.add(connector.getTail().getComputedBoundingPoints().getBoundingBox()); box.add(connector.getLine().getComputedBoundingPoints().getBoundingBox()); } width = box.getMaxX() - box.getMinX(); height = box.getMaxY() - box.getMinY(); } return new double[] { box.getMinX(), box.getMinY(), width, height }; }
private double[] calculateSelectionShapeForExternallyConnectedConnectors(final int dx, final int dy, final BoundingBox originalBox) { final BoundingBox box = new BoundingBox(); if (null != originalBox) { box.add(originalBox); } box.offset(dx, dy); if (m_selected.m_externallyConnected.isEmpty()) { return new double[] { box.getMinX() - SELECTION_PADDING, box.getMinY() - SELECTION_PADDING }; } double width = null != originalBox ? originalBox.getWidth() : 0d; double height = null != originalBox ? originalBox.getHeight() : 0d; if (!m_selected.m_externallyConnected.isEmpty()) { for (final WiresConnector connector : m_selected.m_externallyConnected) { box.add(connector.getHead().getComputedBoundingPoints().getBoundingBox()); box.add(connector.getTail().getComputedBoundingPoints().getBoundingBox()); box.add(connector.getLine().getComputedBoundingPoints().getBoundingBox()); } width = box.getMaxX() - box.getMinX(); height = box.getMaxY() - box.getMinY(); } return new double[] { box.getMinX(), box.getMinY(), width, height }; }