Skip to content

Commit

Permalink
Remove unused method
Browse files Browse the repository at this point in the history
Change-Id: I7f9f55766021d1e43bdb333e861364251adaf56d
  • Loading branch information
Stephane Drapeau authored and Stephane Drapeau committed Jul 15, 2024
1 parent 0645702 commit 5dcf9d7
Showing 1 changed file with 2 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<View> 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();
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 5dcf9d7

Please sign in to comment.