Skip to content

Commit

Permalink
[cleanup] Remove dead or redundant code for LayoutData
Browse files Browse the repository at this point in the history
Code has leftovers after some refactoring.
  • Loading branch information
peransin-obeo authored and lredor committed Sep 12, 2024
1 parent da49f3c commit 82be79e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 151 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2021 THALES GLOBAL SERVICES and others.
* Copyright (c) 2009, 2024 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -215,7 +215,7 @@ public List<LayoutData> getChildren() {
}

/**
* Search recursively in in all the LayoutData is there is one which have
* Search recursively in in all the LayoutData if there is one which have
* the element for target.
*
* @param node
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2021 THALES GLOBAL SERVICES and others.
* Copyright (c) 2009, 2024 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -57,16 +57,7 @@ public class RootLayoutData extends LayoutData {
* the future size
*/
public RootLayoutData(final EditPart editPart, final Point location, final Dimension size) {
final Object adaptObject = EditPartTools.getParentOfType(editPart, IGraphicalEditPart.class).resolveSemanticElement();
if (adaptObject instanceof AbstractDNode) {
init((AbstractDNode) adaptObject, location, size);
} else if (adaptObject instanceof DDiagram) {
init((DDiagram) adaptObject, location, size);
} else if (adaptObject instanceof DEdge) {
init((DEdge) adaptObject, location, size);
} else {
AbstractSiriusFormatDataManager.logUnhandledDiagramElementKindMessage(adaptObject);
}
this(EditPartTools.getParentOfType(editPart, IGraphicalEditPart.class).resolveSemanticElement(), location, size);
}

/**
Expand Down Expand Up @@ -107,12 +98,10 @@ public RootLayoutData(final AbstractDNode target, final ShapeEditPart editPart,
*/
public RootLayoutData(final Object adaptObject, final Point location, final Dimension size) {
super();
if (adaptObject instanceof AbstractDNode) {
init((AbstractDNode) adaptObject, location, size);
} else if (adaptObject instanceof DDiagram) {
init((DDiagram) adaptObject, location, size);
} else if (adaptObject instanceof DEdge) {
init((DEdge) adaptObject, location, size);
if (adaptObject instanceof DDiagram // for root
|| adaptObject instanceof AbstractDNode // container or simple node
|| adaptObject instanceof DEdge) {
init((EObject) adaptObject, location, size);
} else {
AbstractSiriusFormatDataManager.logUnhandledDiagramElementKindMessage(adaptObject);
}
Expand Down Expand Up @@ -170,8 +159,10 @@ public RootLayoutData getRoot() {
}

/**
* Search recursively in in all the DiagramLayoutData is there is one which
* have the diagram for target.
* Search if there is data which have the diagram for target.
* <p>
* Default implementation does not perform a recursive search.
* </p>
*
* @param diagram
* The search diagram
Expand Down

0 comments on commit 82be79e

Please sign in to comment.