From 5dcf9d7dc93178749d4e9e4c3a3d046c8d3368c6 Mon Sep 17 00:00:00 2001 From: Stephane Drapeau Date: Mon, 15 Jul 2024 16:06:01 +0200 Subject: [PATCH] Remove unused method Change-Id: I7f9f55766021d1e43bdb333e861364251adaf56d --- .../bpmn2/design/ElementsPositionService.java | 45 +------------------ 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/plugins/org.obeonetwork.dsl.bpmn2.design/src/org/obeonetwork/bpmn2/design/ElementsPositionService.java b/plugins/org.obeonetwork.dsl.bpmn2.design/src/org/obeonetwork/bpmn2/design/ElementsPositionService.java index d1a04b96..9bba53e9 100644 --- a/plugins/org.obeonetwork.dsl.bpmn2.design/src/org/obeonetwork/bpmn2/design/ElementsPositionService.java +++ b/plugins/org.obeonetwork.dsl.bpmn2.design/src/org/obeonetwork/bpmn2/design/ElementsPositionService.java @@ -11,23 +11,16 @@ */ package org.obeonetwork.bpmn2.design; -import java.util.Set; - import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.gmf.runtime.notation.Bounds; import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DDiagramElementContainer; -import org.eclipse.sirius.diagram.DNode; -import org.eclipse.sirius.diagram.business.api.refresh.CanonicalSynchronizer; -import org.eclipse.sirius.diagram.business.api.refresh.CanonicalSynchronizerFactory; import org.eclipse.sirius.diagram.ui.business.api.view.SiriusGMFHelper; -import org.eclipse.sirius.diagram.ui.business.api.view.SiriusLayoutDataManager; import org.obeonetwork.dsl.bpmn2.Lane; import org.obeonetwork.dsl.bpmn2.LaneSet; @@ -53,40 +46,6 @@ public void down(Lane lane) { } } - /** - * This method fix the position of a new element created from contextual menu. - * - * @param currentNode the node where the contextual menu displayed - * @param newNode the new element to create - * - * @author atakarabt - */ - public void positionRelativeToCurrent(EObject currentNode, EObject newNode) { - if (currentNode instanceof DNode && newNode instanceof DNode) { - DNode currentDNode = (DNode) currentNode; - DNode newDNode = (DNode) newNode; - // Retrieve GMF nodes associated with our graphical nodes - Node firstNode = SiriusGMFHelper.getGmfNode(currentDNode); - Bounds firstBounds = (Bounds) firstNode.getLayoutConstraint(); - // Launch refresh so that GMF view corresponding to the newDNode are created - CanonicalSynchronizer canonicalSynchronizer = CanonicalSynchronizerFactory.INSTANCE - .createCanonicalSynchronizer(firstNode.getDiagram()); - canonicalSynchronizer.synchronize(); - Node secondNode = SiriusGMFHelper.getGmfNode(newDNode); - Bounds secondBounds = (Bounds) secondNode.getLayoutConstraint(); - // Make sure that the created view will never be arranged - Set createdViewsToArrange = SiriusLayoutDataManager.INSTANCE.getCreatedViewWithCenterLayout() - .get(secondNode.getDiagram()); - if (createdViewsToArrange != null) { - createdViewsToArrange.remove(secondNode); - } - // Set bounds for this new node - secondBounds.setX(firstBounds.getX() + 150); - secondBounds.setY(firstBounds.getY()); - - } - } - public DDiagramElementContainer lanesAutoSize(final DDiagramElementContainer laneSetContainer) { Node laneSetNode = SiriusGMFHelper.getGmfNode(laneSetContainer); Bounds laneSetBounds = (Bounds) laneSetNode.getLayoutConstraint(); @@ -116,11 +75,11 @@ public EObject moveElement(EObject referenceOwner, String referenceName, final E int relativeIndex = list.indexOf(relativeElement); - list.move(relativeIndex+1, element); + list.move(relativeIndex + 1, element); return referenceOwner; } - + public EObject moveElementFirstPosition(EObject referenceOwner, String referenceName, final EObject element) { EStructuralFeature feature = referenceOwner.eClass().getEStructuralFeature(referenceName); @SuppressWarnings("unchecked")