Commit a3f9b764 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

YELLOW: Implement review comments

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

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent 0a0b5ef8
ContextMenuUtil.java 7be87ce47b775d90c533078e22d4d445d9864caf GREEN
EObjectDiagramController.java 61d3c8fddbdc7b128e6c2bea657f3effd3d78edc RED
EObjectDiagramController.java 66b14c1c77953cad7caecae1e04f455958943f28 YELLOW
EObjectModelChangeProvider.java f4b60cebb088a5c81ca92a41614e1a5d40030502 GREEN
EObjectRectangularResizableContentControllerBase.java b2a2751705ad0832117b8926d88826846d46b82e GREEN
EObjectRectangularResizableContentControllerBase.java 787a540213f29e8daaecd9afe98af8b3f4088db7 YELLOW
KernelServiceBasedModelChangeProviderBase.java 18e48f17ea8dfba90de024a8959fc5a4b0d05d45 GREEN
LayoutModelChangeProvider.java b5449d02eaf39086909720c43e21bd061005fc9e GREEN
LayoutedContentAnchorageController.java 70e5960964ba505f28df6df8db52f2d17231b223 GREEN
LayoutedDiagramAnchorageController.java 898ad367bea8889c26e5bbfa050048382cb0b7f0 GREEN
LayoutedLinkBendPointController.java 475af314d4f4524ebdefb64e1914d1dfd471df85 GREEN
LayoutedRectangularResizableContentController.java aebb2c0de11e90d16f40bcbf346112a9d792bdf9 GREEN
LayoutedContentAnchorageController.java 3794b41d76e9ce14ead0bd812cde5c1a6d348d5c YELLOW
LayoutedDiagramAnchorageController.java 1e1ac7c5fa26c632736f5023e90f05d09bc0710d YELLOW
LayoutedLinkBendPointController.java a8372485ae96f2abf773d1baeb1f8c7b2b25985f YELLOW
LayoutedRectangularResizableContentController.java 1e18af3ee10dd3754325ed389fed664da65a0b61 YELLOW
......@@ -14,6 +14,7 @@
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.lang.Math.max;
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;
......@@ -47,13 +48,7 @@ public class EObjectDiagramController<T extends EObject> extends ControllerBase
/** Constructor. */
public EObjectDiagramController(IMVCBundle mvcb, Class<T> modelType) {
super(mvcb);
// TODO (TM): Replace lines 51-54 with
// Object model = requireNonNull(mvcb.getModel(), "The given model is null!")
// Should be applied in other classes as well.
Object model = mvcb.getModel();
if(model == null) {
throw new IllegalArgumentException("The given model is null!");
}
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());
......
......@@ -14,6 +14,7 @@
package org.fortiss.tooling.base.ui.editor.fx.controller;
import static java.lang.Math.max;
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;
......@@ -91,10 +92,7 @@ public abstract class EObjectRectangularResizableContentControllerBase<T extends
Class<T> modelType) {
super(mvcb);
Object model = mvcb.getModel();
if(model == null) {
throw new IllegalArgumentException("The given model is null!");
}
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());
......
......@@ -13,6 +13,7 @@
*******************************************************************************/
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;
......@@ -40,14 +41,10 @@ public class LayoutedContentAnchorageController<T extends ILayoutedModelElement>
private final LayoutModelChangeProvider layoutModelChangeProvider;
/** Constructor. */
public LayoutedContentAnchorageController(IContentAnchorageMVCBundle mvcb,
Class<T> modelType) {
public LayoutedContentAnchorageController(IContentAnchorageMVCBundle mvcb, Class<T> modelType) {
super(mvcb);
Object model = mvcb.getModel();
if(model == null) {
throw new IllegalArgumentException("The given model is null!");
}
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());
......
......@@ -13,6 +13,7 @@
*******************************************************************************/
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;
......@@ -40,14 +41,10 @@ public class LayoutedDiagramAnchorageController<T extends ILayoutedModelElement>
private final LayoutModelChangeProvider layoutModelChangeProvider;
/** Constructor. */
public LayoutedDiagramAnchorageController(IMVCBundle mvcb,
Class<T> modelType) {
public LayoutedDiagramAnchorageController(IMVCBundle mvcb, Class<T> modelType) {
super(mvcb);
Object model = mvcb.getModel();
if(model == null) {
throw new IllegalArgumentException("The given model is null!");
}
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());
......
......@@ -13,6 +13,7 @@
*******************************************************************************/
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;
......@@ -43,14 +44,10 @@ public class LayoutedLinkBendPointController<T extends ILayoutedModelElement>
private final LayoutModelChangeProvider layoutModelChangeProvider;
/** Constructor. */
public LayoutedLinkBendPointController(ILinkMVCBundle mvcb,
Class<T> modelType) {
public LayoutedLinkBendPointController(ILinkMVCBundle mvcb, Class<T> modelType) {
super(mvcb);
Object model = mvcb.getModel();
if(model == null) {
throw new IllegalArgumentException("The given model is null!");
}
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());
......
......@@ -15,6 +15,7 @@
+--------------------------------------------------------------------------*/
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;
......@@ -43,6 +44,12 @@ public class LayoutedRectangularResizableContentController<T extends ILayoutedMo
public LayoutedRectangularResizableContentController(IContentMVCBundle mvcb,
Class<T> modelType) {
super(mvcb, modelType);
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());
}
}
/** {@inheritDoc} */
......
CoordinateCorrections.java c5cc475b45de38c56fc2e888a2d3093cd2efb52a GREEN
LayoutedCircularAnchorageContentVisualBase.java 2aa292444671bf644e37bc923b877c92de0235b1 GREEN
LayoutedCircularAnchorageDiagramVisualBase.java f06e3b908020408e3cd268a3c63edcd75ef74f8b GREEN
LayoutedLineLinkVisual.java 35740b4b5d08a6378086abf43682c66a8e471002 RED
LayoutedLineLinkVisual.java feea85e0bd288590fbe06c152a8a8b138ea85ca2 YELLOW
LayoutedRectangularContentVisualBase.java c2a3937b99284713e0bbcd3ce458874567b25ac5 GREEN
NamedLayoutedCircularAnchorageContentVisual.java c680002469ce897679fa5a3f4af51d1b19cb53d6 GREEN
NamedLayoutedCircularAnchorageDiagramVisual.java 714a176a0569a2049efb4009f710ca66bf3a57fb GREEN
NamedLayoutedLineLinkVisual.java e66e5b2aaa40fe8b22a292e175bb8f3af4539b9d RED
NamedLayoutedLineLinkVisual.java e66e5b2aaa40fe8b22a292e175bb8f3af4539b9d YELLOW
NamedLayoutedRectangularContentVisual.java 122e193ac587857d1dad23b42583a0bcf465f0d0 GREEN
......@@ -27,7 +27,6 @@ import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.rectangular
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.kernel.model.INamedElement;
import javafx.geometry.Rectangle2D;
......@@ -40,7 +39,7 @@ import javafx.geometry.Rectangle2D;
// TODO (TM): As this class already requires the generic type to implement INamedElement
// NamedLayoutedLineLinkVisual becomes useless. Remove INamedElement here and make class
// abstract (consistent with the other Layouted*VisualBase classes)
public class LayoutedLineLinkVisual<T extends ILayoutedModelElement & INamedElement>
public abstract class LayoutedLineLinkVisual<T extends ILayoutedModelElement>
extends LineLinkVisualBase {
/** Constructor. */
......@@ -121,13 +120,4 @@ public class LayoutedLineLinkVisual<T extends ILayoutedModelElement & INamedElem
protected double getInvisibleSelectionLineWidth() {
return 3;
}
/** {@inheritDoc} */
@Override
protected String getLabelText(int currentSegment, int lastSegment) {
if(currentSegment == 0) {
return getModelElement().getName();
}
return null;
}
}
Supports Markdown
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