Commit 6bf4c995 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

JFX GenericPlatform: Adapt to new base classes

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

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent 090e5e91
......@@ -15,7 +15,6 @@ Bundle-Vendor: fortiss GmbH
Export-Package: org.fortiss.af3.platform.ui,
org.fortiss.af3.platform.ui.editor,
org.fortiss.af3.platform.ui.editor.fx,
org.fortiss.af3.platform.ui.editor.fx.controller,
org.fortiss.af3.platform.ui.editor.fx.visual,
org.fortiss.af3.platform.ui.editpart,
org.fortiss.af3.platform.ui.editpart.generic,
......
ControllerFactory.java d8e4cbbe87ef0fd48aa69c07149e11c7d797ef8c GREEN
ControllerFactory.java cde934400d374918e92d284a962b39577018d7ea YELLOW
GenericConnectorController.java e74ecc9cd7215c58200e804562991659862924d0 YELLOW
ModelFactory.java e6da34b65eb552fb146cee9cce04f6c02361bf72 GREEN
PlatformArchitectureFXEditor.java ac4a1033ad9682c664c82182cb6fbf09d5646f5d GREEN
PlatformArchitectureFXEditorBinding.java ea41c84736bee613f92c4a05b571a7838c4445d5 GREEN
VisualFactory.java f2764a48b36e55a4ae374ea23cffa46b2d4ba505 GREEN
VisualFactory.java 35bd0d4bdf576b5cdd3f993546bb8cbe5eb224f6 YELLOW
......@@ -22,10 +22,12 @@ import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBun
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IDiagramAnchorageMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IDiagramMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.af3.platform.ui.editor.fx.controller.DiagramController;
import org.fortiss.af3.platform.ui.editor.fx.controller.GenericConnectionController;
import org.fortiss.af3.platform.ui.editor.fx.controller.GenericConnectorController;
import org.fortiss.af3.platform.ui.editor.fx.controller.GenericUnitController;
import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.af3.platform.model.TransmissionConnection;
import org.fortiss.af3.platform.model.generic.GenericExecutionUnit;
import org.fortiss.tooling.base.ui.editor.fx.controller.EObjectDiagramController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedLinkBendPointController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedRectangularResizableContentController;
/**
* The implementation of the {@link IControllerFactory} for the platform architecture editor.
......@@ -37,7 +39,8 @@ public class ControllerFactory implements IControllerFactory {
/** {@inheritDoc} */
@Override
public IController createContentController(IContentMVCBundle model) {
return new GenericUnitController(model);
return new LayoutedRectangularResizableContentController<>(model,
GenericExecutionUnit.class);
}
/** {@inheritDoc} */
......@@ -55,12 +58,12 @@ public class ControllerFactory implements IControllerFactory {
/** {@inheritDoc} */
@Override
public IController createLinkController(ILinkMVCBundle modelBundle) {
return new GenericConnectionController(modelBundle);
return new LayoutedLinkBendPointController<>(modelBundle, TransmissionConnection.class);
}
/** {@inheritDoc} */
@Override
public IController createDiagramController(IDiagramMVCBundle diagramBundle) {
return new DiagramController(diagramBundle);
return new EObjectDiagramController<>(diagramBundle, IPlatformArchitectureElement.class);
}
}
......@@ -13,16 +13,17 @@
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.ui.editor.fx.controller;
package org.fortiss.af3.platform.ui.editor.fx;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.fortiss.af3.platform.model.PlatformConnectorUnit;
import org.fortiss.af3.platform.model.generic.GenericExecutionUnit;
import org.fortiss.af3.platform.model.generic.GenericReceiver;
import org.fortiss.af3.platform.model.generic.GenericTransceiver;
import org.fortiss.af3.platform.model.generic.GenericTransmissionUnit;
import org.fortiss.af3.platform.model.generic.GenericTransmitter;
import org.fortiss.tooling.base.ui.editor.fx.LayoutedModelElementBasedContentAnchorageController;
import org.fortiss.tooling.base.ui.editor.fx.controller.LayoutedContentAnchorageController;
/**
* {@link IController} for connectors on {@link GenericExecutionUnit}s and
......@@ -31,16 +32,18 @@ import org.fortiss.tooling.base.ui.editor.fx.LayoutedModelElementBasedContentAnc
* @author ponce
*/
public class GenericConnectorController
extends LayoutedModelElementBasedContentAnchorageController {
extends LayoutedContentAnchorageController<PlatformConnectorUnit> {
/** Constructor. */
public GenericConnectorController(IContentAnchorageMVCBundle mvcb) {
super(mvcb);
super(mvcb, PlatformConnectorUnit.class);
Object model = mvcb.getModel();
if(!(model instanceof GenericReceiver || model instanceof GenericTransmitter ||
model instanceof GenericTransceiver)) {
throw new IllegalArgumentException(
"Expected model of type GenericReceiver, GenericTransmitter or GenericTransceiver, but was " +
"Expected model of type " + GenericReceiver.class.getSimpleName() + ", " +
GenericTransmitter.class.getSimpleName() + " or " +
GenericTransceiver.class.getSimpleName() + ", but was " +
model.getClass().getSimpleName());
}
}
......
......@@ -30,7 +30,7 @@ import org.fortiss.af3.platform.model.generic.GenericReceiver;
import org.fortiss.af3.platform.model.generic.GenericTransceiver;
import org.fortiss.af3.platform.model.generic.GenericTransmissionUnit;
import org.fortiss.af3.platform.model.generic.GenericTransmitter;
import org.fortiss.af3.platform.ui.editor.fx.visual.GenericConnectionVisual;
import org.fortiss.af3.platform.ui.editor.fx.visual.TransmissionConnectionVisual;
import org.fortiss.af3.platform.ui.editor.fx.visual.GenericExecutionUnitVisual;
import org.fortiss.af3.platform.ui.editor.fx.visual.GenericReceiverVisual;
import org.fortiss.af3.platform.ui.editor.fx.visual.GenericTransceiverVisual;
......@@ -86,7 +86,7 @@ public class VisualFactory implements IVisualFactory {
public ILinkVisual createLinkVisual(ILinkMVCBundle modelBundle) {
Object modelObj = modelBundle.getModel();
if(modelObj instanceof TransmissionConnection) {
return new GenericConnectionVisual(modelBundle);
return new TransmissionConnectionVisual(modelBundle);
}
return null;
}
......
DiagramController.java 2d2a546cd1bac9d556fdbe156228983faf8218fd GREEN
GenericConnectionController.java f2bc1babff90fa730d594b7b7d18d90920731e06 GREEN
GenericConnectorController.java e6d50b3177381c56ac2a7e131cfc15b5510b30a1 GREEN
GenericUnitController.java 1db566fc925051264970183427d23bf18f06f581 GREEN
/*-------------------------------------------------------------------------+
| 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.af3.platform.ui.editor.fx.controller;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IMVCBundle;
import org.fortiss.tooling.base.ui.editor.fx.EObjectBasedDiagramControllerBase;
/**
* {@link IController} for the diagram model element.
*
* @author ponce
*/
public class DiagramController extends EObjectBasedDiagramControllerBase {
/** Constructor. */
public DiagramController(IMVCBundle mvcb) {
super(mvcb);
}
}
/*-------------------------------------------------------------------------+
| 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.af3.platform.ui.editor.fx.controller;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.controller.IController;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.af3.platform.model.TransmissionConnection;
import org.fortiss.tooling.base.ui.editor.fx.LayoutedModelElementBasedLinkBendPointController;
/**
* {@link IController} for {@link TransmissionConnection}s.
*
* @author ponce
*/
public class GenericConnectionController extends LayoutedModelElementBasedLinkBendPointController {
/** Constructor. */
public GenericConnectionController(ILinkMVCBundle mvcb) {
super(mvcb);
Object model = mvcb.getModel();
if(!(model instanceof TransmissionConnection)) {
throw new IllegalArgumentException(
"Expected model of type TransmissionConnection, but was " +
model.getClass().getSimpleName());
}
}
}
/*-------------------------------------------------------------------------+
| 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.af3.platform.ui.editor.fx.controller;
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.af3.platform.model.generic.GenericExecutionUnit;
import org.fortiss.af3.platform.model.generic.GenericTransmissionUnit;
import org.fortiss.tooling.base.model.layout.Dimension;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.ui.editor.fx.EObjectBasedRectangularResizableContentControllerBase;
import javafx.geometry.Dimension2D;
import javafx.geometry.Side;
/**
* {@link IController} for {@link GenericExecutionUnit}s and {@link GenericTransmissionUnit}s
* displayed in the diagram.
*
* @author ponce
*/
public final class GenericUnitController
extends EObjectBasedRectangularResizableContentControllerBase {
/** Constructor. */
public GenericUnitController(IContentMVCBundle mvcb) {
super(mvcb);
Object model = mvcb.getModel();
if(!(model instanceof GenericExecutionUnit || model instanceof GenericTransmissionUnit)) {
throw new IllegalArgumentException(
"Expected model of type GenericExecutionUnit or GenericTransmissionUnit, but was " +
model.getClass().getSimpleName());
}
}
/** Returns the mode ILayoutedModelElement. */
private ILayoutedModelElement getElement() {
// wild cast works: see constructor
return (ILayoutedModelElement)getModel();
}
/** {@inheritDoc} */
@Override
protected void moveAnchorageToSideOffset(IContentAnchorageMVCBundle anchorage, Side side,
double offset) {
Object obj = anchorage.getModel();
if(obj instanceof ILayoutedModelElement) {
ILayoutedModelElement elem = (ILayoutedModelElement)obj;
Dimension2D portDim = anchorage.getVisual().getDimensions();
int correction;
if(side == Side.TOP || side == Side.BOTTOM) {
correction = (int)portDim.getWidth() / 2;
} else {
correction = (int)portDim.getHeight() / 2;
}
int corrected = (int)offset + correction;
setStickyConnectorLayoutData(elem, convertSideToEOrientation(side), corrected);
}
}
/** {@inheritDoc} */
@Override
protected void move(FeedbackChange deltaChange) {
moveNode(getElement(), (int)deltaChange.getDeltaX(), (int)deltaChange.getDeltaY());
}
/** {@inheritDoc} */
@Override
protected void resize(FeedbackChange delta) {
ILayoutedModelElement model = getElement();
Dimension d = getNodeSize(model);
int w = d.getWidth() + (int)delta.getDeltaW();
int h = d.getHeight() + (int)delta.getDeltaH();
setNodeSize(model, w, h);
}
/** {@inheritDoc} */
@Override
protected boolean allowLink() {
return false;
}
}
GenericConnectionVisual.java 71125c8dd5d7756626bc0f54818eaa11d2cb695c GREEN
GenericExecutionUnitVisual.java 1dba1fd343e401f4349d220f9186890f2cb63c44 GREEN
GenericReceiverVisual.java 963c9f2a126fd53202e9406c4124631af21bc529 GREEN
GenericTransceiverVisual.java 8fbc064d8acc6a96e786a70cba5098592b9b5a5a GREEN
GenericTransmissionUnitVisual.java 804b9cc0b3ffafba1cfaa06fa7f71823708d8931 GREEN
GenericTransmitterVisual.java baac0dadc8f64487e3de6c0df53dffaf8b3b59a4 GREEN
GenericExecutionUnitVisual.java 04b3a21ca624cf718d91c90a0244b7774fa1c619 YELLOW
GenericReceiverVisual.java cb754bdb60a580260fa1e65651fec917b27e1902 YELLOW
GenericTransceiverVisual.java 7e125103a273dac6223a5dc6aef2a011797b5f1a YELLOW
GenericTransmissionUnitVisual.java d00e4d995099d9258e69c8a4508a1597a34cd20f YELLOW
GenericTransmitterVisual.java 7f9dc77732064645993b2abfe0997ab6c8c2e554 YELLOW
TransmissionConnectionVisual.java 2f938382acff938e251e3320ed998b06d9f86ae2 YELLOW
......@@ -17,6 +17,7 @@ package org.fortiss.af3.platform.ui.editor.fx.visual;
import static javafx.scene.paint.Color.BLACK;
import static javafx.scene.text.TextAlignment.CENTER;
import static org.fortiss.af3.platform.ui.AF3PlatformUIActivator.PLUGIN_ID;
import static org.fortiss.af3.platform.ui.DefaultStyle.EU_BACKGROUND;
import static org.fortiss.af3.platform.ui.DefaultStyle.EU_FOREGROUND;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.convertColor;
......@@ -25,8 +26,7 @@ import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getFXImage;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.af3.platform.model.generic.GenericExecutionUnit;
import org.fortiss.af3.platform.ui.AF3PlatformUIActivator;
import org.fortiss.tooling.base.ui.editor.fx.visuals.LayoutedRectangularContentVisualBase;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedRectangularContentVisual;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
......@@ -38,10 +38,9 @@ import javafx.scene.text.TextAlignment;
*
* @author ponce
*/
public final class GenericExecutionUnitVisual extends LayoutedRectangularContentVisualBase {
public final class GenericExecutionUnitVisual
extends NamedLayoutedRectangularContentVisual<GenericExecutionUnit> {
/** The plug-in ID. */
public static final String PLUGIN_ID = AF3PlatformUIActivator.class.getPackage().getName();
/** The icon image. */
private static final Image ICON = getFXImage(PLUGIN_ID, "/icons/unknown.png");
/** The fill color used by GenericExecutionUnits. */
......@@ -51,13 +50,7 @@ public final class GenericExecutionUnitVisual extends LayoutedRectangularContent
/** Constructor. */
public GenericExecutionUnitVisual(IContentMVCBundle mvcb) {
super(mvcb);
Object model = mvcb.getModel();
if(!(model instanceof GenericExecutionUnit)) {
throw new IllegalArgumentException(
"Expected model of type GenericExecutionUnit, but was " +
model.getClass().getSimpleName());
}
super(mvcb, GenericExecutionUnit.class);
}
/** {@inheritDoc} */
......@@ -89,11 +82,4 @@ public final class GenericExecutionUnitVisual extends LayoutedRectangularContent
protected Image getIcon() {
return ICON;
}
/** {@inheritDoc} */
@Override
protected String getName() {
// wild cast works: see constructor
return ((GenericExecutionUnit)getModel()).getName();
}
}
......@@ -20,7 +20,7 @@ import static javafx.scene.paint.Color.WHITE;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.af3.platform.model.generic.GenericReceiver;
import org.fortiss.tooling.base.ui.editor.fx.visuals.LayoutedCircularContentAnchorageVisualBase;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedCircularAnchorageContentVisual;
import javafx.scene.paint.Paint;
......@@ -29,16 +29,12 @@ import javafx.scene.paint.Paint;
*
* @author ponce
*/
public class GenericReceiverVisual extends LayoutedCircularContentAnchorageVisualBase {
public class GenericReceiverVisual
extends NamedLayoutedCircularAnchorageContentVisual<GenericReceiver> {
/** Constructor. */
public GenericReceiverVisual(IContentAnchorageMVCBundle mvcb) {
super(mvcb);
Object model = mvcb.getModel();
if(!(model instanceof GenericReceiver)) {
throw new IllegalArgumentException("Expected model of type GenericReceiver, but was " +
model.getClass().getSimpleName());
}
super(mvcb, GenericReceiver.class);
}
/** {@inheritDoc} */
......@@ -46,11 +42,4 @@ public class GenericReceiverVisual extends LayoutedCircularContentAnchorageVisua
protected Paint getFillColor() {
return WHITE;
}
/** {@inheritDoc} */
@Override
protected String getHoverText() {
// wild cast works: see constructor
return ((GenericReceiver)getModel()).getName();
}
}
......@@ -22,7 +22,7 @@ import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchor
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.af3.platform.model.generic.GenericExecutionUnit;
import org.fortiss.af3.platform.model.generic.GenericTransceiver;
import org.fortiss.tooling.base.ui.editor.fx.visuals.LayoutedCircularContentAnchorageVisualBase;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedCircularAnchorageContentVisual;
import javafx.scene.paint.Paint;
......@@ -31,38 +31,21 @@ import javafx.scene.paint.Paint;
*
* @author ponce
*/
public class GenericTransceiverVisual extends LayoutedCircularContentAnchorageVisualBase {
public class GenericTransceiverVisual
extends NamedLayoutedCircularAnchorageContentVisual<GenericTransceiver> {
/** Constructor. */
public GenericTransceiverVisual(IContentAnchorageMVCBundle mvcb) {
super(mvcb);
Object model = mvcb.getModel();
if(!(model instanceof GenericTransceiver)) {
throw new IllegalArgumentException(
"Expected model of type GenericTransceiver, but was " +
model.getClass().getSimpleName());
}
}
/** Returns the GenericTransceiver model element. */
private GenericTransceiver getTransceiver() {
// wild cast works: see constructor
return (GenericTransceiver)getModel();
super(mvcb, GenericTransceiver.class);
}
/** {@inheritDoc} */
@Override
protected Paint getFillColor() {
Object parent = getTransceiver().getOwner();
Object parent = getModelElement().getOwner();
if(parent instanceof GenericExecutionUnit) {
return BLACK;
}
return WHITE;
}
/** {@inheritDoc} */
@Override
protected String getHoverText() {
return getTransceiver().getName();
}
}
......@@ -17,6 +17,7 @@ package org.fortiss.af3.platform.ui.editor.fx.visual;
import static javafx.scene.paint.Color.BLACK;
import static javafx.scene.text.TextAlignment.CENTER;
import static org.fortiss.af3.platform.ui.AF3PlatformUIActivator.PLUGIN_ID;
import static org.fortiss.af3.platform.ui.DefaultStyle.EU_BACKGROUND;
import static org.fortiss.af3.platform.ui.DefaultStyle.EU_FOREGROUND;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.convertColor;
......@@ -25,8 +26,7 @@ import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getFXImage;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.af3.platform.model.generic.GenericTransmissionUnit;
import org.fortiss.af3.platform.ui.AF3PlatformUIActivator;
import org.fortiss.tooling.base.ui.editor.fx.visuals.LayoutedRectangularContentVisualBase;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedRectangularContentVisual;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
......@@ -38,10 +38,8 @@ import javafx.scene.text.TextAlignment;
*
* @author ponce
*/
public final class GenericTransmissionUnitVisual extends LayoutedRectangularContentVisualBase {
/** The plug-in ID. */
public static final String PLUGIN_ID = AF3PlatformUIActivator.class.getPackage().getName();
public final class GenericTransmissionUnitVisual
extends NamedLayoutedRectangularContentVisual<GenericTransmissionUnit> {
/** The icon image. */
private static final Image ICON = getFXImage(PLUGIN_ID, "/icons/unknown.png");
/** The fill color used by GenericTransmissionUnitVisual. */
......@@ -51,13 +49,7 @@ public final class GenericTransmissionUnitVisual extends LayoutedRectangularCont
/** Constructor. */
public GenericTransmissionUnitVisual(IContentMVCBundle mvcb) {
super(mvcb);
Object model = mvcb.getModel();
if(!(model instanceof GenericTransmissionUnit)) {
throw new IllegalArgumentException(
"Expected model of type GenericTransmissionUnitVisual, but was " +
model.getClass().getSimpleName());
}
super(mvcb, GenericTransmissionUnit.class);
}
/** {@inheritDoc} */
......@@ -89,11 +81,4 @@ public final class GenericTransmissionUnitVisual extends LayoutedRectangularCont
protected Image getIcon() {
return ICON;
}
/** {@inheritDoc} */
@Override
protected String getName() {
// wild cast works: see constructor
return ((GenericTransmissionUnit)getModel()).getName();
}
}
......@@ -20,7 +20,7 @@ import static javafx.scene.paint.Color.BLACK;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.af3.platform.model.generic.GenericTransmitter;
import org.fortiss.tooling.base.ui.editor.fx.visuals.LayoutedCircularContentAnchorageVisualBase;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedCircularAnchorageContentVisual;
import javafx.scene.paint.Paint;
......@@ -29,17 +29,12 @@ import javafx.scene.paint.Paint;
*
* @author ponce
*/
public class GenericTransmitterVisual extends LayoutedCircularContentAnchorageVisualBase {
public class GenericTransmitterVisual
extends NamedLayoutedCircularAnchorageContentVisual<GenericTransmitter> {
/** Constructor. */
public GenericTransmitterVisual(IContentAnchorageMVCBundle mvcb) {
super(mvcb);
Object model = mvcb.getModel();
if(!(model instanceof GenericTransmitter)) {
throw new IllegalArgumentException(
"Expected model of type GenericTransmitter, but was " +
model.getClass().getSimpleName());
}
super(mvcb, GenericTransmitter.class);
}
/** {@inheritDoc} */
......@@ -47,11 +42,4 @@ public class GenericTransmitterVisual extends LayoutedCircularContentAnchorageVi
protected Paint getFillColor() {
return BLACK;
}
/** {@inheritDoc} */