Commit a959286b authored by Alexander Diewald's avatar Alexander Diewald

Merge remote-tracking branch 'origin/master' into 3962

Conflicts:
	org.fortiss.af3.mode.ui/src/org/fortiss/af3/mode/ui/editor/fx/.ratings
Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parents 677b3119 a680ae4a
ComponentControllerFactory.java 57c48af3d6c2d51a9040a8b754a8b19b73525777 GREEN
ComponentModelFactory.java 9141373b9498b8e947ef1ca8921128bdf66ec308 GREEN
ComponentStructureFXEditor.java 2d7c0f40fffb4cfb918b60da5de3d5fc0c067916 GREEN
ComponentStructureFXEditor.java c9016fd1b30ee8ed98cace186615c03ccb894abc GREEN
ComponentStructureFXEditorBinding.java 19ca73be6a4ea974994d26db537329878748b20d GREEN
ComponentVisualFactory.java 5422167d12bb5553ed816363d41e0288fe481056 GREEN
ComponentVisualFactory.java c784b5e87c08abc9a3e201c11bc08b93fce20f6a GREEN
......@@ -18,10 +18,10 @@ package org.fortiss.af3.component.ui.editor.fx;
import static javafx.scene.paint.Color.LIGHTGRAY;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.fortiss.tooling.kernel.ui.extension.base.LWFXEFEditorBase;
import javafx.geometry.Dimension2D;
......
......@@ -15,6 +15,13 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.editor.fx;
import org.fortiss.af3.component.model.Channel;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.Port;
import org.fortiss.af3.component.ui.editor.fx.visual.ChannelVisual;
import org.fortiss.af3.component.ui.editor.fx.visual.ContentComponentPortVisual;
import org.fortiss.af3.component.ui.editor.fx.visual.ContentComponentVisual;
import org.fortiss.af3.component.ui.editor.fx.visual.DiagramComponentPortVisual;
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.IDiagramAnchorageMVCBundle;
......@@ -24,13 +31,6 @@ import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IDiagramAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.ILinkVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IVisualFactory;
import org.fortiss.af3.component.model.Channel;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.Port;
import org.fortiss.af3.component.ui.editor.fx.visual.ContentComponentPortVisual;
import org.fortiss.af3.component.ui.editor.fx.visual.ContentComponentVisual;
import org.fortiss.af3.component.ui.editor.fx.visual.DiagramComponentPortVisual;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedLineLinkVisual;
/**
* The implementation of the {@link IVisualFactory} for the component editor.
......@@ -76,7 +76,7 @@ public final class ComponentVisualFactory implements IVisualFactory {
public ILinkVisual createLinkVisual(ILinkMVCBundle modelBundle) {
Object linkObj = modelBundle.getModel();
if(linkObj instanceof Channel) {
return new NamedLayoutedLineLinkVisual<>(modelBundle, Channel.class);
return new ChannelVisual(modelBundle);
}
return null;
}
......
ChannelVisual.java 3cdee0047f9ee3f9414488551d471b2e9f74ad67 GREEN
ContentComponentPortVisual.java 6e398120650316a0649173efd70c508efd3b5d09 GREEN
ContentComponentVisual.java 1343052af19542e4860043c0bcfb2b3e997d0422 GREEN
ContentComponentVisual.java 78fb7e6210f1d3fc37b869c18b11f37e73daec04 GREEN
DiagramComponentPortVisual.java 918915c5801064ebfb2bb6028f4e588256b1aefe GREEN
/*-------------------------------------------------------------------------+
| Copyright 2020 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.component.ui.editor.fx.visual;
import static javafx.scene.control.Tooltip.install;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getFXImage;
import java.util.Collection;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.component.model.Channel;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedLineLinkVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramCoordinate;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramLayers;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IVisual;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity;
import org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator;
import org.fortiss.tooling.kernel.ui.service.IMarkerService;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
/**
* {@link IVisual} for {@link Channel}.
*
* @author hoelzl
*/
public class ChannelVisual extends NamedLayoutedLineLinkVisual<Channel> {
/** The label to show errors/warnings. */
private Label errorWarning = null;
/** Constructor. */
public ChannelVisual(ILinkMVCBundle mvcb) {
super(mvcb, Channel.class);
}
/** {@inheritDoc} */
@Override
public void updateNodes(DiagramLayers layers) {
super.updateNodes(layers);
if(errorWarning != null) {
layers.getVisualFeedbackLayer().remove(errorWarning);
errorWarning = null;
}
IMarkerService markerService = IMarkerService.getInstance();
Channel modelElement = getModelElement();
ESeverity highest = markerService.getHighestViolationSeverity(modelElement);
if(highest == null) {
return;
}
if(highest != ESeverity.ERROR && highest != ESeverity.WARNING) {
return;
}
Collection<IConstraintViolation<? extends EObject>> violations =
markerService.getAllViolationsWithSeverity(highest);
if(violations.isEmpty()) { // sanity check: never true, since highest != null
return;
}
String imgFile = (highest == ESeverity.WARNING) ? "warning.png" : "error.png";
Image img = getFXImage(ToolingKernelUIActivator.PLUGIN_ID, "icons/" + imgFile);
errorWarning = new Label("");
errorWarning.setGraphic(new ImageView(img));
DiagramCoordinate sp = getStartAnchorPoint();
DiagramCoordinate ep = getEndAnchorPoint();
if(getNumberOfBendPoints() > 0) {
ep = getBendPointLocation(0);
}
double x = sp.getX() + (ep.getX() - sp.getX()) / 2;
double y = sp.getY() + (ep.getY() - sp.getY()) / 2 - img.getHeight();
errorWarning.setTranslateX(x);
errorWarning.setTranslateY(y);
layers.getVisualFeedbackLayer().add(errorWarning, getMVCBundle());
// unset mouse listeners to make tooltip work
errorWarning.setOnMouseEntered(null);
errorWarning.setOnMouseExited(null);
Tooltip tooltip = new Tooltip(violations.iterator().next().getExplanation());
tooltip.setGraphic(new ImageView(img));
install(errorWarning, tooltip);
}
}
......@@ -15,19 +15,31 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.editor.fx.visual;
import static javafx.scene.control.Tooltip.install;
import static javafx.scene.control.Tooltip.uninstall;
import static org.fortiss.af3.component.ui.DefaultStyle.STRONGLY_CAUSAL_COMPONENT_BACKGROUND;
import static org.fortiss.af3.component.ui.DefaultStyle.SUBSTRUCTURE_COMPONENT_BACKGROUND;
import static org.fortiss.af3.component.ui.DefaultStyle.WEAKLY_CAUSAL_COMPONENT_BACKGROUND;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.convertColor;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getFXImage;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentVisual;
import java.util.Collection;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.ui.AF3ComponentUIActivator;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedRectangularContentVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramLayers;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity;
import org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator;
import org.fortiss.tooling.kernel.ui.service.IMarkerService;
import javafx.scene.control.Tooltip;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
......@@ -53,11 +65,44 @@ public final class ContentComponentVisual extends NamedLayoutedRectangularConten
private static final Color WEAKLY_CAUSAL_COLOR =
convertColor(WEAKLY_CAUSAL_COMPONENT_BACKGROUND);
/** Stores the last tooltip for uninstalling */
private Tooltip tooltip;
/** Constructor. */
public ContentComponentVisual(IContentMVCBundle mvcb) {
super(mvcb, Component.class);
}
/** {@inheritDoc} */
@Override
public void updateNodes(DiagramLayers layers) {
super.updateNodes(layers);
IMarkerService markerService = IMarkerService.getInstance();
ESeverity highest = markerService.getHighestViolationSeverity(getModelElement());
if(tooltip != null) {
uninstall(getHitAreaRectangleShape(), tooltip);
}
if(highest == null) {
return;
}
if(highest == ESeverity.WARNING || highest == ESeverity.ERROR) {
Collection<IConstraintViolation<? extends EObject>> violations =
markerService.getAllViolationsWithSeverity(highest);
if(violations.isEmpty()) { // sanity check: never true, since highest != null
return;
}
String imgFile = (highest == ESeverity.WARNING) ? "warning.png" : "error.png";
Image img = getFXImage(ToolingKernelUIActivator.PLUGIN_ID, "icons/" + imgFile);
icon.setImage(img);
String explanation = violations.iterator().next().getExplanation();
tooltip = new Tooltip(explanation);
tooltip.setGraphic(new ImageView(img));
install(getHitAreaRectangleShape(), tooltip);
}
}
/** {@inheritDoc} */
@Override
protected Paint getFillColor() {
......
ComponentSpecificationPropertySection.java fb5b6d82090f7ae063a8876b421529075d072939 GREEN
PortDataPropagation.java 9305d9fd7bb52398bdf227ddf7e1b54adac15808 GREEN
PortInitValueSection.java c25ad3fd1998f35c10a541caad3211f1333ae420 GREEN
PortSpecificationPropertySection.java 180ea52f0c50c4fd3d3ee2a7e59d22d0e3e05c75 RED
PortSpecificationPropertySection.java 051d483d1ff4300fc4920de0f2a76eb12ee29fcc RED
TypeLabelProvider.java 5b0fcced122681125f7df55469ea19b3685eb8bd GREEN
......@@ -16,7 +16,6 @@
package org.fortiss.af3.component.ui.properties;
import static org.fortiss.af3.component.AF3ComponentActivator.getDefault;
import static org.fortiss.af3.component.ui.properties.PortDataPropagation.getPortsToPropagate;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.hasReadOnlyBehaviorSpecification;
import static org.fortiss.af3.expression.utils.ExpressionUtils.getAllVisibleTypes;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copy;
......@@ -27,7 +26,6 @@ import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import org.conqat.lib.commons.collections.Pair;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.layout.GridDataFactory;
......@@ -236,9 +234,6 @@ public final class PortSpecificationPropertySection extends PropertySectionBase
IType selectedType = (IType)selection.getFirstElement();
if(!typesAreEqual(selectedType, spec.getType())) {
spec.setType(copy(selectedType));
for(Pair<Channel, Port> c : getPortsToPropagate(port, getPart())) {
c.getSecond().getPortSpecification().setType(copy(selectedType));
}
}
refreshBoundsControls();
......
component.ecore 6487189a39ecf7d7475e92431b3fa5b5e5dc813e GREEN
component.ecore a7528518daf70c14db0076c8311fa66f9a250458 GREEN
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model" nsURI="http://www.fortiss.org/af3/component" nsPrefix="org-fortiss-af3-component">
<eClassifiers xsi:type="ecore:EClass" name="ComponentArchitecture" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//IProjectRootElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IFunctionScope platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/ITypeScope platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//constraints/IConstrained">
<eClassifiers xsi:type="ecore:EClass" name="ComponentArchitecture" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//IProjectRootElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IFunctionScope platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/ITypeScope">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="This is the root element of the component architecture."/>
</eAnnotations>
......@@ -45,7 +45,7 @@
<eParameters name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eOperations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Component" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//base/HierarchicElementBase platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IVariableScope platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//ISpeciallyCopyiable platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//constraints/IConstrained platform:/resource/org.fortiss.af3.project/model/project.ecore#//ITraceableArtifact">
<eClassifiers xsi:type="ecore:EClass" name="Component" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//base/HierarchicElementBase platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IVariableScope platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//ISpeciallyCopyiable platform:/resource/org.fortiss.af3.project/model/project.ecore#//ITraceableArtifact">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="This is the main concept to encapsulate behaviors. A component can be atomic - implementing a behavior by means of code specification or state automaton specification, or hierarchical - containing subcomponents with behaviors. "/>
</eAnnotations>
......
......@@ -5,7 +5,7 @@ ComponentLibraryModelElementFactory.java b6c854e91d431fa3bc42fafdcf618a2040d23ab
ComponentLibraryUtils.java dd5fb918e37c98c885b59ea1a7915b8cdf149997 GREEN
ComponentModelElementFactory.java 7d73764f4ebc3a45bcd2833c68a06213109784a0 GREEN
ComponentProgramUtils.java 71faad6256159ee2d59843fcde83ac6995dff0fe GREEN
ComponentUtils.java d4aa3db08fafafaa937b976c85762f1009fa8dc7 GREEN
ComponentUtils.java e2ae1c22731f28dfcb6ddfde1518974d819e20f1 GREEN
GeneratorModelElementFactory.java 7fdb75341336fe579d4338a53c99df2f091c2b09 GREEN
IComponentArchitectureTransformation.java da70307771248f1d95e2fcd68e86fd68327f9df0 GREEN
SimulationUtils.java a28590d89ed92d862bf7b657b9dfc4784545e36a GREEN
......@@ -134,7 +134,6 @@ public class ComponentUtils {
/** Keeps only the behavioral specification of the component. */
public static void removeNonBehavior(Component comp) {
comp.getConstraintInstances().clear();
removeSpecs(comp, spec -> spec instanceof IComponentBehaviorDefinitionSpecification);
}
......
mira.ecore 6f65a501f30154def7b0805517153fb4f5516b9c RED
mira.ecore 145ac5dedefbfde9c9cf288eb10cf85e670e1ed9 GREEN
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model" nsURI="http://www.fortiss.org/af3/mira" nsPrefix="org-fortiss-af3-mira">
<eClassifiers xsi:type="ecore:EClass" name="Analysis" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//IProjectRootElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//constraints/IConstrained">
<eClassifiers xsi:type="ecore:EClass" name="Analysis" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//IProjectRootElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement">
<eOperations name="getRequirementsList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return AnalysisStaticImpl.getRequirementsList(this);"/>
......@@ -32,7 +32,7 @@
</eAnnotations>
</eOperations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Requirement" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement #//IImageContainer platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//constraints/IConstrained">
<eClassifiers xsi:type="ecore:EClass" name="Requirement" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement #//IImageContainer">
<eOperations name="getAnalysis" eType="#//Analysis">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementStaticImpl.getAnalysis(this);"/>
......@@ -127,7 +127,7 @@
</eOperations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="text" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RequirementsPackage" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//constraints/IConstrained">
<eClassifiers xsi:type="ecore:EClass" name="RequirementsPackage" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement">
<eOperations name="getRequirementsList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementsPackageStaticImpl.getRequirementsList(this);"/>
......@@ -150,7 +150,7 @@
</eGenericType>
</eOperations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RequirementsContainer" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//constraints/IConstrained">
<eClassifiers xsi:type="ecore:EClass" name="RequirementsContainer" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement">
<eOperations name="getRequirementsPackagesList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementsContainerStaticImpl.getRequirementsPackagesList(this);"/>
......
ModeAutomatonControllerFactory.java 8904bd57879c647ce3ab8e1726f192f0208d1d70 YELLOW
ModeAutomatonFXEditor.java 2d70d6f9ad225ebb767d20009f3d7f9f9dda2be2 GREEN
ModeAutomatonControllerFactory.java 3e60fb8432aef914d0c63e8dfeb18b6ac57ddb6f GREEN
ModeAutomatonFXEditor.java 0e772da01045f7dc39c1005735c47e51d8b92a5b GREEN
ModeAutomatonFXEditorBinding.java d3503a20fc9fccc6a8805674bdabaa2135fd28c2 GREEN
ModeAutomatonModelFactory.java 90826e0ff88b73784e41cc71f473c11daa6bc36d GREEN
ModeAutomatonVisualFactory.java a9b82127b572bf9533474bcf22168e79922b2f16 GREEN
......
......@@ -18,12 +18,12 @@ package org.fortiss.af3.mode.ui.editor.fx;
import static javafx.scene.paint.Color.LIGHTGRAY;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures.IndicatorType;
import org.fortiss.af3.mode.model.Mode;
import org.fortiss.af3.mode.model.ModeAutomaton;
import org.fortiss.af3.mode.model.SwitchSegment;
import org.fortiss.af3.mode.model.SwitchSegmentConnector;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures;
import org.fortiss.tooling.common.ui.javafx.lwfxef.DiagramViewerFeatures.IndicatorType;
import org.fortiss.tooling.kernel.ui.extension.base.LWFXEFEditorBase;
/**
......
......@@ -4,4 +4,4 @@ PlatformComponentControllerFactory.java c353602118a17bdb9e78ad3d97ed9dbca5297a7f
PlatformComponentFXEditor.java 579bda140d6d490e40c49386957bf63af345f373 GREEN
PlatformComponentFXEditorBinding.java 0cfd58f8ffdd9fd8faae854841cfd5fb8cde24a1 GREEN
PlatformComponentModelFactory.java 2075ee98896f6d26c3bf24045ccc8b3eb8f0d6aa GREEN
PlatformComponentVisualFactory.java e0a773856f7d037ff0f21234ed1884a49c1161c4 GREEN
PlatformComponentVisualFactory.java ae8344ea761001ab0dbb9f92addf721855f92e1c GREEN
......@@ -15,31 +15,33 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.ui.editor.fx;
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.IDiagramAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IDiagramAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.ILinkVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IVisualFactory;
import org.fortiss.af3.platform.hierarchic.model.cluster.Cluster;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.DirectedPlatformConnectorContentVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.DirectedPlatformConnectorDiagramVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformClusterVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformExecutionUnitVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformGatewayUnitVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformGenericUnitVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformMemoryUnitVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformTransmissionUnitVisual;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.GatewayUnit;
import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.af3.platform.model.MemoryUnit;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.model.PlatformConnectorUnit;
import org.fortiss.af3.platform.model.TransmissionConnection;
import org.fortiss.af3.platform.model.TransmissionUnit;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedLineLinkVisual;
import org.fortiss.af3.platform.ui.editor.fx.visual.TransmissionConnectionVisual;
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.IDiagramAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IDiagramAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.ILinkVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IVisualFactory;
/**
* {@link IVisualFactory} for the or the lower layers of hierarchical
......@@ -63,6 +65,8 @@ public final class PlatformComponentVisualFactory implements IVisualFactory {
return new PlatformGatewayUnitVisual(modelBundle);
} else if(model instanceof MemoryUnit) {
return new PlatformMemoryUnitVisual(modelBundle);
} else if(model instanceof IPlatformArchitectureElement) {
return new PlatformGenericUnitVisual(modelBundle);
}
return null;
......@@ -99,7 +103,7 @@ public final class PlatformComponentVisualFactory implements IVisualFactory {
public ILinkVisual createLinkVisual(ILinkMVCBundle modelBundle) {
Object linkObj = modelBundle.getModel();
if(linkObj instanceof TransmissionConnection) {
return new NamedLayoutedLineLinkVisual<>(modelBundle, TransmissionConnection.class);
return new TransmissionConnectionVisual(modelBundle);
}
return null;
}
......
......@@ -3,5 +3,6 @@ DirectedPlatformConnectorDiagramVisual.java b752a6fc089fb0457409a16f8446349b3213
PlatformClusterVisual.java 119c9931b1674451e99ab5a3df090369de3ac629 GREEN
PlatformExecutionUnitVisual.java 6ca5f83416416e2e4576689199f9ed8375fb2118 GREEN
PlatformGatewayUnitVisual.java 7b22801b13863f972ab46eb4cd87853801ac7ce8 GREEN
PlatformGenericUnitVisual.java 80e903e53a226ac772f21f851c1230141a5ec0a9 GREEN
PlatformMemoryUnitVisual.java 12ced545e8aadcc4a413ad8f939b3528bcc1422a GREEN
PlatformTransmissionUnitVisual.java b2dee9a83c2bf9bbf082c042d3a712a91ed3feb6 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.hierarchic.ui.editor.fx.visual;
import static javafx.scene.paint.Color.rgb;
import static org.fortiss.af3.platform.hierarchic.ui.HierarchicPlatformUIActivator.PLUGIN_ID;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getFXImage;
import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedRectangularContentVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IVisual;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
/**
* {@link IVisual} of hierarchical generic {@link IPlatformArchitectureElement}s.
*
* @author diewald
*/
public class PlatformGenericUnitVisual
extends NamedLayoutedRectangularContentVisual<IPlatformArchitectureElement> {
/** Fill color of a Cluster. */
private static final Color GENERIC_COLOR = rgb(200, 200, 200); // Grey;
/** The icon image. */
private static final Image ICON = getFXImage(PLUGIN_ID, "/icons/generic-platform-unit.png");
/** Constructor. */
public PlatformGenericUnitVisual(IContentMVCBundle mvcb) {
super(mvcb, IPlatformArchitectureElement.class);
}
/** {@inheritDoc} */
@Override
protected Paint getFillColor() {
return GENERIC_COLOR;
}
/** {@inheritDoc} */
@Override
protected Image getIcon() {
return ICON;
}
}
HierarchicPlatformArchitectureCompositor.java 93e171754ce52fcdf5792ead7e021927aa0d51d0 GREEN
HierarchicalCompositionRules.java 6c1aafc2f14d0af7511fbf7630e5620e8876f98b GREEN
HierarchicPlatformArchitectureCompositor.java bbd67a9699b73eb051a815aa513f61621e3836d4 GREEN
HierarchicalCompositionRules.java 9ab422ee2de9216a99a2ebd13345db453132e803 GREEN
......@@ -22,7 +22,7 @@ import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.platform.hierarchic.compose.base.IPlatformHierarchicalCompositionRules;
import org.fortiss.af3.platform.hierarchic.compose.base.PlatformArchitectureCompositorBase;
import org.fortiss.af3.platform.hierarchic.model.cluster.Cluster;
import org.fortiss.af3.platform.hierarchic.model.node.Node;
import org.fortiss.af3.platform.hierarchic.model.cluster.IClusterDomain;
import org.fortiss.af3.platform.hierarchic.model.node.OffChipNetworkInterface;
import org.fortiss.af3.platform.hierarchic.model.node.OffChipNetworkPort;
import org.fortiss.af3.platform.model.IArchitectureDomain;
......@@ -61,10 +61,10 @@ public class HierarchicPlatformArchitectureCompositor extends PlatformArchitectu
// Clusters and Nodes are used at the top-level.
EList<IHierarchicElement> paChildren = container.getContainedElements();
boolean containsCluster = pickFirstInstanceOf(Cluster.class, paChildren) != null;
boolean containsNode = pickFirstInstanceOf(Node.class, paChildren) != null;
boolean containsNonCluster = !containsCluster && !paChildren.isEmpty();
if((containsCluster && contained instanceof Node) ||
(containsNode && contained instanceof Cluster)) {
if((containsCluster && !(contained instanceof IClusterDomain)) ||
(containsNonCluster && contained instanceof Cluster)) {
return false;
}
......
......@@ -65,9 +65,9 @@ public class HierarchicalCompositionRules extends PlatformHierarchicalCompositio
} else if(hasEqualLevel(domain, IPlatformDomain.class)) {
rval.add(IClusterDomain.class);
rval.add(INodeDomain.class);
rval.add(IElectronicsDomain.class);
} else if(hasEqualLevel(domain, IClusterDomain.class)) {
rval.add(INodeDomain.class);
// rval.add(IPeripheralsDomain.class);
rval.add(IElectronicsDomain.class);
} else if(hasEqualLevel(domain, INodeDomain.class)) {
// Required for availability of these elements at the node level (i.e., to drop elements
......@@ -84,6 +84,7 @@ public class HierarchicalCompositionRules extends PlatformHierarchicalCompositio
} else if(hasEqualLevel(domain, IMemoryDomain.class)) {
rval.add(IProcessorDomain.class);
rval.add(ITileDomain.class);
rval.add(IElectronicsDomain.class);
} else if(hasEqualLevel(domain, IPeripheralsDomain.class)) {
rval.add(IElectronicsDomain.class);
}
......@@ -112,7 +113,20 @@ public class HierarchicalCompositionRules extends PlatformHierarchicalCompositio
IProcessorDomain.class, IPeripheralsDomain.class);
boolean processorAndMemory = isCompatibleDomainsCommutative(domain1, domain2,
IProcessorDomain.class, IMemoryDomain.class);
return processorAndPeripherals || processorAndMemory ||
// Electrical supply of platform elements down to tiles.
boolean tileAndElectrialSupply = isCompatibleDomainsCommutative(domain1, domain2,
ITileDomain.class, IElectronicsDomain.class);
boolean nodeAndElectrialSupply = isCompatibleDomainsCommutative(domain1, domain2,
INodeDomain.class, IElectronicsDomain.class);
boolean clusterAndElectrialSupply = isCompatibleDomainsCommutative(domain1, domain2,
IClusterDomain.class, IElectronicsDomain.class);
boolean memoryAndElectrialSupply = isCompatibleDomainsCommutative(domain1, domain2,
IMemoryDomain.class, IElectronicsDomain.class);
boolean electricalSupply = tileAndElectrialSupply || nodeAndElectrialSupply ||
clusterAndElectrialSupply || memoryAndElectrialSupply;
return processorAndPeripherals || processorAndMemory || electricalSupply ||
super.isCompatibleDomains(domain1, domain2);
}
}
ExecutionUnitComponentCompositorBase.java 93fca1115e430b6b751c5a241c699afd27941b1a GREEN
GatewayUnitComponentCompositorBase.java 426a31ee4322eb6d0722a5cc12b76994193c1b86 GREEN
ExecutionUnitComponentCompositorBase.java 44c23f0620a71e6aa4ed03ae0554dffdda28b775 GREEN
GatewayUnitComponentCompositorBase.java 98fb71a38a87de4c09fa072cda4b53f04f8b673f GREEN
GenericPlatformUnitCompositorBase.java 4b4ae309acc3d3185c0adad9ee894a2eef288f4f GREEN
MemoryUnitCompositorBase.java 07b03804e84404a0c80a04d137da2f81d3f59e64 GREEN
MemoryUnitCompositorBase.java ec0d5a99ccc6db78251caa5877573b0318bd9992 GREEN
PlatformElementCompositorBase.java e4831ad227874f1ee7b2b6f16775d145acaa2f15 GREEN
TransmissionUnitComponentCompositorBase.java 0b6f5bd1572d895811279609a71ea5c78caeeeee GREEN
TransmissionUnitComponentCompositorBase.java 8aadef8ae7c0b9c04d989a15635e268b264e8d26 GREEN