diff options
| author | Laurent Redor | 2014-07-02 09:03:27 +0000 |
|---|---|---|
| committer | Laurent Redor | 2014-07-04 10:11:21 +0000 |
| commit | ccfa161676d84e3cab88cc45893b0ae0f8bbb4d5 (patch) | |
| tree | 28cd9fa377992561c297feefe80fec0f4ed795bc | |
| parent | 840ebe0d0e69111d507b174088f0cf0d35145c5b (diff) | |
| download | org.eclipse.sirius-ccfa161676d84e3cab88cc45893b0ae0f8bbb4d5.tar.gz org.eclipse.sirius-ccfa161676d84e3cab88cc45893b0ae0f8bbb4d5.tar.xz org.eclipse.sirius-ccfa161676d84e3cab88cc45893b0ae0f8bbb4d5.zip | |
[438691] Move concerned classes in ext.gmf plugin
This classes does not depend on other things than GMF itself, so it has
been moved in ext.gmf plugin.
The ViewportUtilities has also been removed as Sirius is not supposed
to be compatible with Eclipse Helios. This class has been duplicated
because it was not available for 3.5.
Bug: 438691
Change-Id: I5262d76a734906c8e002b216b6c9a474f28b8b0d
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF | 13 | ||||
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java | 2 | ||||
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/ViewportUtilities.java | 200 | ||||
| -rw-r--r-- | plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF | 8 | ||||
| -rw-r--r-- | plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandDragTracker.java (renamed from plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandDragTracker.java) | 2 | ||||
| -rw-r--r-- | plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java (renamed from plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandSelectionTool.java) | 3 |
6 files changed, 18 insertions, 210 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF index 54646be345..7431d8164b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF @@ -29,12 +29,13 @@ Require-Bundle: com.google.guava;bundle-version="[11.0.2,16.0)", org.eclipse.sirius.common;bundle-version="2.0.0", org.eclipse.sirius.common.ui;bundle-version="2.0.0", org.eclipse.core.runtime;bundle-version="3.8.0", - org.eclipse.sirius.diagram;visibility:=reexport;bundle-version="2.0.0", - org.eclipse.emf.edit;visibility:=reexport;bundle-version="2.8.0", - org.eclipse.emf.ecore;visibility:=reexport;bundle-version="2.8.0", - org.eclipse.emf.ecore.edit;visibility:=reexport;bundle-version="2.8.0", - org.eclipse.sirius;visibility:=reexport;bundle-version="2.0.0", - org.eclipse.sirius.ui;visibility:=reexport;bundle-version="2.0.0", + org.eclipse.sirius.diagram;bundle-version="2.0.0";visibility:=reexport, + org.eclipse.emf.edit;bundle-version="2.8.0";visibility:=reexport, + org.eclipse.emf.ecore;bundle-version="2.8.0";visibility:=reexport, + org.eclipse.emf.ecore.edit;bundle-version="2.8.0";visibility:=reexport, + org.eclipse.sirius;bundle-version="2.0.0";visibility:=reexport, + org.eclipse.sirius.ext.gmf.runtime;bundle-version="2.0.0";visibility:=reexport, + org.eclipse.sirius.ui;bundle-version="2.0.0";visibility:=reexport, org.eclipse.sirius.diagram.layoutdata;bundle-version="2.0.0", org.eclipse.sirius.ecore.extender;bundle-version="2.0.0", org.eclipse.ui.navigator;bundle-version="3.5.200", diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java index 4ef4eb83c3..9b396b442e 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java @@ -71,11 +71,11 @@ import org.eclipse.sirius.diagram.ui.tools.internal.commands.InitializeHiddenEle import org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl; import org.eclipse.sirius.diagram.ui.tools.internal.layout.ordering.ViewOrderingProviderRegistry; import org.eclipse.sirius.diagram.ui.tools.internal.providers.decorators.SubDiagramDecoratorProvider; -import org.eclipse.sirius.diagram.ui.tools.internal.ui.RubberbandDragTracker; import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuthority; import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; +import org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools.RubberbandDragTracker; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/ViewportUtilities.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/ViewportUtilities.java deleted file mode 100644 index efad18bbf1..0000000000 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/ViewportUtilities.java +++ /dev/null @@ -1,200 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Research Group Software Construction, - * RWTH Aachen University, Germany - initial API and implementation - */ -package org.eclipse.sirius.diagram.ui.tools.internal.ui; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.draw2d.FigureUtilities; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Viewport; - -//CHECKSTYLE:OFF Class cloned because it is not available for 3.5. -/** - * Utility class to support working with {@link Viewport}s. - * - * @author Philip Ritzkopf - * @author Alexander Nyssen - * - * @since 0.9.0 - */ -public final class ViewportUtilities { - - private ViewportUtilities() { - // provides only static utility functions and should not be accessed in - // any other way than static. - } - - /** - * Returns all enclosing {@link Viewport}s for a given {@link IFigure}, - * beginning with its direct enclosing {@link Viewport} up the root - * {@link Viewport} in the figure's parent hierarchy. - * - * @param figure - * @return A list of {@link Viewport}s representing the figure's enclosing - * {@link Viewport} path, where the nearest enclosing - * {@link Viewport} as the first element and the root - * {@link Viewport} as the last element. In case there is no - * enclosing {@link Viewport}, an empty list is returned. - */ - public static List getEnclosingViewportsPath(IFigure figure) { - Viewport nearestEnclosingViewport = getNearestEnclosingViewport(figure); - if (nearestEnclosingViewport == null) { - return new ArrayList(); - } - Viewport rootViewport = getRootViewport(figure); - return getViewportsPath(nearestEnclosingViewport, rootViewport, true); - } - - /** - * Returns a list containing the provided leaf {@link Viewport} as the first - * element, and all its enclosing {@link Viewport}s up to the root - * {@link Viewport}, where the root {@link Viewport} forms the last element - * of the list. - * - * @param leafViewport - * The {@link Viewport}, whose parent hierarchy is processed. - * @param rootViewport - * an ancestor of the given leafViewport, which marks the end - * point of the hierarchy to be processed. - * @return A list of {@link Viewport}s containing the leaf {@link Viewport} - * as the first element, the root {@link Viewport} as the last and - * in between all enclosing {@link Viewport}s of the leaf - * {@link Viewport} up to the root. Returns an empty list in case - * leaf or root {@link Viewport} are null or in case the root - * viewport is not an ancestor of the leaf {@link Viewport}. - */ - public static List getViewportsPath(final Viewport leafViewport, final Viewport rootViewport) { - return getViewportsPath(leafViewport, rootViewport, true); - } - - /** - * Returns a list containing the provided leaf {@link Viewport} as the first - * element, and all its enclosing {@link Viewport}s up to the root - * {@link Viewport}. The root {@link Viewport} forms the last element of the - * list, in case includeRootViewport is set to true, otherwise the viewport - * directly nested below the root viewport will be the last in the list. - * - * @param leafViewport - * The {@link Viewport}, whose parent hierarchy is processed. - * @param rootViewport - * an ancestor of the given leafViewport, which marks the end - * point of the hierarchy to be processed. - * @param includeRootViewport - * whether the provided rootViewport should be included in the - * list of returned viewports (as the last one) or not. - * @return A list of {@link Viewport}s containing the leaf {@link Viewport} - * as the first element, the root {@link Viewport} as the last and - * in between all enclosing {@link Viewport}s of the leaf - * {@link Viewport} up to the root. Returns an empty list in case - * leaf or root {@link Viewport} are null or in case the root - * viewport is not an ancestor of the leaf {@link Viewport}. - */ - public static List getViewportsPath(final Viewport leafViewport, final Viewport rootViewport, boolean includeRootViewport) { - if (leafViewport == null || rootViewport == null) { - return Collections.EMPTY_LIST; - } - - // search all enclosing viewports of leaf viewport up to root viewport - // (or until no enclosing viewport can be found) - List nestedViewports = new ArrayList(); - Viewport currentViewport = leafViewport; - do { - nestedViewports.add(currentViewport); - currentViewport = ViewportUtilities.getNearestEnclosingViewport(currentViewport); - } while (currentViewport != null && currentViewport != rootViewport); - - // check if root viewport is an ancestor of the given leaf viewport - if (currentViewport != null) { - if (includeRootViewport) { - nestedViewports.add(currentViewport); - } - return nestedViewports; - } - return Collections.EMPTY_LIST; - } - - /** - * Returns the nearest common enclosing {@link Viewport} for two given - * {@link org.eclipse.draw2d.Figure}s. - * - * @param firstFigure - * @param secondFigure - * @return The nearest common {@link Viewport} of the two given figures, or - * null if no common enclosing {@link Viewport} could be found. - */ - public static Viewport getNearestCommonViewport(IFigure firstFigure, IFigure secondFigure) { - return getNearestViewport(FigureUtilities.findCommonAncestor(firstFigure, secondFigure)); - } - - /** - * Returns the upper most enclosing {@link Viewport} for the given - * {@link IFigure}. - * - * @param figure - * @return The upper most enclosing {@link Viewport} or null if there is no - * enclosing {@link Viewport} for the given {@link IFigure}, - */ - public static Viewport getRootViewport(final IFigure figure) { - Viewport currentViewport = getNearestViewport(figure); - while (getNearestEnclosingViewport(currentViewport) != null) { - currentViewport = getNearestEnclosingViewport(currentViewport); - } - return currentViewport; - } - - /** - * Returns the given figure in case it is a {@link Viewport} itself, - * otherwise its nearest enclosing {@link Viewport}. - * - * @param figure - * @return The given figure in case it is a {@link Viewport} itself, - * otherwise the nearest enclosing {@link Viewport} or null if there - * is no nearest enclosing {@link Viewport}. - */ - public static Viewport getNearestViewport(final IFigure figure) { - if (figure == null) { - return null; - } - if (figure instanceof Viewport) { - return (Viewport) figure; - } else { - return getNearestEnclosingViewport(figure); - } - } - - /** - * Returns the nearest enclosing {@link Viewport} of a given {@link IFigure} - * by walking up the figure's hierarchy. - * - * @param figure - * @return The nearest enclosing {@link Viewport} of the given figure, or - * null if none could be found. - */ - public static Viewport getNearestEnclosingViewport(final IFigure figure) { - if (figure == null) { - return null; - } - Viewport viewport = null; - IFigure currentFigure = figure; - while (currentFigure.getParent() != null) { - if (currentFigure.getParent() instanceof Viewport) { - viewport = (Viewport) currentFigure.getParent(); - break; - } - currentFigure = currentFigure.getParent(); - } - return viewport; - } -} -// CHECKSTYLE:ON diff --git a/plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF index f6c668d692..38e9b52005 100644 --- a/plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF @@ -7,11 +7,17 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-Vendor: %providerName Bundle-Localization: plugin Import-Package: com.google.common.base;version="10.0.1", + org.eclipse.core.runtime, org.eclipse.draw2d, org.eclipse.draw2d.geometry, org.eclipse.gef, org.eclipse.gef.editparts, + org.eclipse.gef.tools, org.eclipse.gmf.runtime.diagram.ui.editparts, + org.eclipse.gmf.runtime.diagram.ui.util, + org.eclipse.jface.viewers, org.eclipse.sirius.ext.draw2d.figure;version="2.0.0", + org.eclipse.swt.events, org.eclipse.swt.widgets -Export-Package: org.eclipse.sirius.ext.gmf.runtime.editparts;version="2.0.0" +Export-Package: org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools;version="2.0.0", + org.eclipse.sirius.ext.gmf.runtime.editparts;version="2.0.0" diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandDragTracker.java b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandDragTracker.java index 17c4dcd1ea..c162628c72 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandDragTracker.java +++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandDragTracker.java @@ -9,7 +9,7 @@ * IBM Corporation - initial API and implementation ****************************************************************************/ // CHECKSTYLE:OFF -package org.eclipse.sirius.diagram.ui.tools.internal.ui; +package org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools; import org.eclipse.gef.DragTracker; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandSelectionTool.java b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java index 8324e2c313..8ae3d1b471 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandSelectionTool.java +++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java @@ -11,7 +11,7 @@ * Obeo - Add "Touched" mode ****************************************************************************/ // CHECKSTYLE:OFF -package org.eclipse.sirius.diagram.ui.tools.internal.ui; +package org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -27,6 +27,7 @@ import org.eclipse.draw2d.FigureCanvas; import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.Viewport; +import org.eclipse.draw2d.ViewportUtilities; import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gef.EditPart; |
