Commit 28a2b7f9 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Merge branch '3883' into 'master'

JFX: Base classes

See merge request af3/kernel!81
parents a7b7594e feca7d0a
......@@ -25,7 +25,9 @@ Export-Package: org.fortiss.tooling.base.ui,
org.fortiss.tooling.base.ui.editor,
org.fortiss.tooling.base.ui.editor.annotations,
org.fortiss.tooling.base.ui.editor.fx,
org.fortiss.tooling.base.ui.editor.fx.visuals,
org.fortiss.tooling.base.ui.editor.fx.controller,
org.fortiss.tooling.base.ui.editor.fx.model,
org.fortiss.tooling.base.ui.editor.fx.visual,
org.fortiss.tooling.base.ui.editpart,
org.fortiss.tooling.base.ui.editpart.allocation,
org.fortiss.tooling.base.ui.editpart.command,
......
ContextMenuUtil.java 7be87ce47b775d90c533078e22d4d445d9864caf GREEN
EObjectDiagramController.java 66b14c1c77953cad7caecae1e04f455958943f28 GREEN
EObjectModelChangeProvider.java f4b60cebb088a5c81ca92a41614e1a5d40030502 GREEN
EObjectRectangularResizableContentControllerBase.java 787a540213f29e8daaecd9afe98af8b3f4088db7 GREEN
KernelServiceBasedModelChangeProviderBase.java 18e48f17ea8dfba90de024a8959fc5a4b0d05d45 GREEN
LayoutModelChangeProvider.java b5449d02eaf39086909720c43e21bd061005fc9e GREEN
LayoutedContentAnchorageController.java 3794b41d76e9ce14ead0bd812cde5c1a6d348d5c GREEN
LayoutedDiagramAnchorageController.java 1e1ac7c5fa26c632736f5023e90f05d09bc0710d GREEN
LayoutedLinkBendPointController.java a8372485ae96f2abf773d1baeb1f8c7b2b25985f GREEN
LayoutedRectangularResizableContentController.java 1e18af3ee10dd3754325ed389fed664da65a0b61 GREEN
......@@ -13,7 +13,7 @@
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createPoint;
......
......@@ -11,12 +11,13 @@
* Florian Hoelzl (fortiss GmbH) - initial implementation
*
*******************************************************************************/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.lang.Math.max;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createDisplayMenu;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createElementCompositionContext;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createPrototypeMenu;
import static java.util.Objects.requireNonNull;
import static org.fortiss.tooling.base.ui.editor.fx.controller.ContextMenuUtil.createDisplayMenu;
import static org.fortiss.tooling.base.ui.editor.fx.controller.ContextMenuUtil.createElementCompositionContext;
import static org.fortiss.tooling.base.ui.editor.fx.controller.ContextMenuUtil.createPrototypeMenu;
import java.util.List;
......@@ -39,18 +40,20 @@ import javafx.scene.control.MenuItem;
*
* @author hoelzl
*/
public abstract class EObjectBasedDiagramControllerBase extends ControllerBase {
public class EObjectDiagramController<T extends EObject> extends ControllerBase {
/** The model change provider. */
private final EObjectModelChangeProvider modelChangeProvider;
/** Constructor. */
public EObjectBasedDiagramControllerBase(IMVCBundle mvcb) {
public EObjectDiagramController(IMVCBundle mvcb, Class<T> modelType) {
super(mvcb);
if(!(getModel() instanceof EObject)) {
throw new IllegalArgumentException("Model element must be an instance of an EObject.");
Object model = requireNonNull(mvcb.getModel(), "The given model is null!");
if(!modelType.isAssignableFrom(model.getClass())) {
throw new IllegalArgumentException("Expected model of type " +
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
}
this.modelChangeProvider = new EObjectModelChangeProvider(getEObject());
this.modelChangeProvider = new EObjectModelChangeProvider(getModelElement());
}
/** {@inheritDoc} */
......@@ -60,9 +63,10 @@ public abstract class EObjectBasedDiagramControllerBase extends ControllerBase {
}
/** Returns the {@link EObject} model element. */
protected EObject getEObject() {
@SuppressWarnings("unchecked")
protected T getModelElement() {
// wild cast works: see constructor check with exception
return (EObject)getModel();
return (T)getModel();
}
/** {@inheritDoc} */
......@@ -74,7 +78,7 @@ public abstract class EObjectBasedDiagramControllerBase extends ControllerBase {
double y = max(features.getVerticalSpacing(), diagramLocation.getY());
// wild cast works: see constructor exception
EObject modelParent = getEObject();
T modelParent = getModelElement();
IElementCompositionContext edc = createElementCompositionContext(modelParent, x, y, true,
getViewer().getFeatures().getCurrentZoomFactor());
List<MenuItem> result = createPrototypeMenu(modelParent, edc);
......
......@@ -13,7 +13,7 @@
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
......
......@@ -11,11 +11,14 @@
* Florian Hoelzl (fortiss GmbH) - initial implementation
*
*******************************************************************************/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.lang.Math.max;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createElementCompositionContext;
import static org.fortiss.tooling.base.ui.editor.fx.ContextMenuUtil.createPrototypeMenu;
import static java.util.Objects.requireNonNull;
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.editor.fx.controller.ContextMenuUtil.createElementCompositionContext;
import static org.fortiss.tooling.base.ui.editor.fx.controller.ContextMenuUtil.createPrototypeMenu;
import java.util.List;
......@@ -25,9 +28,12 @@ import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.change.Change;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IClickController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IDragController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.base.ClickControllerBase;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.rectangular.RectangularContentAnchorageMoveController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.rectangular.RectangularResizableContentControllerBase;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.base.model.element.ElementPackage;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
......@@ -37,6 +43,7 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
import javafx.geometry.Dimension2D;
import javafx.scene.Node;
import javafx.scene.control.MenuItem;
import javafx.scene.input.MouseEvent;
......@@ -47,28 +54,29 @@ import javafx.scene.input.MouseEvent;
*
* @author hoelzl
*/
public abstract class EObjectBasedRectangularResizableContentControllerBase
public abstract class EObjectRectangularResizableContentControllerBase<T extends EObject>
extends RectangularResizableContentControllerBase {
/** {@link IModelChangeProvider} for this controller */
private final LayoutModelElementModelChangeProvider layoutModelChangeProvider;
private final LayoutModelChangeProvider layoutModelChangeProvider;
/** The click controller handling double-click to open editor. */
private final IClickController openEditorDoubleClickController = new ClickControllerBase() {
@Override
public Change singleClick(MouseEvent event, Node node, DiagramCoordinate diagramLocation) {
return EObjectBasedRectangularResizableContentControllerBase.super.getClickController(
node, diagramLocation).singleClick(event, node, diagramLocation);
return EObjectRectangularResizableContentControllerBase.super.getClickController(node,
diagramLocation).singleClick(event, node, diagramLocation);
}
@Override
public Change secondaryClick(MouseEvent event, Node node,
DiagramCoordinate diagramLocation) {
return EObjectBasedRectangularResizableContentControllerBase.super.getClickController(
node, diagramLocation).secondaryClick(event, node, diagramLocation);
return EObjectRectangularResizableContentControllerBase.super.getClickController(node,
diagramLocation).secondaryClick(event, node, diagramLocation);
}
@Override
public Change doubleClick(MouseEvent event, Node node, DiagramCoordinate diagramLocation) {
EObject eo = getLayoutedME();
EObject eo = getModelElement();
IModelElementHandler<EObject> handler =
IModelElementHandlerService.getInstance().getModelElementHandler(eo);
if(handler != null) {
......@@ -80,18 +88,22 @@ public abstract class EObjectBasedRectangularResizableContentControllerBase
};
/** Constructor. */
public EObjectBasedRectangularResizableContentControllerBase(IContentMVCBundle mvcb) {
public EObjectRectangularResizableContentControllerBase(IContentMVCBundle mvcb,
Class<T> modelType) {
super(mvcb);
if(!(mvcb.getModel() instanceof ILayoutedModelElement)) {
throw new IllegalArgumentException(
"Model element must be an instance of an ILayoutedModelElement.");
Object model = requireNonNull(mvcb.getModel(), "The given model is null!");
if(!modelType.isAssignableFrom(model.getClass())) {
throw new IllegalArgumentException("Expected model of type " +
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
}
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelElementModelChangeProvider(lme) {
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme) {
/** {@inheritDoc} */
@Override
protected boolean acceptNotification(Notification notification) {
if(notification.getNotifier() != getLayoutedME()) {
if(notification.getNotifier() != getModelElement()) {
return false;
}
return isAnchorageFeature(notification.getFeature());
......@@ -99,10 +111,11 @@ public abstract class EObjectBasedRectangularResizableContentControllerBase
};
}
/** Returns the {@link ILayoutedModelElement} model element. */
protected ILayoutedModelElement getLayoutedME() {
/** Returns the correctly casted model element. */
@SuppressWarnings("unchecked")
protected T getModelElement() {
// wild cast works: see constructor check with exception
return (ILayoutedModelElement)getModel();
return (T)getModel();
}
/** {@inheritDoc} */
......@@ -111,6 +124,28 @@ public abstract class EObjectBasedRectangularResizableContentControllerBase
return layoutModelChangeProvider;
}
/** {@inheritDoc} */
@Override
protected IDragController createAnchorageMoveController(IContentAnchorageMVCBundle anchorage) {
// we need an overridden port move controller due to the frameworks default snapping
// behavior, which snaps to anchorage size while AF3 ports snap to half their size
return new RectangularContentAnchorageMoveController(this, anchorage) {
/** {@inheritDoc} */
@Override
protected Dimension2D overrideBorderSnap(Dimension2D anchorageSize) {
// this override is required because ports can be moved by half their size
// while the default implementation would only allow for full size of the port
return new Dimension2D(anchorageSize.getWidth() / 2, anchorageSize.getHeight() / 2);
}
};
}
/** {@inheritDoc} */
@Override
protected Dimension2D getMinimumSize() {
return new Dimension2D(DEFAULT_SHAPE_MINIMUM_WIDTH, DEFAULT_SHAPE_MINIMUM_HEIGHT);
}
/** {@inheritDoc} */
@Override
public List<MenuItem> contextMenuContributions(Node node, DiagramCoordinate diagramLocation) {
......@@ -129,7 +164,7 @@ public abstract class EObjectBasedRectangularResizableContentControllerBase
/** {@inheritDoc} */
@Override
public void delete() {
IElementCompositorService.getInstance().decompose(getLayoutedME());
IElementCompositorService.getInstance().decompose(getModelElement());
}
/** Checks whether the given feature corresponds to an anchorage model element. */
......
......@@ -13,7 +13,7 @@
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import java.util.ArrayList;
import java.util.EventObject;
......
......@@ -13,7 +13,7 @@
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static org.fortiss.tooling.base.model.layout.LayoutPackage.ILAYOUTED_MODEL_ELEMENT__LAYOUT_DATA;
......@@ -26,11 +26,11 @@ import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.model.layout.LayoutPackage;
/**
* An {@link KernelServiceBasedModelChangeProviderBase} for {@link ILayoutedModelElement}s.
* A {@link KernelServiceBasedModelChangeProviderBase} for {@link ILayoutedModelElement}s.
*
* @author hoelzl
*/
class LayoutModelElementModelChangeProvider
class LayoutModelChangeProvider
extends KernelServiceBasedModelChangeProviderBase<ILayoutedModelElement> {
/** The layouted model element. */
private final ILayoutedModelElement modelElement;
......@@ -38,7 +38,7 @@ class LayoutModelElementModelChangeProvider
private final LayoutModelElementAdapter notificationListener;
/** Constructor. */
public LayoutModelElementModelChangeProvider(ILayoutedModelElement modelElement) {
public LayoutModelChangeProvider(ILayoutedModelElement modelElement) {
this.modelElement = modelElement;
this.notificationListener = new LayoutModelElementAdapter();
}
......
......@@ -11,8 +11,9 @@
* Florian Hoelzl (fortiss GmbH) - initial implementation
*
*******************************************************************************/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.util.Objects.requireNonNull;
import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_ALLOWED_TAG;
import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
......@@ -34,20 +35,23 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService;
*
* @author hoelzl
*/
public class LayoutedModelElementBasedContentAnchorageController
public class LayoutedContentAnchorageController<T extends ILayoutedModelElement>
extends DelegatingContentAnchorageController {
/** {@link IModelChangeProvider} for this controller */
private final LayoutModelElementModelChangeProvider layoutModelChangeProvider;
private final LayoutModelChangeProvider layoutModelChangeProvider;
/** Constructor. */
public LayoutedModelElementBasedContentAnchorageController(IContentAnchorageMVCBundle mvcb) {
public LayoutedContentAnchorageController(IContentAnchorageMVCBundle mvcb, Class<T> modelType) {
super(mvcb);
if(!(mvcb.getModel() instanceof ILayoutedModelElement)) {
throw new IllegalArgumentException(
"Model element must be an instance of an ILayoutedModelElement.");
Object model = requireNonNull(mvcb.getModel(), "The given model is null!");
if(!modelType.isAssignableFrom(model.getClass())) {
throw new IllegalArgumentException("Expected model of type " +
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
}
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelElementModelChangeProvider(lme);
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme);
}
/** Returns the model element. */
......
......@@ -11,8 +11,9 @@
* Florian Hoelzl (fortiss GmbH) - initial implementation
*
*******************************************************************************/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.util.Objects.requireNonNull;
import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_ALLOWED_TAG;
import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.moveNode;
......@@ -34,19 +35,23 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService;
*
* @author hoelzl
*/
public class LayoutedModelElementBasedDiagramAnchorageController extends MoveControllerBase {
public class LayoutedDiagramAnchorageController<T extends ILayoutedModelElement>
extends MoveControllerBase {
/** {@link IModelChangeProvider} for this controller */
private final LayoutModelElementModelChangeProvider layoutModelChangeProvider;
private final LayoutModelChangeProvider layoutModelChangeProvider;
/** Constructor. */
public LayoutedModelElementBasedDiagramAnchorageController(IMVCBundle mvcb) {
public LayoutedDiagramAnchorageController(IMVCBundle mvcb, Class<T> modelType) {
super(mvcb);
if(!(mvcb.getModel() instanceof ILayoutedModelElement)) {
throw new IllegalArgumentException(
"Model element must be an instance of an ILayoutedModelElement.");
Object model = requireNonNull(mvcb.getModel(), "The given model is null!");
if(!modelType.isAssignableFrom(model.getClass())) {
throw new IllegalArgumentException("Expected model of type " +
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
}
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelElementModelChangeProvider(lme);
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme);
}
/** Returns the model element. */
......
......@@ -11,8 +11,9 @@
* Florian Hoelzl (fortiss GmbH) - initial implementation
*
*******************************************************************************/
package org.fortiss.tooling.base.ui.editor.fx;
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.util.Objects.requireNonNull;
import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.addConnectionPoint;
import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectionPoints;
import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.removeConnectionPoint;
......@@ -37,24 +38,43 @@ import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
*
* @author hoelzl
*/
public class LayoutedModelElementBasedLinkBendPointController extends LinkControllerBase {
public class LayoutedLinkBendPointController<T extends ILayoutedModelElement>
extends LinkControllerBase {
/** {@link IModelChangeProvider} for this controller */
private final LayoutModelElementModelChangeProvider layoutModelChangeProvider;
private final LayoutModelChangeProvider layoutModelChangeProvider;
/** Constructor. */
public LayoutedModelElementBasedLinkBendPointController(ILinkMVCBundle mvcb) {
public LayoutedLinkBendPointController(ILinkMVCBundle mvcb, Class<T> modelType) {
super(mvcb);
if(!(mvcb.getModel() instanceof ILayoutedModelElement)) {
throw new IllegalArgumentException(
"Model element must be an instance of an ILayoutedModelElement.");
Object model = requireNonNull(mvcb.getModel(), "The given model is null!");
if(!modelType.isAssignableFrom(model.getClass())) {
throw new IllegalArgumentException("Expected model of type " +
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
}
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelElementModelChangeProvider(lme);
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme);
}
/** Returns the model element. */
public ILayoutedModelElement getLayoutedME() {
return (ILayoutedModelElement)getModel();
@SuppressWarnings("unchecked")
public T getModelElement() {
return (T)getModel();
}
/** {@inheritDoc} */
@Override
protected boolean clampAndSnapBendPointToGridCenter() {
// disable default mode
return false;
}
/** {@inheritDoc} */
@Override
protected boolean clampAndSnapBendPointToGrid() {
// enable clamping mode
return true;
}
/** {@inheritDoc} */
......@@ -66,7 +86,7 @@ public class LayoutedModelElementBasedLinkBendPointController extends LinkContro
/** {@inheritDoc} */
@Override
protected int getNumerOfBendPoints() {
return getBendPointList(getLayoutedME()).size();
return getBendPointList(getModelElement()).size();
}
/** Returns the list of bend-points. */
......@@ -79,13 +99,13 @@ public class LayoutedModelElementBasedLinkBendPointController extends LinkContro
protected void createBendPointAt(int bpIndex, DiagramCoordinate location) {
int x = (int)location.getX();
int y = (int)location.getY();
addConnectionPoint(getLayoutedME(), bpIndex, x, y);
addConnectionPoint(getModelElement(), bpIndex, x, y);
}
/** {@inheritDoc} */
@Override
protected void updateModelAfterBendPointMove(int bpIndex, double dx, double dy) {
List<Point> oldPoints = getBendPointList(getLayoutedME());
List<Point> oldPoints = getBendPointList(getModelElement());
Point point = oldPoints.get(bpIndex);
int oldX = point.getX();
int oldY = point.getY();
......@@ -98,7 +118,7 @@ public class LayoutedModelElementBasedLinkBendPointController extends LinkContro
/** {@inheritDoc} */
@Override
protected void deleteBendPoint(int bpIndex) {
removeConnectionPoint(getLayoutedME(), bpIndex);
removeConnectionPoint(getModelElement(), bpIndex);
}
/** {@inheritDoc} */
......@@ -111,7 +131,7 @@ public class LayoutedModelElementBasedLinkBendPointController extends LinkContro
/** {@inheritDoc} */
@Override
protected void deleteLink() {
IConnectionCompositorService.getInstance().disconnect(getLayoutedME());
IConnectionCompositorService.getInstance().disconnect(getModelElement());
}
/** {@inheritDoc} */
......
/*-------------------------------------------------------------------------+
| Copyright 2019 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.editor.fx.controller;
import static java.util.Objects.requireNonNull;
import static org.fortiss.tooling.base.ui.utils.LWFXEditorUtils.convertSideToEOrientation;
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.setNodeSize;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.setStickyConnectorLayoutData;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.FeedbackChange;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.layout.Dimension;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import javafx.geometry.Dimension2D;
import javafx.geometry.Side;
/**
* {@link IController} for {@link ILayoutedModelElement}s that have a rectangular shape.
*
* @author diewald
*/
public class LayoutedRectangularResizableContentController<T extends ILayoutedModelElement>
extends EObjectRectangularResizableContentControllerBase<T> {
/** Constructor. */
public LayoutedRectangularResizableContentController(IContentMVCBundle mvcb,