Skip to content
Snippets Groups Projects
Commit 5ef92092 authored by Simon Barner's avatar Simon Barner
Browse files

Merge branch 'master' of https://git.fortiss.org/af3/kernel.git into 3569

parents 2575a47a 17998ffe
No related branches found
No related tags found
1 merge request!323569: Avoid warnings
DiagramLayoutConfigurationBase.java a2fdf000358081429b80706bf29ad6eeda056c2b GREEN
EllipseCurveLayoutDiagramConfiguration.java 2705bda6ed35bc1af4f01a9db2f435587932bacc GREEN
EllipseCurveLayoutDiagramConfiguration.java c829b7b82c062a96f8e0c76f78b49ff05b4ddaa2 GREEN
IDiagramLayoutConfiguration.java 2c05b73b104fcea91ad3505ae255e014c314685c GREEN
RectangleGridLayoutDiagramConfiguration.java 23ddf57d202057181c150bd8c8b6df972b762522 GREEN
......@@ -27,7 +27,6 @@ import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodeSize;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
......@@ -88,7 +87,7 @@ public class EllipseCurveLayoutDiagramConfiguration extends DiagramLayoutConfigu
.translate(HALF_DEFAULT_CONNECTOR_SIZE, HALF_DEFAULT_CONNECTOR_SIZE);
Dimension ellipseSize = connectorEditPart.getParentEditPart().getFigure().getSize();
Dimension scaledEllipseSize = ellipseSize.getScaled(-.5);
newPosition.translate(scaledEllipseSize.height(), scaledEllipseSize.width());
newPosition.translate(scaledEllipseSize.width(), scaledEllipseSize.height());
setConnectorAngle(connector, new Polar(newPosition).angle);
}
......@@ -98,6 +97,7 @@ public class EllipseCurveLayoutDiagramConfiguration extends DiagramLayoutConfigu
public void alterStickyConnectorMoveFeedbackRequest(ChangeBoundsRequest request,
StickyConnectorEditPartBase<? extends ILayoutedModelElement> connectorEditPart,
IFigure connectorFigure) {
ILayoutedModelElement stickyConnectorModel = connectorEditPart.getModel();
double angle = getConnectorAngleAsDouble(stickyConnectorModel);
......@@ -106,6 +106,7 @@ public class EllipseCurveLayoutDiagramConfiguration extends DiagramLayoutConfigu
org.fortiss.tooling.base.model.layout.Dimension ellipseSizeElement =
LayoutModelElementFactory.createDimension(ellipseSize.width(), ellipseSize.height(),
ellipseSize.toString() + "_element");
org.fortiss.tooling.base.model.layout.Point oldPosition =
calculateEllipseBorderPoint(angle, ellipseSizeElement, HALF_DEFAULT_CONNECTOR_SIZE)
.translate(-HALF_DEFAULT_CONNECTOR_SIZE, -HALF_DEFAULT_CONNECTOR_SIZE);
......@@ -120,9 +121,16 @@ public class EllipseCurveLayoutDiagramConfiguration extends DiagramLayoutConfigu
newPosition = calculateEllipseBorderPoint(new Polar(newPosition).angle, ellipseSizeElement,
HALF_DEFAULT_CONNECTOR_SIZE).translate(-HALF_DEFAULT_CONNECTOR_SIZE,
-HALF_DEFAULT_CONNECTOR_SIZE);
// update move delta with new position
newPosition.translate(newPosition.getDifference(oldPosition));
request.setMoveDelta(new Point(newPosition.getX(), newPosition.getY()));
// TODO FR (see #3517). The moveData is not correctly calculated. The projected location
// should move on the ellipse border, the same as on a rectangular border. As of now the
// projection is also placed outside and inside the ellipse.
// Until the calculation code is fixed, do not apply the result such that these connectors
// are at least moveable all around the ellipse.
// request.setMoveDelta(new Point(newPosition.getX(), newPosition.getY()));
}
/** {@inheritDoc} */
......
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