Skip to content
Snippets Groups Projects
Commit 34e45606 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Merge branch '3975' into 'master'

Kernel: fixed restricted model listener for name and comment.

See merge request !103
parents 19f6139f 87fcdc38
No related branches found
No related tags found
1 merge request!103Kernel: fixed restricted model listener for name and comment.
Showing
with 69 additions and 52 deletions
ContextMenuUtil.java 405387151d45b09dffb3b6ba44f980313c8edcaf GREEN ContextMenuUtil.java 405387151d45b09dffb3b6ba44f980313c8edcaf GREEN
CurvedLinkLayoutedContentAnchorangeController.java a206a297cfc51281b31d02c751c3090b49fc7341 GREEN CurvedLinkLayoutedContentAnchorangeController.java e22faedbe98c3dab660b5d2df8ebd004e116c5ba GREEN
CurvedLinkLayoutedDiagramAnchorangeController.java 41b7cc1ad066aa677eb3005a5bceeaa200d01eaa GREEN CurvedLinkLayoutedDiagramAnchorangeController.java f2e5e2a7cc9b6a070871e200e57371286bb15222 GREEN
EObjectDiagramController.java 2b253941592ee25ead95223470f983f23ef9776f GREEN EObjectDiagramController.java 2b253941592ee25ead95223470f983f23ef9776f GREEN
EObjectEllipticResizableContentControllerBase.java 7c862a03b97d2f2cfdcc2fcee7434de2e1e257d2 GREEN EObjectEllipticResizableContentControllerBase.java 958d3856daf5337cd75d0a6f163a27dcc8717160 GREEN
EObjectModelChangeProvider.java f4b60cebb088a5c81ca92a41614e1a5d40030502 GREEN EObjectModelChangeProvider.java f4b60cebb088a5c81ca92a41614e1a5d40030502 GREEN
EObjectRectangularResizableContentControllerBase.java e73cda8f54318f8b785a208215d9e31eaa46eff7 GREEN EObjectRectangularResizableContentControllerBase.java 7cbc3e89b7b74106d56b8b4f845087e96e13d109 GREEN
KernelServiceBasedModelChangeProviderBase.java 8d1f8ef79ecd383ff74e5a2bbcf24345aabe70af GREEN KernelServiceBasedModelChangeProviderBase.java 8d1f8ef79ecd383ff74e5a2bbcf24345aabe70af GREEN
LayoutModelChangeProvider.java b5449d02eaf39086909720c43e21bd061005fc9e GREEN LayoutedContentAnchorageController.java 83f066a151dd2984c4bef64daf8165a0cd53b00f GREEN
LayoutedContentAnchorageController.java 9fc513a7404277514c730f7702d45588f2d81878 GREEN LayoutedCurveLinkBendPointController.java d963a5e227de7bd8ba910c733df2ac7acf4fa1fa GREEN
LayoutedCurveLinkBendPointController.java 54d7c294c4afaeadb6787408fbfe2ca1958c2de0 GREEN LayoutedDiagramAnchorageController.java 89ee56e8e71a5fa635cfac81e84bbfe1d50e5776 GREEN
LayoutedDiagramAnchorageController.java 32d7d77daf252d021458c39ebcfe502f26f29a98 GREEN LayoutedEllipticResizableContentController.java 1c50e80121512de7ae1f2ba09e0e1f4d0e3f3104 GREEN
LayoutedEllipticResizableContentController.java 93bdeb7ecd5f7386724a9d7df5fff3174ab8ce10 GREEN LayoutedLineLinkBendPointController.java f49c994a0c90612c44ec83d42cf858e476662e1f GREEN
LayoutedLineLinkBendPointController.java f5fac4fe8e4b4c0259407acb6bfc80dbe9c3a1fb GREEN LayoutedLinkBendPointController.java d06736b49b6ac9a073237b989895469891500e7f GREEN
LayoutedLinkBendPointController.java 3203d946de233274934dca1bcd47bbdc1d0a3b13 GREEN LayoutedRectangularResizableContentController.java 341f4a7da0d69360d7026af6d9b3d44dfd7d9bb1 GREEN
LayoutedRectangularResizableContentController.java 3232d423572924363702898cf8ba240ce7042b65 GREEN
ModelElementFXEditorUIProviderBase.java b81bf7fc945d40f1f842876f07ba70799ab65f6d GREEN ModelElementFXEditorUIProviderBase.java b81bf7fc945d40f1f842876f07ba70799ab65f6d GREEN
NamedCommentedLayoutModelChangeProvider.java 223e82c1b1cba842f6fae115182f5d0c6acb44b0 GREEN
...@@ -28,13 +28,14 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate; ...@@ -28,13 +28,14 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base.DelegatingContentAnchorageController; import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base.DelegatingContentAnchorageController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
/** /**
* {@link DelegatingContentAnchorageController} for diagrams with curved links. * {@link DelegatingContentAnchorageController} for diagrams with curved links.
* *
* @author munaro * @author munaro
*/ */
public class CurvedLinkLayoutedContentAnchorangeController<T extends IConnector & ILayoutedModelElement> public class CurvedLinkLayoutedContentAnchorangeController<T extends IConnector & INamedCommentedElement & ILayoutedModelElement>
extends LayoutedContentAnchorageController<T> { extends LayoutedContentAnchorageController<T> {
/** Constructor. */ /** Constructor. */
......
...@@ -26,13 +26,14 @@ import org.fortiss.tooling.base.model.element.IConnector; ...@@ -26,13 +26,14 @@ import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement; import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate; import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
/** /**
* {@link LayoutedDiagramAnchorageController} for diagrams with curved links. * {@link LayoutedDiagramAnchorageController} for diagrams with curved links.
* *
* @author munaro * @author munaro
*/ */
public class CurvedLinkLayoutedDiagramAnchorangeController<T extends IConnector & ILayoutedModelElement> public class CurvedLinkLayoutedDiagramAnchorangeController<T extends IConnector & INamedCommentedElement & ILayoutedModelElement>
extends LayoutedDiagramAnchorageController<T> { extends LayoutedDiagramAnchorageController<T> {
/** Constructor. */ /** Constructor. */
......
...@@ -35,6 +35,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.elliptic.EllipticR ...@@ -35,6 +35,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.elliptic.EllipticR
import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider; import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext; import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService; import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler; import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService; import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
...@@ -51,10 +52,10 @@ import javafx.scene.input.MouseEvent; ...@@ -51,10 +52,10 @@ import javafx.scene.input.MouseEvent;
* *
* @author hoelzl * @author hoelzl
*/ */
public abstract class EObjectEllipticResizableContentControllerBase<T extends EObject> public abstract class EObjectEllipticResizableContentControllerBase<T extends INamedCommentedElement & ILayoutedModelElement>
extends EllipticResizableContentControllerBase { extends EllipticResizableContentControllerBase {
/** {@link IModelChangeProvider} for this controller */ /** {@link IModelChangeProvider} for this controller */
private final LayoutModelChangeProvider layoutModelChangeProvider; private final NamedCommentedLayoutModelChangeProvider<T> layoutModelChangeProvider;
/** The click controller handling double-click to open editor. */ /** The click controller handling double-click to open editor. */
private final IClickController openEditorDoubleClickController = new ClickControllerBase() { private final IClickController openEditorDoubleClickController = new ClickControllerBase() {
@Override @Override
...@@ -94,8 +95,8 @@ public abstract class EObjectEllipticResizableContentControllerBase<T extends EO ...@@ -94,8 +95,8 @@ public abstract class EObjectEllipticResizableContentControllerBase<T extends EO
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName()); modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
} }
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel(); @SuppressWarnings("unchecked") T lme = (T)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme) { this.layoutModelChangeProvider = new NamedCommentedLayoutModelChangeProvider<T>(lme) {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
protected boolean acceptNotification(Notification notification) { protected boolean acceptNotification(Notification notification) {
......
...@@ -41,6 +41,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider; ...@@ -41,6 +41,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext; import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService; import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler; import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService; import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
...@@ -58,11 +59,11 @@ import javafx.scene.input.MouseEvent; ...@@ -58,11 +59,11 @@ import javafx.scene.input.MouseEvent;
* *
* @author hoelzl * @author hoelzl
*/ */
public abstract class EObjectRectangularResizableContentControllerBase<T extends EObject> public abstract class EObjectRectangularResizableContentControllerBase<T extends INamedCommentedElement & ILayoutedModelElement>
extends RectangularResizableContentControllerBase { extends RectangularResizableContentControllerBase {
/** {@link IModelChangeProvider} for this controller */ /** {@link IModelChangeProvider} for this controller */
private final LayoutModelChangeProvider layoutModelChangeProvider; private final NamedCommentedLayoutModelChangeProvider<T> layoutModelChangeProvider;
/** The click controller handling double-click to open editor. */ /** The click controller handling double-click to open editor. */
private final IClickController openEditorDoubleClickController = new ClickControllerBase() { private final IClickController openEditorDoubleClickController = new ClickControllerBase() {
@Override @Override
...@@ -102,8 +103,8 @@ public abstract class EObjectRectangularResizableContentControllerBase<T extends ...@@ -102,8 +103,8 @@ public abstract class EObjectRectangularResizableContentControllerBase<T extends
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName()); modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
} }
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel(); @SuppressWarnings("unchecked") T lme = (T)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme) { this.layoutModelChangeProvider = new NamedCommentedLayoutModelChangeProvider<T>(lme) {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
protected boolean acceptNotification(Notification notification) { protected boolean acceptNotification(Notification notification) {
......
...@@ -18,14 +18,15 @@ import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTa ...@@ -18,14 +18,15 @@ import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTa
import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG; import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate; import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base.DelegatingContentAnchorageController; import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base.DelegatingContentAnchorageController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider; import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.MVCBundleTag; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.MVCBundleTag;
import org.fortiss.tooling.base.model.element.IConnector; import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.kernel.service.IConnectionCompositorService; import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
import org.fortiss.tooling.kernel.service.IElementCompositorService; import org.fortiss.tooling.kernel.service.IElementCompositorService;
...@@ -34,10 +35,10 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService; ...@@ -34,10 +35,10 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService;
* *
* @author hoelzl * @author hoelzl
*/ */
public class LayoutedContentAnchorageController<T extends ILayoutedModelElement> public class LayoutedContentAnchorageController<T extends INamedCommentedElement & ILayoutedModelElement>
extends DelegatingContentAnchorageController { extends DelegatingContentAnchorageController {
/** {@link IModelChangeProvider} for this controller */ /** {@link IModelChangeProvider} for this controller */
private final LayoutModelChangeProvider layoutModelChangeProvider; private final NamedCommentedLayoutModelChangeProvider<T> layoutModelChangeProvider;
/** Constructor. */ /** Constructor. */
public LayoutedContentAnchorageController(IContentAnchorageMVCBundle mvcb, Class<T> modelType) { public LayoutedContentAnchorageController(IContentAnchorageMVCBundle mvcb, Class<T> modelType) {
...@@ -49,8 +50,8 @@ public class LayoutedContentAnchorageController<T extends ILayoutedModelElement> ...@@ -49,8 +50,8 @@ public class LayoutedContentAnchorageController<T extends ILayoutedModelElement>
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName()); modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
} }
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel(); @SuppressWarnings("unchecked") T lme = (T)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme); this.layoutModelChangeProvider = new NamedCommentedLayoutModelChangeProvider<T>(lme);
} }
/** Returns the model element. */ /** Returns the model element. */
......
...@@ -28,6 +28,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.FeedbackChange; ...@@ -28,6 +28,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.FeedbackChange;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController; import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.ILinkVisual; import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.ILinkVisual;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import javafx.geometry.Point2D; import javafx.geometry.Point2D;
...@@ -37,7 +38,7 @@ import javafx.geometry.Point2D; ...@@ -37,7 +38,7 @@ import javafx.geometry.Point2D;
* *
* @author munaro * @author munaro
*/ */
public class LayoutedCurveLinkBendPointController<T extends ILayoutedModelElement> public class LayoutedCurveLinkBendPointController<T extends INamedCommentedElement & ILayoutedModelElement>
extends LayoutedLinkBendPointController<T> { extends LayoutedLinkBendPointController<T> {
/** Constructor. */ /** Constructor. */
......
...@@ -14,19 +14,20 @@ ...@@ -14,19 +14,20 @@
package org.fortiss.tooling.base.ui.editor.fx.controller; package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.moveNode;
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_ALLOWED_TAG;
import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG; import static org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerDefaultTags.LINK_TARGET_DENIED_TAG;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.moveNode;
import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate; import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.fortiss.tooling.common.ui.javafx.lwfxef.FeedbackChange; import org.fortiss.tooling.common.ui.javafx.lwfxef.FeedbackChange;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base.MoveControllerBase; import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base.MoveControllerBase;
import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider; import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.MVCBundleTag; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.MVCBundleTag;
import org.fortiss.tooling.base.model.element.IConnector; import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.kernel.service.IConnectionCompositorService; import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
import org.fortiss.tooling.kernel.service.IElementCompositorService; import org.fortiss.tooling.kernel.service.IElementCompositorService;
...@@ -35,10 +36,10 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService; ...@@ -35,10 +36,10 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService;
* *
* @author hoelzl * @author hoelzl
*/ */
public class LayoutedDiagramAnchorageController<T extends ILayoutedModelElement> public class LayoutedDiagramAnchorageController<T extends INamedCommentedElement & ILayoutedModelElement>
extends MoveControllerBase { extends MoveControllerBase {
/** {@link IModelChangeProvider} for this controller */ /** {@link IModelChangeProvider} for this controller */
private final LayoutModelChangeProvider layoutModelChangeProvider; private final NamedCommentedLayoutModelChangeProvider<T> layoutModelChangeProvider;
/** Constructor. */ /** Constructor. */
public LayoutedDiagramAnchorageController(IMVCBundle mvcb, Class<T> modelType) { public LayoutedDiagramAnchorageController(IMVCBundle mvcb, Class<T> modelType) {
...@@ -50,8 +51,8 @@ public class LayoutedDiagramAnchorageController<T extends ILayoutedModelElement> ...@@ -50,8 +51,8 @@ public class LayoutedDiagramAnchorageController<T extends ILayoutedModelElement>
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName()); modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
} }
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel(); @SuppressWarnings("unchecked") T lme = (T)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme); this.layoutModelChangeProvider = new NamedCommentedLayoutModelChangeProvider<T>(lme);
} }
/** Returns the model element. */ /** Returns the model element. */
......
...@@ -29,13 +29,14 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.FeedbackChange; ...@@ -29,13 +29,14 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.FeedbackChange;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController; import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
/** /**
* {@link IController} for {@link ILayoutedModelElement}s that have a elliptical shape. * {@link IController} for {@link ILayoutedModelElement}s that have a elliptical shape.
* *
* @author munaro * @author munaro
*/ */
public class LayoutedEllipticResizableContentController<T extends ILayoutedModelElement> public class LayoutedEllipticResizableContentController<T extends ILayoutedModelElement & INamedCommentedElement>
extends EObjectEllipticResizableContentControllerBase<T> { extends EObjectEllipticResizableContentControllerBase<T> {
/** Constructor */ /** Constructor */
......
...@@ -20,6 +20,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate; ...@@ -20,6 +20,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewer; import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewer;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController; import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
/** /**
* {@link IController} for {@link ILayoutedModelElement}s representing straight links and * {@link IController} for {@link ILayoutedModelElement}s representing straight links and
...@@ -27,7 +28,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle; ...@@ -27,7 +28,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
* *
* @author hoelzl * @author hoelzl
*/ */
public class LayoutedLineLinkBendPointController<T extends ILayoutedModelElement> public class LayoutedLineLinkBendPointController<T extends INamedCommentedElement & ILayoutedModelElement>
extends LayoutedLinkBendPointController<T> { extends LayoutedLinkBendPointController<T> {
/** Constructor. */ /** Constructor. */
......
...@@ -30,6 +30,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base.LinkControlle ...@@ -30,6 +30,7 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.base.LinkControlle
import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider; import org.fortiss.tooling.common.ui.javafx.lwfxef.model.IModelChangeProvider;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.kernel.service.IConnectionCompositorService; import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
/** /**
...@@ -38,10 +39,10 @@ import org.fortiss.tooling.kernel.service.IConnectionCompositorService; ...@@ -38,10 +39,10 @@ import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
* *
* @author munaro * @author munaro
*/ */
public abstract class LayoutedLinkBendPointController<T extends ILayoutedModelElement> public abstract class LayoutedLinkBendPointController<T extends INamedCommentedElement & ILayoutedModelElement>
extends LinkControllerBase { extends LinkControllerBase {
/** {@link IModelChangeProvider} for this controller */ /** {@link IModelChangeProvider} for this controller */
protected final LayoutModelChangeProvider layoutModelChangeProvider; protected final NamedCommentedLayoutModelChangeProvider<T> layoutModelChangeProvider;
/** Returns the model element. */ /** Returns the model element. */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -65,8 +66,8 @@ public abstract class LayoutedLinkBendPointController<T extends ILayoutedModelEl ...@@ -65,8 +66,8 @@ public abstract class LayoutedLinkBendPointController<T extends ILayoutedModelEl
modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName()); modelType.getSimpleName() + ", but was " + model.getClass().getSimpleName());
} }
ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel(); @SuppressWarnings("unchecked") T lme = (T)mvcb.getModel();
this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme); this.layoutModelChangeProvider = new NamedCommentedLayoutModelChangeProvider<T>(lme);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
......
...@@ -22,13 +22,14 @@ import static org.fortiss.tooling.base.utils.LayoutDataUtils.moveNode; ...@@ -22,13 +22,14 @@ 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.setNodeSize;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.setStickyConnectorLayoutData; import static org.fortiss.tooling.base.utils.LayoutDataUtils.setStickyConnectorLayoutData;
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 org.fortiss.tooling.common.ui.javafx.lwfxef.FeedbackChange; import org.fortiss.tooling.common.ui.javafx.lwfxef.FeedbackChange;
import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController; import org.fortiss.tooling.common.ui.javafx.lwfxef.controller.IController;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle; import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.base.model.element.IConnector; import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.base.model.layout.Dimension;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import javafx.geometry.Dimension2D; import javafx.geometry.Dimension2D;
import javafx.geometry.Side; import javafx.geometry.Side;
...@@ -38,7 +39,7 @@ import javafx.geometry.Side; ...@@ -38,7 +39,7 @@ import javafx.geometry.Side;
* *
* @author diewald * @author diewald
*/ */
public class LayoutedRectangularResizableContentController<T extends ILayoutedModelElement> public class LayoutedRectangularResizableContentController<T extends INamedCommentedElement & ILayoutedModelElement>
extends EObjectRectangularResizableContentControllerBase<T> { extends EObjectRectangularResizableContentControllerBase<T> {
/** Constructor. */ /** Constructor. */
public LayoutedRectangularResizableContentController(IContentMVCBundle mvcb, public LayoutedRectangularResizableContentController(IContentMVCBundle mvcb,
......
...@@ -24,28 +24,30 @@ import org.eclipse.emf.ecore.util.EContentAdapter; ...@@ -24,28 +24,30 @@ import org.eclipse.emf.ecore.util.EContentAdapter;
import org.fortiss.tooling.base.model.layout.ILayoutData; import org.fortiss.tooling.base.model.layout.ILayoutData;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement; import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.model.layout.LayoutPackage; import org.fortiss.tooling.base.model.layout.LayoutPackage;
import org.fortiss.tooling.kernel.model.FortissToolingKernelPackage;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
/** /**
* A {@link KernelServiceBasedModelChangeProviderBase} for {@link ILayoutedModelElement}s. * A {@link KernelServiceBasedModelChangeProviderBase} for {@link ILayoutedModelElement}s.
* *
* @author hoelzl * @author hoelzl
*/ */
class LayoutModelChangeProvider class NamedCommentedLayoutModelChangeProvider<T extends INamedCommentedElement & ILayoutedModelElement>
extends KernelServiceBasedModelChangeProviderBase<ILayoutedModelElement> { extends KernelServiceBasedModelChangeProviderBase<T> {
/** The layouted model element. */ /** The layouted model element. */
private final ILayoutedModelElement modelElement; private final T modelElement;
/** The layout EMF notification listener. */ /** The layout EMF notification listener. */
private final LayoutModelElementAdapter notificationListener; private final LayoutModelElementAdapter notificationListener;
/** Constructor. */ /** Constructor. */
public LayoutModelChangeProvider(ILayoutedModelElement modelElement) { public NamedCommentedLayoutModelChangeProvider(T modelElement) {
this.modelElement = modelElement; this.modelElement = modelElement;
this.notificationListener = new LayoutModelElementAdapter(); this.notificationListener = new LayoutModelElementAdapter();
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
protected ILayoutedModelElement getModelElement() { protected T getModelElement() {
return modelElement; return modelElement;
} }
...@@ -78,7 +80,11 @@ class LayoutModelChangeProvider ...@@ -78,7 +80,11 @@ class LayoutModelChangeProvider
Object notifier = notification.getNotifier(); Object notifier = notification.getNotifier();
if(notifier == modelElement) { if(notifier == modelElement) {
Object feature = notification.getFeature(); Object feature = notification.getFeature();
if(feature == LayoutPackage.Literals.ILAYOUTED_MODEL_ELEMENT__LAYOUT_DATA) { if(feature == FortissToolingKernelPackage.Literals.INAMED_ELEMENT__NAME ||
feature == FortissToolingKernelPackage.Literals.INAMED_COMMENTED_ELEMENT__COMMENT) {
addNotification(notification);
return;
} else if(feature == LayoutPackage.Literals.ILAYOUTED_MODEL_ELEMENT__LAYOUT_DATA) {
// self adapt to layout data // self adapt to layout data
super.notifyChanged(notification); super.notifyChanged(notification);
addNotification(notification); addNotification(notification);
......
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