Commit 6602e8bb authored by Alexander Diewald's avatar Alexander Diewald
Browse files

JFX visuals: Separate layouted and named rectangulars

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

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent dc73c53d
......@@ -2,7 +2,8 @@ CoordinateCorrections.java c5cc475b45de38c56fc2e888a2d3093cd2efb52a YELLOW
LayoutedCircularContentAnchorageVisualBase.java 4c3ee2d3c00f3b04c0824330fa5c5aeaeb91da2f YELLOW
LayoutedCircularDiagramAnchorageVisualBase.java dff18208ffd98682dca49c061361550d310bdf76 YELLOW
LayoutedLineLinkVisual.java 634c6ceeab057afc5da0924f227375785836b179 YELLOW
LayoutedRectangularContentVisualBase.java 8618a2fb836c0289df2a3a3a7b06d4648c255de3 YELLOW
LayoutedRectangularContentVisualBase.java c2a3937b99284713e0bbcd3ce458874567b25ac5 YELLOW
NamedLayoutedConnectorContentVisual.java 087280aba1c523f5055bccad5cd4acde37abd7b9 YELLOW
NamedLayoutedConnectorDiagramVisual.java 9fcf3825f7cfcdd5dafb58f9c53ad99fa9c0f381 YELLOW
NamedLayoutedLinkVisual.java 92ce828c82e3a231b8f6e153d39bc77f396118fa YELLOW
NamedLayoutedRectengularContentVisual.java 8d5428bdf53d50c604a2af5d6161a1a7a627250b YELLOW
......@@ -28,7 +28,6 @@ import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.rectangular
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.rectangular.RectangularContentVisualBase;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.model.layout.Rectangle;
import org.fortiss.tooling.kernel.model.INamedElement;
import javafx.geometry.Dimension2D;
import javafx.geometry.Rectangle2D;
......@@ -40,7 +39,7 @@ import javafx.geometry.Side;
*
* @author munaro
*/
public abstract class LayoutedRectangularContentVisualBase<T extends ILayoutedModelElement & INamedElement>
public abstract class LayoutedRectangularContentVisualBase<T extends ILayoutedModelElement>
extends RectangularContentVisualBase {
/** Constructor. */
......@@ -58,6 +57,14 @@ public abstract class LayoutedRectangularContentVisualBase<T extends ILayoutedMo
}
}
/** Returns the model element with the specified type. */
// TODO(#3877): Move type checks to a common base class.
@SuppressWarnings("unchecked")
protected T getModelElement() {
// Safe wild cast due to type check in constructor
return (T)getModel();
}
/** {@inheritDoc} */
@Override
public Rectangle2D getModelBounds() {
......@@ -107,18 +114,4 @@ public abstract class LayoutedRectangularContentVisualBase<T extends ILayoutedMo
protected boolean requireSelectionForResizeGesture() {
return false;
}
/** Return the {@link ILayoutedModelElement}. */
// TODO(#3877): Move type checks to a common base class.
@SuppressWarnings("unchecked")
protected T getModelElement() {
// Safe wild cast due to type check in constructor
return (T)getModel();
}
/** {@inheritDoc} */
@Override
protected String getName() {
return getModelElement().getName();
}
}
/*-------------------------------------------------------------------------+
| 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.visual;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.kernel.model.INamedElement;
/**
* {@link LayoutedRectangularContentVisualBase} that defines its name.
*
* @author diewald
*/
public class NamedLayoutedRectengularContentVisual<T extends INamedElement & ILayoutedModelElement>
extends LayoutedRectangularContentVisualBase<T> {
/** Constructor. */
public NamedLayoutedRectengularContentVisual(IContentMVCBundle mvcb, Class<T> modelType) {
super(mvcb, modelType);
}
/** {@inheritDoc} */
@Override
protected String getName() {
return getModelElement().getName();
}
}
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