Commit b61ac7c2 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Components: JavaFX editor. Ports are positioned equal to GEF editor.

Issue-Ref: 3815
Issue-Url: https://af3-developer.fortiss.org/issues/3815

Signed-off-by: Florian Hölzl's avatarFlorian Hoelzl <hoelzl@fortiss.org>
parent c5eb64b9
......@@ -2,4 +2,4 @@ ChannelVisual.java 302cff971a2d2efd4f20f3f77225ff0660580a13 YELLOW
CoordinateCorrections.java c676ffd7f26e4f29f6e3bbcbde7c26d4e4c21c4d GREEN
DiagramComponentPortVisual.java 842e298a4d01a9428083d5e86a614547cd065b23 YELLOW
SubComponentPortVisual.java db1ad8ec2246380b25b3e2d1edefe7f047f48b6f YELLOW
SubComponentVisual.java 2c0a1acdcd79f12f61b54e97be1dc3f1a7b55776 YELLOW
SubComponentVisual.java 285df737cfd719e8fe9c8de8186ced30ee636da1 YELLOW
......@@ -15,6 +15,7 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.editor.fx.visual;
import static java.lang.Math.min;
import static javafx.scene.paint.Color.BLACK;
import static org.fortiss.af3.component.ui.AF3ComponentUIActivator.convertColor;
import static org.fortiss.af3.component.ui.AF3ComponentUIActivator.getFXImage;
......@@ -22,7 +23,6 @@ import static org.fortiss.af3.component.ui.DefaultStyle.STRONGLY_CAUSAL_COMPONEN
import static org.fortiss.af3.component.ui.DefaultStyle.SUBSTRUCTURE_COMPONENT_BACKGROUND;
import static org.fortiss.af3.component.ui.DefaultStyle.WEAKLY_CAUSAL_COMPONENT_BACKGROUND;
import static org.fortiss.af3.component.ui.editor.fx.visual.CoordinateCorrections.COMPONENT_INSETS;
import static org.fortiss.af3.component.ui.editor.fx.visual.CoordinateCorrections.PORT_DIMENSION;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.getNodeBounds;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramCoordinate;
......@@ -109,7 +109,12 @@ public final class SubComponentVisual extends RectangularContentVisualBase {
Rectangle2D pb = getCurrentBounds();
Side side = visual.getLayout(ISideLayout.class).getSide();
double offset = visual.getLayout(IOffsetLayout.class).getOffset();
return new RectangularBorderLocation(side, offset, pb, PORT_DIMENSION).getLocation();
Dimension2D dim = visual.getDimensions();
DiagramCoordinate location =
new RectangularBorderLocation(side, offset, pb, dim).getLocation();
double x = min(location.getX(), pb.getWidth() - dim.getWidth() / 2);
double y = min(location.getY(), pb.getHeight() - dim.getHeight() / 2);
return new DiagramCoordinate(x, y);
}
/** {@inheritDoc} */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment