Skip to content
Snippets Groups Projects
Commit 080215c6 authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Merge remote-tracking branch 'origin/master' into 4204

parents 1114b9c3 81822b8d
No related branches found
No related tags found
1 merge request!173Reuse Plugin: Moved developer info from user docu into developer docu
Pipeline #35556 passed
Pipeline: maven-releng

#35557

    Showing
    with 50 additions and 319 deletions
    ......@@ -2,16 +2,12 @@ Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: Tooling Base UI
    Bundle-SymbolicName: org.fortiss.tooling.base.ui;singleton:=true
    Bundle-Version: 2.20.0.qualifier
    Bundle-Version: 2.21.0.qualifier
    Bundle-Activator: org.fortiss.tooling.base.ui.ToolingBaseUIActivator
    Require-Bundle: org.fortiss.tooling.base;bundle-version="2.20.0";visibility:=reexport,
    org.fortiss.tooling.kernel.ui;bundle-version="2.20.0";visibility:=reexport,
    Require-Bundle: org.fortiss.tooling.base;bundle-version="2.21.0";visibility:=reexport,
    org.fortiss.tooling.kernel.ui;bundle-version="2.21.0";visibility:=reexport,
    org.eclipse.swt,
    org.fortiss.tooling.common.ui,
    org.eclipse.elk.core;bundle-version="0.7.1",
    org.eclipse.elk.alg.layered;bundle-version="0.7.1",
    org.eclipse.elk.graph;bundle-version="0.7.1",
    org.eclipse.elk.alg.common;bundle-version="0.7.1"
    org.fortiss.tooling.common.ui
    Bundle-ActivationPolicy: lazy
    Bundle-RequiredExecutionEnvironment: JavaSE-11
    Bundle-Vendor: fortiss GmbH
    ......
    CurvedLinkLayoutedContentAnchorangeController.java e22faedbe98c3dab660b5d2df8ebd004e116c5ba GREEN
    CurvedLinkLayoutedDiagramAnchorangeController.java f2e5e2a7cc9b6a070871e200e57371286bb15222 GREEN
    CurvedLinkLayoutedContentAnchorangeController.java 249629c966a1f92fc28294ef62117439799d7315 GREEN
    CurvedLinkLayoutedDiagramAnchorangeController.java de1ab32e11205435cf7a89d2dcc352683ef8b39e GREEN
    EObjectDiagramController.java 45f5b1439f33685523b035d2603e8329b647b62a GREEN
    EObjectEllipticResizableContentControllerBase.java f12e8f5a646a23fe428ed4768bf041c8b885ec81 GREEN
    EObjectModelChangeProvider.java f4b60cebb088a5c81ca92a41614e1a5d40030502 GREEN
    ......@@ -8,9 +8,9 @@ KernelServiceBasedModelChangeProviderBase.java 8d1f8ef79ecd383ff74e5a2bbcf24345a
    LayoutedContentAnchorageController.java 83f066a151dd2984c4bef64daf8165a0cd53b00f GREEN
    LayoutedCurveLinkBendPointController.java d963a5e227de7bd8ba910c733df2ac7acf4fa1fa GREEN
    LayoutedDiagramAnchorageController.java 89ee56e8e71a5fa635cfac81e84bbfe1d50e5776 GREEN
    LayoutedEllipticResizableContentController.java 1c50e80121512de7ae1f2ba09e0e1f4d0e3f3104 GREEN
    LayoutedLineLinkBendPointController.java f49c994a0c90612c44ec83d42cf858e476662e1f GREEN
    LayoutedLinkBendPointController.java d06736b49b6ac9a073237b989895469891500e7f GREEN
    LayoutedEllipticResizableContentController.java 00037188773eb65866863ab89331bc981873957e GREEN
    LayoutedLineLinkBendPointController.java 8022cc66c4d33d7bf357ceb4c9ca1694f4f2fda8 GREEN
    LayoutedLinkBendPointController.java d3f22ffb43426da62e849074a9d5a64e4d70a7ad GREEN
    LayoutedRectangularResizableContentController.java 341f4a7da0d69360d7026af6d9b3d44dfd7d9bb1 GREEN
    ModelElementFXEditorUIProviderBase.java 6bdd31d033228315e99c973b4986cdabc135ec9f GREEN
    NamedCommentedLayoutModelChangeProvider.java 223e82c1b1cba842f6fae115182f5d0c6acb44b0 GREEN
    ......@@ -15,7 +15,7 @@
    +--------------------------------------------------------------------------*/
    package org.fortiss.tooling.base.ui.editor.fx.controller;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.addConnectionPoint;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.addConnectionPoint;
    import org.eclipse.emf.common.util.BasicEList;
    import org.eclipse.emf.common.util.EList;
    ......
    ......@@ -15,7 +15,7 @@
    +--------------------------------------------------------------------------*/
    package org.fortiss.tooling.base.ui.editor.fx.controller;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.addConnectionPoint;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.addConnectionPoint;
    import org.eclipse.emf.common.util.BasicEList;
    import org.eclipse.emf.common.util.EList;
    ......
    ......@@ -17,9 +17,9 @@ package org.fortiss.tooling.base.ui.editor.fx.controller;
    import static java.lang.Math.toRadians;
    import static java.util.Objects.requireNonNull;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.setConnectorAngle;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodeSize;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.moveNode;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.setConnectorAngle;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.setNodeSize;
    import org.fortiss.tooling.base.model.element.IConnector;
    ......
    ......@@ -13,7 +13,7 @@
    *******************************************************************************/
    package org.fortiss.tooling.base.ui.editor.fx.controller;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.addConnectionPoint;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.addConnectionPoint;
    import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
    import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
    ......
    ......@@ -16,8 +16,8 @@
    package org.fortiss.tooling.base.ui.editor.fx.controller;
    import static java.util.Objects.requireNonNull;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectionPoints;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.removeConnectionPoint;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectionPoints;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.removeConnectionPoint;
    import java.util.List;
    ......
    AnchorageText.java d857c045a26a4b73f87adfd2773425460774ab2f GREEN
    CoordinateCorrections.java 018bf229e5686afcb8540b61dd9d05b6e4a23e93 GREEN
    LayoutedCircularAnchorageContentVisualBase.java bf71e5e84ede0c26bd0632e4218aae55ab915ade GREEN
    LayoutedCircularAnchorageContentVisualBase.java d8e269da3b915608621611c811d286e705d85208 GREEN
    LayoutedCircularAnchorageDiagramVisualBase.java 7634416bcb88a014d985143bf00a8d29ff1e3ff5 GREEN
    LayoutedCurveLinkVisual.java 5b06cd7e80eaf7cf6af37a4769eaafe2a1e591f3 GREEN
    LayoutedCurveLinkVisual.java b985f449739a3804c94ded7843465b8fe69ff7f8 GREEN
    LayoutedEllipticContentVisualBase.java 6f3daf386d5120793b90ce4569dd9bea33dd2a0f GREEN
    LayoutedLineLinkVisual.java 5fc26086e2f63afee403379ba8f09f5113d4c025 GREEN
    LayoutedRectangularAnchorageContentVisualBase.java 9d5ab8fbad2900a26ec5ea620f9f1a2a1656da77 GREEN
    LayoutedLineLinkVisual.java c4fdd659e5ffdd32c2b6857a20051a6c22efc1b0 GREEN
    LayoutedRectangularAnchorageContentVisualBase.java 61aebb34899bcd31f1aa1b0e018a3606c5714c99 GREEN
    LayoutedRectangularAnchorageDiagramVisualBase.java b9aa51cce71d8f6c4e400f6019b3cab0a1ed6df6 GREEN
    LayoutedRectangularContentVisualBase.java 61698ffd771ee2ad798025df8195d1bc09c2c765 GREEN
    NamedLayoutedCircularAnchorageContentVisual.java 853ddce0e1519cbc6284776dffcdeaf64ae358b1 GREEN
    ......
    ......@@ -21,8 +21,8 @@ import static javafx.scene.paint.Color.rgb;
    import static org.fortiss.tooling.base.ui.editor.fx.visual.CoordinateCorrections.ANCHOR_DIMENSION;
    import static org.fortiss.tooling.base.ui.editor.fx.visual.CoordinateCorrections.ANCHOR_INSET;
    import static org.fortiss.tooling.base.ui.utils.LWFXEditorUtils.convertEOrientationToSide;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectorAngleAsDouble;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectorOffsetOrientation;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectorAngleAsDouble;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectorOffsetOrientation;
    import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_ALLOWED_TAG;
    import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
    ......
    ......@@ -15,7 +15,7 @@ package org.fortiss.tooling.base.ui.editor.fx.visual;
    import static java.util.Collections.emptyList;
    import static org.fortiss.tooling.base.ui.utils.LWFXEditorUtils.computeLinkToCircleLocation;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectionPoints;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectionPoints;
    import java.util.List;
    ......
    ......@@ -17,16 +17,16 @@ package org.fortiss.tooling.base.ui.editor.fx.visual;
    import static java.util.Collections.emptyList;
    import static org.fortiss.tooling.base.ui.utils.LWFXEditorUtils.computeLinkToCircleLocation;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectionPoints;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectionPoints;
    import java.util.List;
    import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
    import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
    import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.rectangular.LineLinkVisualBase;
    import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
    import org.fortiss.tooling.base.model.layout.Point;
    import org.fortiss.tooling.base.model.layout.Points;
    import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
    import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
    import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.rectangular.LineLinkVisualBase;
    import javafx.geometry.Rectangle2D;
    ......
    ......@@ -21,8 +21,8 @@ import static javafx.scene.paint.Color.rgb;
    import static org.fortiss.tooling.base.ui.editor.fx.visual.CoordinateCorrections.ANCHOR_DIMENSION;
    import static org.fortiss.tooling.base.ui.editor.fx.visual.CoordinateCorrections.ANCHOR_INSET;
    import static org.fortiss.tooling.base.ui.utils.LWFXEditorUtils.convertEOrientationToSide;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectorAngleAsDouble;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectorOffsetOrientation;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectorAngleAsDouble;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectorOffsetOrientation;
    import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_ALLOWED_TAG;
    import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
    ......
    AutoLayoutMenu.java 67dc2d04a6f39ec72ea640b745997baa8ff63a49 GREEN
    DiagramTapeMeasure.java 60b625c0915cfd95ad61c5f2053db67271a011b8 GREEN
    IAutoLayouter.java de1b11d9e202c7e23352ad85684dbf8a3fd17c7d GREEN
    IAutoLayouterTapeMeasure.java 9781aedaab3a85370542aacee9c49475ad7586c5 GREEN
    KielerAutoLayouter.java be19c05c98ff036a6d9552523b7f490a3029bbfc GREEN
    AutoLayoutMenu.java a38bfe1b59d7bf456b775bd29414f2177c85e75e GREEN
    ......@@ -19,6 +19,7 @@ import static java.util.Collections.emptyList;
    import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_ANGLE;
    import static org.fortiss.tooling.base.utils.AngleUtils.getAngle;
    import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
    import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.runAsCommand;
    import java.util.ArrayList;
    import java.util.List;
    ......@@ -28,6 +29,8 @@ import org.eclipse.jface.action.Action;
    import org.eclipse.jface.action.ActionContributionItem;
    import org.eclipse.jface.action.IContributionItem;
    import org.eclipse.jface.resource.ImageDescriptor;
    import org.fortiss.tooling.base.layout.IAutoLayouter;
    import org.fortiss.tooling.base.layout.KielerAutoLayouter;
    import org.fortiss.tooling.base.model.element.IConnection;
    import org.fortiss.tooling.base.model.element.IConnector;
    import org.fortiss.tooling.base.model.element.IHierarchicElement;
    ......@@ -71,8 +74,10 @@ public class AutoLayoutMenu implements IContextMenuContributor {
    /** {@inheritDoc} */
    @Override
    public void run() {
    IAutoLayouter layouter = new KielerAutoLayouter();
    layouter.performAutoLayout(element);
    runAsCommand(element, () -> {
    IAutoLayouter layouter = new KielerAutoLayouter();
    layouter.performAutoLayout(element);
    });
    }
    }
    ......
    AbstractNameEditingSupport.java c57336a0e0da18711a1610ca667dfea76728807f GREEN
    ActionUtils.java 322f43d4f92f992daef8ac88eb0f9197c840c89b GREEN
    ContextMenuUtils.java 14e417a623c6c679c368be02701835ae686eda04 GREEN
    EllipseLayoutUIUtils.java 4dd9dbd96a45e8c455c019caa19e4a50f18336af GREEN
    ContextMenuUtils.java 1b4f2a63dfca9ad363942baf320c93145c251836 GREEN
    EllipseLayoutUIUtils.java 0af2cfc038661828b1bb8c51c0a3816d453e8313 GREEN
    FXDNDUtils.java 6ce94e239e68f9e2b3cc0524b072606f4a120076 GREEN
    FontUtils.java a167a05bdaa8da9853705cc5134f30f6d81bc9f2 GREEN
    GCStateManager.java 983973a92376b5c757c1253b32e33d0666ccdf7b GREEN
    LWFXEditorUtils.java 32b62765bec43e610e49d11213d58285ccfe9b06 GREEN
    LayoutDataUIUtils.java 367012e6ac5b94d779eb1dde2688c63c048a0fbb GREEN
    PropertiesViewUtils.java d345b4501c4092228edf1c98e0189317d53aaf22 GREEN
    RectangleLayoutUIUtils.java ef4b872bb5b4a51174e9a29d9ef05e7cb3bff3a1 GREEN
    RectangleLayoutUIUtils.java 688cd42ff2b18182492da2062f5f2e0e6987f2d0 GREEN
    SnapToGridUtils.java efbcbd51764d97cf086b92b37908be46a7d5d09d GREEN
    TableViewerUtils.java ed732ecf12a422ed444872a0347afd552c544a11 GREEN
    TreeViewerUtils.java d8ade5a6b5dc70c09a416eccf1a8d5a7dcfa4749 GREEN
    ......
    ......@@ -22,11 +22,11 @@ import java.util.List;
    import org.eclipse.emf.ecore.EObject;
    import org.fortiss.tooling.base.dnd.ElementDropContext;
    import org.fortiss.tooling.base.layout.IAutoLayouter;
    import org.fortiss.tooling.base.layout.KielerAutoLayouter;
    import org.fortiss.tooling.base.model.element.IConnector;
    import org.fortiss.tooling.base.model.element.IHierarchicElement;
    import org.fortiss.tooling.base.model.layout.Point;
    import org.fortiss.tooling.base.ui.layout.auto.IAutoLayouter;
    import org.fortiss.tooling.base.ui.layout.auto.KielerAutoLayouter;
    import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
    import org.fortiss.tooling.kernel.extension.data.Prototype;
    import org.fortiss.tooling.kernel.service.ICommandStackService;
    ......
    ......@@ -22,7 +22,7 @@ import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_CON
    import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_ASPECT_RATIO;
    import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT;
    import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectorAngleAsDouble;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectorAngleAsDouble;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodePosition;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodeSize;
    ......
    /*-------------------------------------------------------------------------+
    | Copyright 2011 fortiss GmbH |
    | |
    | Licensed under the Apache License, Version 2.0 (the "License"); |
    | you may not use this file except in compliance with the License. |
    | You may obtain a copy of the License at |
    | |
    | http://www.apache.org/licenses/LICENSE-2.0 |
    | |
    | Unless required by applicable law or agreed to in writing, software |
    | distributed under the License is distributed on an "AS IS" BASIS, |
    | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
    | See the License for the specific language governing permissions and |
    | limitations under the License. |
    +--------------------------------------------------------------------------*/
    package org.fortiss.tooling.base.ui.utils;
    import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTION_POINTS;
    import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_ANGLE;
    import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_OFFSET;
    import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION;
    import static org.fortiss.tooling.base.layout.LayoutKeyConstants.CONNECTOR_POSITION;
    import static org.fortiss.tooling.base.model.layout.EOrientation.NORTH;
    import static org.fortiss.tooling.base.utils.AngleUtils.getAngle;
    import static org.fortiss.tooling.base.utils.AngleUtils.setAngle;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodePosition;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodeSize;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.setNodePosition;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.setNodeSize;
    import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createAngle;
    import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createDimension;
    import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createOffsetOrientation;
    import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createPoint;
    import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createPoints;
    import static org.fortiss.tooling.base.utils.OffsetOrientationUtils.getOffsetOrientation;
    import static org.fortiss.tooling.base.utils.OffsetOrientationUtils.setOffsetOrientation;
    import static org.fortiss.tooling.base.utils.PointUtils.getPosition;
    import static org.fortiss.tooling.base.utils.PointUtils.setPoint;
    import static org.fortiss.tooling.base.utils.PointsUtils.getPoints;
    import static org.fortiss.tooling.base.utils.PointsUtils.setPoints;
    import org.eclipse.draw2d.geometry.Rectangle;
    import org.fortiss.tooling.base.layout.LayoutKeyConstants;
    import org.fortiss.tooling.base.model.layout.Angle;
    import org.fortiss.tooling.base.model.layout.Dimension;
    import org.fortiss.tooling.base.model.layout.EOrientation;
    import org.fortiss.tooling.base.model.layout.ILayoutData;
    import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
    import org.fortiss.tooling.base.model.layout.LayoutFactory;
    import org.fortiss.tooling.base.model.layout.Offset;
    import org.fortiss.tooling.base.model.layout.OffsetOrientation;
    import org.fortiss.tooling.base.model.layout.Point;
    import org.fortiss.tooling.base.model.layout.Points;
    import org.fortiss.tooling.base.utils.LayoutDataUtils;
    /**
    * Utility methods for {@link ILayoutedModelElement} and {@link ILayoutData}.
    * This class provides access to layout data using the default keys defined in
    * {@link LayoutKeyConstants}. Changing some layout data is done by replacing
    * the layout data object under a given key, which again results in a EMF
    * notification on the {@link ILayoutedModelElement}. Therefore a single change
    * notification listener on the layouted element can be used.
    *
    * @author hoelzl
    * @author wandinger
    * @author hummel
    */
    public class LayoutDataUIUtils {
    /** Returns the bounds rectangle of the given layouted element. */
    public static Rectangle getNodeBounds(ILayoutedModelElement layouted) {
    org.fortiss.tooling.base.model.layout.Rectangle rectElement =
    LayoutDataUtils.getNodeBounds(layouted);
    return new Rectangle(rectElement.getX(), rectElement.getY(), rectElement.getWidth(),
    rectElement.getHeight());
    }
    /** Moves and resizes the given node. */
    public static void moveAndResizeNode(ILayoutedModelElement layouted, int dx, int dy, int dw,
    int dh, int minWidth, int minHeight) {
    Point pos = getNodePosition(layouted);
    int posX = pos.getX() + dx;
    int posY = pos.getY() + dy;
    Dimension dim = getNodeSize(layouted);
    int dimW = dim.getWidth() + dw;
    int dimH = dim.getHeight() + dh;
    if(dimW < minWidth) {
    if(dx > 0) {
    posX = posX - minWidth - dimW;
    }
    dimW = minWidth;
    }
    if(dimH < minHeight) {
    if(dy > 0) {
    posY = posY - minHeight - dimH;
    }
    dimH = minHeight;
    }
    setNodePosition(layouted, posX, posY);
    setNodeSize(layouted, dimW, dimH);
    }
    /** Returns the layouted connector's position. */
    public static Point getConnectorPosition(ILayoutedModelElement layouted) {
    return getPosition(layouted, CONNECTOR_POSITION);
    }
    /** Sets the layouted connector's position. */
    public static void setConnectorPosition(ILayoutedModelElement layouted, int x, int y) {
    setPoint(layouted, CONNECTOR_POSITION, x, y);
    }
    /** Returns the layouted connector's offset-orientation. */
    public static OffsetOrientation getConnectorOffsetOrientation(ILayoutedModelElement layouted) {
    OffsetOrientation oo = getOffsetOrientation(layouted, CONNECTOR_OFFSET_ORIENTATION);
    if(oo == null) {
    return createOffsetOrientation(0, NORTH, CONNECTOR_OFFSET_ORIENTATION);
    }
    return oo;
    }
    /** Returns the layouted connector's orientation. */
    public static EOrientation getConnectorOrientation(ILayoutedModelElement layouted) {
    return getOffsetOrientation(layouted, CONNECTOR_OFFSET_ORIENTATION).getOrientation();
    }
    /** Sets the layouted connector's offset and orientation. */
    public static void setConnectorOffsetOrientation(ILayoutedModelElement layouted,
    OffsetOrientation orientation) {
    setOffsetOrientation(layouted, CONNECTOR_OFFSET_ORIENTATION, orientation.getOffset(),
    orientation.getOrientation());
    }
    /** Returns the layouted connector's offset. */
    public static Offset getConnectorOffset(ILayoutedModelElement layouted) {
    OffsetOrientation offset = getOffsetOrientation(layouted, CONNECTOR_OFFSET);
    if(offset == null) {
    return createOffsetOrientation(0, NORTH, CONNECTOR_OFFSET);
    }
    return offset;
    }
    /** Sets the layouted connector's angle. */
    public static void setConnectorAngle(ILayoutedModelElement layouted, double angle) {
    setAngle(layouted, CONNECTOR_ANGLE, angle);
    }
    /** Returns the layouted connector's angle. */
    public static Angle getConnectorAngle(ILayoutedModelElement layouted) {
    Angle angle = getAngle(layouted, CONNECTOR_ANGLE);
    if(angle == null) {
    return createAngle(0.0, CONNECTOR_ANGLE);
    }
    return angle;
    }
    /** Returns the angle as double value (0 if not existing). */
    public static double getConnectorAngleAsDouble(ILayoutedModelElement lobject) {
    return getConnectorAngle(lobject).getAngle();
    }
    /**
    * Return the absolute position for a given offset, orientation, size of the
    * parent and insets.
    */
    public static Point getAbsolute(OffsetOrientation oo, Rectangle parentBounds,
    int parentInsets) {
    Dimension d = createDimension(parentBounds.width, parentBounds.height, "");
    return getAbsolute(oo, d, parentInsets);
    }
    /**
    * Return the absolute position for a given offset, orientation, size of the
    * parent and insets.
    */
    public static Point getAbsolute(OffsetOrientation oo, Dimension parentSize, int parentInsets) {
    Point pos = createPoint(0, 0, null);
    int offsetValue = oo.getOffset();
    switch(oo.getOrientation()) {
    case NORTH:
    pos.setX(offsetValue);
    pos.setY(0);
    break;
    case WEST:
    pos.setX(0);
    pos.setY(offsetValue);
    break;
    case SOUTH:
    pos.setX(offsetValue);
    pos.setY(parentSize.getHeight() - 2 * parentInsets);
    break;
    case EAST:
    pos.setX(parentSize.getWidth() - 2 * parentInsets);
    pos.setY(offsetValue);
    break;
    }
    return pos;
    }
    /** Returns the {@link Points} layout data object for the given connection. */
    public static Points getConnectionPoints(ILayoutedModelElement lobject) {
    return getPoints(lobject, CONNECTION_POINTS);
    }
    /** Adds the given x/y point to the layout data of the given element. */
    public static void addConnectionPoint(ILayoutedModelElement lobject, int index, int x, int y) {
    Points existingPoints = getConnectionPoints(lobject);
    Point newPoint = createPoint(x, y, null);
    existingPoints.getPoints().add(index, newPoint);
    setPoints(lobject, CONNECTION_POINTS, existingPoints);
    }
    /** Changes the point of the layout data at the given index. */
    public static void changeConnectionPoint(ILayoutedModelElement lobject, int index, int x,
    int y) {
    Points pts = getConnectionPoints(lobject);
    Point np = createPoint(x, y, null);
    pts.getPoints().set(index, np);
    setPoints(lobject, CONNECTION_POINTS, pts);
    }
    /** Changes all the point layout data of the given element. */
    public static void changeAllConnectionPoints(ILayoutedModelElement lobject, int dx, int dy) {
    Points pts = getConnectionPoints(lobject);
    Points newPoints = createPoints(null);
    if(pts != null) {
    for(Point p : pts.getPoints()) {
    Point np = createPoint(p.getX() + dx, p.getY() + dy, null);
    newPoints.getPoints().add(np);
    }
    setPoints(lobject, CONNECTION_POINTS, newPoints);
    }
    }
    /**
    * Removes the point at the given index from the layout data of the given
    * element.
    */
    public static void removeConnectionPoint(ILayoutedModelElement lobject, int index) {
    Points pts = getConnectionPoints(lobject);
    pts.getPoints().remove(index);
    setPoints(lobject, CONNECTION_POINTS, pts);
    }
    /**
    * Adds a {@link org.eclipse.draw2d.Bendpoint Bendpoint} defined by the x,y
    * parameters to a channel
    *
    * @param conn
    * the connection
    * @param bendPointX
    * the x coordinate of the Bendpoint
    * @param bendPointY
    * the y coordinate of the Bendpoint
    */
    public static void addBendPointToConnection(ILayoutedModelElement conn, int bendPointX,
    int bendPointY) {
    // set middle point of transition
    Point bendPoint = LayoutFactory.eINSTANCE.createPoint();
    bendPoint.setX(bendPointX);
    bendPoint.setY(bendPointY);
    getConnectionPoints(conn).getPoints().add(bendPoint);
    }
    }
    ......@@ -19,8 +19,8 @@ import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_CON
    import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_INSETS;
    import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT;
    import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getAbsolute;
    import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectorOffsetOrientation;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getAbsolute;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getConnectorOffsetOrientation;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodePosition;
    import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodeSize;
    ......
    ......@@ -2,14 +2,18 @@ Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: %pluginName
    Bundle-SymbolicName: org.fortiss.tooling.base;singleton:=true
    Bundle-Version: 2.20.0.qualifier
    Bundle-Version: 2.21.0.qualifier
    Bundle-ClassPath: .
    Bundle-Vendor: %providerName
    Bundle-Localization: plugin
    Bundle-RequiredExecutionEnvironment: JavaSE-11
    Require-Bundle: org.eclipse.core.runtime,
    org.eclipse.emf.ecore;visibility:=reexport,
    org.fortiss.tooling.kernel;bundle-version="2.20.0";visibility:=reexport
    org.fortiss.tooling.kernel;bundle-version="2.20.1";visibility:=reexport,
    org.eclipse.elk.core;bundle-version="0.7.1",
    org.eclipse.elk.alg.layered;bundle-version="0.7.1",
    org.eclipse.elk.graph;bundle-version="0.7.1",
    org.eclipse.elk.alg.common;bundle-version="0.7.1"
    Bundle-ActivationPolicy: lazy
    Export-Package: org.fortiss.tooling.base,
    org.fortiss.tooling.base.annotation,
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment