Commit 8365bf66 authored by Alexander Diewald's avatar Alexander Diewald

DSE: Cleanup Pattern UI code

* Remove warnings.
* Make the utilization of the Memory Pattern editable again.
* Use TreeViews, instead of TreeTableViews if there is only one column.

Issue-Ref: 3365
Issue-Url: https://af3-developer.fortiss.org/issues/3365Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent 255658c4
......@@ -2,16 +2,16 @@
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.RadioButton?>
<?import javafx.scene.control.TreeTableView?>
<?import javafx.scene.control.TreeView?>
<?import javafx.scene.layout.Pane?>
<Pane fx:id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="540.0" prefWidth="816.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<children>
<TreeTableView fx:id="ecuView" layoutX="20.0" layoutY="10.0" prefHeight="400.0" prefWidth="250.0" />
<TreeView fx:id="ecuView" layoutX="20.0" layoutY="10.0" prefHeight="400.0" prefWidth="250.0" />
<RadioButton fx:id="minButton" layoutX="236.0" layoutY="468.0" mnemonicParsing="false" text="Minimize" />
<RadioButton fx:id="maxButton" layoutX="236.0" layoutY="495.0" mnemonicParsing="false" text="Maximize" />
<TreeTableView fx:id="propertyView" layoutX="290.0" layoutY="10.0" prefHeight="400.0" prefWidth="250.0" />
<TreeTableView fx:id="taskView" layoutX="560.0" layoutY="10.0" prefHeight="400.0" prefWidth="250.0" />
<TreeView fx:id="propertyView" layoutX="290.0" layoutY="10.0" prefHeight="400.0" prefWidth="250.0" />
<TreeView fx:id="taskView" layoutX="560.0" layoutY="10.0" prefHeight="400.0" prefWidth="250.0" />
<Label layoutX="236.0" layoutY="439.0" text="Optimization Direction" />
<RadioButton fx:id="sumButton" layoutX="477.0" layoutY="468.0" mnemonicParsing="false" text="Sum" />
<RadioButton fx:id="countButton" layoutX="477.0" layoutY="495.0" mnemonicParsing="false" text="Count" />
......
PatternContainerFXController.java cb92f0084cc9fe9ced342b584d5c010c1e6a77a1 RED
ConstraintObjectiveFXController.java 4c7acacb248ed690d042fe729459016137991e2f YELLOW
PatternContainerFXController.java d011fe3eeb5c675d26a6ddcf103b0b9b46aa3a9d YELLOW
PatternFXControllerBase.java bf35741f8936929e008f9bb4ba74c8d02ec859b9 YELLOW
SuperSetContentProvider.java 86806720c678ba5c92ec2579b665d3f401df07b3 GREEN
......@@ -13,13 +13,12 @@
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.ui.perspective.generic;
package org.fortiss.af3.exploration.ui.perspective.targetdef;
import static java.util.stream.Collectors.toList;
import java.util.List;
import org.fortiss.af3.exploration.ui.perspective.targetdef.PatternContainerFXController;
import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase;
import javafx.fxml.FXML;
......
......@@ -19,7 +19,6 @@ import static java.lang.String.join;
import static org.conqat.ide.commons.ui.dialog.MessageUtils.showInfo;
import org.fortiss.af3.exploration.model.IExplorationTarget;
import org.fortiss.af3.exploration.ui.perspective.generic.PatternFXControllerBase;
import org.fortiss.af3.exploration.ui.perspective.service.IDSEPerspectiveManager;
import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase;
......
......@@ -13,11 +13,14 @@
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.ui.perspective.generic;
package org.fortiss.af3.exploration.ui.perspective.targetdef;
import java.util.Collection;
import org.fortiss.af3.exploration.model.IExplorationTarget;
import org.fortiss.af3.exploration.model.project.DSE;
import org.fortiss.af3.exploration.ui.perspective.service.EventBroker;
import org.fortiss.af3.exploration.ui.perspective.service.IDSEPerspectiveManager;
import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase;
import javafx.scene.Node;
......@@ -32,6 +35,25 @@ import javafx.scene.control.TitledPane;
@SuppressWarnings("unchecked")
public abstract class PatternFXControllerBase extends CompositeFXControllerBase<TitledPane, Node> {
/** References the currently selected {@link DSE}. */
protected DSE dse;
/** Constructor. */
protected PatternFXControllerBase() {
this.dse = IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE();
EventBroker.getInstance().addListener((src, event) -> {
switch(event) {
case DSE_SELECTED_EVENT:
dse = IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE();
break;
case DSE_REMOVED_EVENT:
dse = null;
break;
}
});
}
/** The patterns's name. */
public abstract String getPatternName();
......
ConstraintsFXViewPart.java 89893c80b8af0582ce1f2a786a9dce180a7bd099 RED
ConstraintsFXViewPart.java 51d0d643b74d13231e34248702c467949f93936a YELLOW
......@@ -16,11 +16,11 @@
package org.fortiss.af3.exploration.ui.perspective.targetdef.constraint;
import org.eclipse.fx.ui.workbench3.FXViewPart;
import org.fortiss.af3.exploration.ui.perspective.generic.ConstraintObjectiveFXController;
import org.fortiss.af3.exploration.ui.perspective.generic.ExplorationUIFXController;
import org.fortiss.af3.exploration.ui.perspective.generic.ExplorationUIFXViewPart;
import org.fortiss.af3.exploration.ui.perspective.process.IProcessManager;
import org.fortiss.af3.exploration.ui.perspective.process.IProcessManager.EProcessStep;
import org.fortiss.af3.exploration.ui.perspective.targetdef.ConstraintObjectiveFXController;
import org.fortiss.af3.exploration.ui.perspective.targetdef.constraint.pattern.AllocationPatternFXController;
import org.fortiss.af3.exploration.ui.perspective.targetdef.constraint.pattern.CouplingPatternFXController;
import org.fortiss.af3.exploration.ui.perspective.targetdef.constraint.pattern.MemoryPatternFXController;
......
AllocationPatternFXController.java 7c3ba677a9b14857d20140d48d321cd4b41d0fda RED
CouplingPatternFXController.java b8270aaddefdde9d845bb2c6624bb850384b4aad RED
MemoryPatternFXController.java a15b2a0bb69681e4ae675dcc23fc9aaf44558728 RED
SafetyPatternFXController.java 440af5d6bdd5ce26b4d77461f8b34271fadfc637 RED
AllocationPatternFXController.java 840bc404f6aefb8bc0e6f9b25f156d9db647178b YELLOW
CouplingPatternFXController.java 937034aa2dd680abfcd815c32deb5f322663dc37 YELLOW
MemoryPatternFXController.java b45b1eb1418d75cc4f4b2983b996b8ef4abab58d YELLOW
SafetyPatternFXController.java 4d84c1bd15d1f8d15475849c5e2b9c24f094b76e YELLOW
......@@ -16,9 +16,10 @@ import org.fortiss.af3.exploration.dseml.model.expression.IExpression;
import org.fortiss.af3.exploration.dseml.model.expression.SuperSet;
import org.fortiss.af3.exploration.model.IExplorationTarget;
import org.fortiss.af3.exploration.model.project.DSE;
import org.fortiss.af3.exploration.ui.perspective.generic.PatternFXControllerBase;
import org.fortiss.af3.exploration.ui.perspective.generic.SuperSetContentProvider;
import org.fortiss.af3.exploration.ui.perspective.service.EventBroker;
import org.fortiss.af3.exploration.ui.perspective.service.IDSEPerspectiveManager;
import org.fortiss.af3.exploration.ui.perspective.targetdef.PatternFXControllerBase;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.task.model.Task;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeUIProviderBase;
......@@ -140,46 +141,51 @@ public class AllocationPatternFXController extends PatternFXControllerBase {
return "AllocationPatternInterface.fxml";
}
/**
* Creates a viewer for the table of tasks and the radio buttons.
*/
private class AllocationViewer {
/** Constructor. */
public AllocationViewer() {
DSE dse = IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE();
SuperSet<Task> tasks = dse.getCurrentStep().getSuperSetMap().get(Task.class);
SuperSet<ExecutionUnit> ecus =
dse.getCurrentStep().getSuperSetMap().get(ExecutionUnit.class);
@SuppressWarnings("unchecked") DynamicTreeUIProviderBase<EObject> uiProvider =
(DynamicTreeUIProviderBase<EObject>)(DynamicTreeUIProviderBase<?>)createNameProvider();
// The constructed Object is not needed. It is called from the passed TreeView.
new DynamicTreeViewer<EObject>(taskView, tasks, false, 0,
new SuperSetContentProvider<Task>(), uiProvider);
// add a viewer for the ECUs
// The constructed Object is not needed. It is called from the passed TreeView.
new DynamicTreeViewer<EObject>(ecuView, ecus, false, 0,
new SuperSetContentProvider<ExecutionUnit>(), uiProvider);
// add the radio buttons for switching from allocation to dislocation
final ToggleGroup group = new ToggleGroup();
allocationButton.setToggleGroup(group);
dislocationButton.setToggleGroup(group);
allocationButton.setSelected(true);
}
}
/** {@inheritDoc} */
@Override
public void initialize() {
if(IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE() != null) {
new AllocationViewer();
EventBroker.getInstance().addListener((src, event) -> {
switch(event) {
case DSE_SELECTED_EVENT:
setupViews();
break;
case DSE_REMOVED_EVENT:
taskView.setRoot(null);
ecuView.setRoot(null);
break;
}
});
if(dse != null) {
setupViews();
}
}
/** Helper method to populate the views and preselect items. */
private void setupViews() {
SuperSet<Task> tasks = dse.getCurrentStep().getSuperSetMap().get(Task.class);
SuperSet<ExecutionUnit> ecus =
dse.getCurrentStep().getSuperSetMap().get(ExecutionUnit.class);
@SuppressWarnings("unchecked") DynamicTreeUIProviderBase<EObject> uiProvider =
(DynamicTreeUIProviderBase<EObject>)(DynamicTreeUIProviderBase<?>)createNameProvider();
// The constructed Object is not needed. It is called from the passed TreeView.
new DynamicTreeViewer<EObject>(taskView, tasks, false, 0,
new SuperSetContentProvider<Task>(), uiProvider);
// add a viewer for the ECUs
// The constructed Object is not needed. It is called from the passed TreeView.
new DynamicTreeViewer<EObject>(ecuView, ecus, false, 0,
new SuperSetContentProvider<ExecutionUnit>(), uiProvider);
// add the radio buttons for switching from allocation to dislocation
final ToggleGroup group = new ToggleGroup();
allocationButton.setToggleGroup(group);
dislocationButton.setToggleGroup(group);
allocationButton.setSelected(true);
}
/** {@inheritDoc} */
@Override
public Collection<Node> getControls() {
......
......@@ -31,9 +31,10 @@ import org.fortiss.af3.exploration.dseml.model.expression.IExpression;
import org.fortiss.af3.exploration.dseml.model.expression.SuperSet;
import org.fortiss.af3.exploration.model.IExplorationTarget;
import org.fortiss.af3.exploration.model.project.DSE;
import org.fortiss.af3.exploration.ui.perspective.generic.PatternFXControllerBase;
import org.fortiss.af3.exploration.ui.perspective.generic.SuperSetContentProvider;
import org.fortiss.af3.exploration.ui.perspective.service.EventBroker;
import org.fortiss.af3.exploration.ui.perspective.service.IDSEPerspectiveManager;
import org.fortiss.af3.exploration.ui.perspective.targetdef.PatternFXControllerBase;
import org.fortiss.af3.task.model.Task;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeUIProviderBase;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeViewer;
......@@ -133,39 +134,43 @@ public class CouplingPatternFXController extends PatternFXControllerBase {
return "CouplingPatternInterface.fxml";
}
/**
* Creates a viewer for the table of tasks and the radio buttons.
*/
private class CouplingViewer {
/** Constructor. */
public CouplingViewer() {
DSE dse = IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE();
SuperSet<Task> tasks = dse.getCurrentStep().getSuperSetMap().get(Task.class);
@SuppressWarnings("unchecked") DynamicTreeUIProviderBase<EObject> uiProvider =
(DynamicTreeUIProviderBase<EObject>)(DynamicTreeUIProviderBase<?>)createNameProvider();
// The constructed Object is not needed. It is called from the passed TreeView.
new DynamicTreeViewer<EObject>(view, tasks, false, 0,
new SuperSetContentProvider<Task>(), uiProvider);
// add the radio buttons for switching from coupling to decoupling
final ToggleGroup group = new ToggleGroup();
couplingButton.setToggleGroup(group);
decouplingButton.setToggleGroup(group);
couplingButton.setSelected(true);
}
}
/** {@inheritDoc} */
@Override
public void initialize() {
if(IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE() != null) {
new CouplingViewer();
EventBroker.getInstance().addListener((src, event) -> {
switch(event) {
case DSE_SELECTED_EVENT:
setupViews();
break;
case DSE_REMOVED_EVENT:
view.setRoot(null);
break;
}
});
if(dse != null) {
setupViews();
}
}
/** Helper method to populate the views and preselect items. */
private void setupViews() {
SuperSet<Task> tasks = dse.getCurrentStep().getSuperSetMap().get(Task.class);
@SuppressWarnings("unchecked") DynamicTreeUIProviderBase<EObject> uiProvider =
(DynamicTreeUIProviderBase<EObject>)(DynamicTreeUIProviderBase<?>)createNameProvider();
// The constructed Object is not needed. It is called from the passed TreeView.
new DynamicTreeViewer<EObject>(view, tasks, false, 0, new SuperSetContentProvider<Task>(),
uiProvider);
// add the radio buttons for switching from coupling to decoupling
final ToggleGroup group = new ToggleGroup();
couplingButton.setToggleGroup(group);
decouplingButton.setToggleGroup(group);
couplingButton.setSelected(true);
}
/** {@inheritDoc} */
@Override
public Collection<Node> getControls() {
......
......@@ -35,9 +35,10 @@ import org.fortiss.af3.exploration.dseml.model.booleanp.IBooleanExpression;
import org.fortiss.af3.exploration.dseml.model.expression.SuperSet;
import org.fortiss.af3.exploration.model.IExplorationTarget;
import org.fortiss.af3.exploration.model.project.DSE;
import org.fortiss.af3.exploration.ui.perspective.generic.PatternFXControllerBase;
import org.fortiss.af3.exploration.ui.perspective.generic.SuperSetContentProvider;
import org.fortiss.af3.exploration.ui.perspective.service.EventBroker;
import org.fortiss.af3.exploration.ui.perspective.service.IDSEPerspectiveManager;
import org.fortiss.af3.exploration.ui.perspective.targetdef.PatternFXControllerBase;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.annotation.FlashSize;
import org.fortiss.af3.platform.model.annotation.RamSize;
......@@ -93,8 +94,7 @@ public class MemoryPatternFXController extends PatternFXControllerBase {
}
/**
* Returns the {@link ExecutionUnit}s currently selected in the
* {@link MemoryUtilizationTreeTableViewer}.
* Returns the {@link ExecutionUnit}s currently selected in the {@link #view}.
*/
private Collection<ExecutionUnit> getSelectedExecutionUnits() {
return view.getSelectionModel().getSelectedItems().stream()
......@@ -136,67 +136,79 @@ public class MemoryPatternFXController extends PatternFXControllerBase {
return "MemoryPatternInterface.fxml";
}
/**
* Creates a {@link DynamicTreeTableViewer} with an editable column for the memory utilization.
*/
private class MemoryUtilizationTreeTableViewer {
/** Constructor. */
public MemoryUtilizationTreeTableViewer() {
DSE dse = IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE();
SuperSet<ExecutionUnit> executionUnits =
dse.getCurrentStep().getSuperSetMap().get(ExecutionUnit.class);
memoryUtilization = new HashMap<ExecutionUnit, Integer>();
executionUnits.getEntries()
.forEach(executionUnit -> memoryUtilization.put(executionUnit, 100));
DynamicTreeTableUIProviderBase uiProvider = new DynamicTreeTableUIProviderBase() {
/** {@inheritDoc} */
@Override
public String getLabel(Object element, int column) {
switch(column) {
case 0:
return ((INamedElement)element).getName();
case 1:
return getAnnotationValue((ExecutionUnit)element, FlashSize.class,
Long.class).toString();
case 2:
return memoryUtilization.get(element).toString();
default:
return "";
}
}
};
DynamicTreeTableViewer<EObject> viewer =
new DynamicTreeTableViewer<EObject>(view, executionUnits, false, 0,
new SuperSetContentProvider<ExecutionUnit>(), uiProvider);
// Name
viewer.addColumn("ECU", 125, true);
// Memory
viewer.addColumn("Memory [bytes]", 125, true);
// Utilization
EventHandler<CellEditEvent<EObject, String>> updateUtilization = (event -> {
memoryUtilization.put((ExecutionUnit)event.getRowValue().getValue(),
valueOf(event.getNewValue()));
view.refresh();
});
viewer.addColumn("Utilization [%]", 125, false).setOnEditCommit(updateUtilization);
}
}
/** {@inheritDoc} */
@Override
public void initialize() {
if(IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE() != null) {
new MemoryUtilizationTreeTableViewer();
EventBroker.getInstance().addListener((src, event) -> {
switch(event) {
case DSE_SELECTED_EVENT:
setupViews();
break;
case DSE_REMOVED_EVENT:
view.setRoot(null);
break;
}
});
if(dse != null) {
setupViews();
}
}
/** Helper method to populate the views and preselect items. */
private void setupViews() {
SuperSet<ExecutionUnit> executionUnits =
dse.getCurrentStep().getSuperSetMap().get(ExecutionUnit.class);
memoryUtilization = new HashMap<ExecutionUnit, Integer>();
executionUnits.getEntries()
.forEach(executionUnit -> memoryUtilization.put(executionUnit, 100));
@SuppressWarnings("unchecked") DynamicTreeTableUIProviderBase<EObject> uiProvider =
(DynamicTreeTableUIProviderBase<EObject>)(DynamicTreeTableUIProviderBase<?>)new DynamicTreeTableUIProviderBase<INamedElement>() {
@Override
public String getLabel(INamedElement element, int column) {
switch(column) {
case 0:
return element.getName();
case 1:
return getAnnotationValue((ExecutionUnit)element, FlashSize.class,
Long.class).toString();
case 2:
return memoryUtilization.get(element).toString();
default:
return "";
}
}
@Override
public boolean isEditable(int column) {
switch(column) {
case 2:
return true;
}
return false;
}
};
DynamicTreeTableViewer<EObject> viewer = new DynamicTreeTableViewer<EObject>(view,
executionUnits, false, 0, new SuperSetContentProvider<ExecutionUnit>(), uiProvider);
// Name
viewer.addColumn("ECU", 125);
// Memory
viewer.addColumn("Memory [bytes]", 125);
// Utilization
EventHandler<CellEditEvent<EObject, String>> updateUtilization = (event -> {
memoryUtilization.put((ExecutionUnit)event.getRowValue().getValue(),
valueOf(event.getNewValue()));
view.refresh();
});
viewer.addColumn("Utilization [%]", 125).setOnEditCommit(updateUtilization);
}
/** {@inheritDoc} */
@Override
public Collection<Node> getControls() {
......
......@@ -28,17 +28,17 @@ import static org.fortiss.tooling.base.utils.AnnotationUtils.getAnnotationValue;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.exploration.dseml.model.booleanp.IBooleanExpression;
import org.fortiss.af3.exploration.dseml.model.expression.SuperSet;
import org.fortiss.af3.exploration.model.IExplorationTarget;
import org.fortiss.af3.exploration.model.SuperSetMap;
import org.fortiss.af3.exploration.model.project.DSE;
import org.fortiss.af3.exploration.ui.perspective.generic.PatternFXControllerBase;
import org.fortiss.af3.exploration.ui.perspective.generic.SuperSetContentProvider;
import org.fortiss.af3.exploration.ui.perspective.service.IDSEPerspectiveManager;
import org.fortiss.af3.exploration.ui.perspective.targetdef.PatternFXControllerBase;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.safety.model.SIL;
import org.fortiss.af3.safety.model.annotation.SafetyIntegrityLevel;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationEntry;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableUIProviderBase;
......@@ -147,31 +147,31 @@ public class SafetyPatternFXController extends PatternFXControllerBase {
SuperSet<ExecutionUnit> executionUnits =
dse.getCurrentStep().getSuperSetMap().get(ExecutionUnit.class);
DynamicTreeTableUIProviderBase uiProvider = new DynamicTreeTableUIProviderBase() {
/** {@inheritDoc} */
@Override
public String getLabel(Object element, int column) {
switch(column) {
case 0:
return ((INamedElement)element).getName();
case 1:
return getAnnotationValue((ExecutionUnit)element,
SafetyIntegrityLevel.class, SIL.class).toString();
default:
return "";
}
}
};
@SuppressWarnings("unchecked") DynamicTreeTableUIProviderBase<EObject> uiProvider =
(DynamicTreeTableUIProviderBase<EObject>)(DynamicTreeTableUIProviderBase<?>)new DynamicTreeTableUIProviderBase<INamedElement>() {
/** {@inheritDoc} */
@Override
public String getLabel(INamedElement element, int column) {
switch(column) {
case 0:
return element.getName();
case 1:
return getAnnotationValue((ExecutionUnit)element,
SafetyIntegrityLevel.class, Enumerator.class)
.toString();
default:
return "";
}
}
};
DynamicTreeTableViewer<EObject> viewer =
new DynamicTreeTableViewer<EObject>(view, executionUnits, false, 0,
new SuperSetContentProvider<ExecutionUnit>(), uiProvider);
// Name
viewer.addColumn("ECU", 125, true);
viewer.addColumn("ECU", 125);
// Safety Level
viewer.addColumn("Safety Level", 125, true);
viewer.addColumn("Safety Level", 125);
}
}
......
ObjectivesFXViewPart.java 9f7957b5e627efcebdffecc4fd75eab9e438e482 RED
ObjectivesFXViewPart.java c41a2ea9b86c3f899a31fd960b188878a94c4113 YELLOW
......@@ -16,11 +16,11 @@
package org.fortiss.af3.exploration.ui.perspective.targetdef.objective;
import org.eclipse.fx.ui.workbench3.FXViewPart;
import org.fortiss.af3.exploration.ui.perspective.generic.ConstraintObjectiveFXController;
import org.fortiss.af3.exploration.ui.perspective.generic.ExplorationUIFXController;
import org.fortiss.af3.exploration.ui.perspective.generic.ExplorationUIFXViewPart;
import org.fortiss.af3.exploration.ui.perspective.process.IProcessManager;
import org.fortiss.af3.exploration.ui.perspective.process.IProcessManager.EProcessStep;
import org.fortiss.af3.exploration.ui.perspective.targetdef.ConstraintObjectiveFXController;
import org.fortiss.af3.exploration.ui.perspective.targetdef.objective.pattern.BusBandwidthOptimizationPatternFXController;
import org.fortiss.af3.exploration.ui.perspective.targetdef.objective.pattern.HardwareOptimizationPatternFXController;
......
BusBandwidthOptimizationPatternFXController.java 7710397aff99c4d495341f951d7475bdcdf7b925 RED
HardwareOptimizationPatternFXController.java 0ffe02e30b1892e2da7072db051bbaa8db1add69 RED
BusBandwidthOptimizationPatternFXController.java 51a11a64e1a94c8ce97e41cb2e9f0d81cdf691b8 YELLOW
HardwareOptimizationPatternFXController.java 28d125e40b85e5054e40c046eb4a27e70589ebb4 YELLOW
......@@ -37,9 +37,10 @@ import org.fortiss.af3.exploration.model.IExplorationConstraint;
import org.fortiss.af3.exploration.model.IExplorationObjective;
import org.fortiss.af3.exploration.model.IExplorationTarget;
import org.fortiss.af3.exploration.model.project.DSE;
import org.fortiss.af3.exploration.ui.perspective.generic.PatternFXControllerBase;
import org.fortiss.af3.exploration.ui.perspective.generic.SuperSetContentProvider;
import org.fortiss.af3.exploration.ui.perspective.service.EventBroker;
import org.fortiss.af3.exploration.ui.perspective.service.IDSEPerspectiveManager;
import org.fortiss.af3.exploration.ui.perspective.targetdef.PatternFXControllerBase;
import org.fortiss.af3.platform.model.Route;
import org.fortiss.af3.platform.model.TransmissionUnit;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeUIProviderBase;
......@@ -164,44 +165,47 @@ public class BusBandwidthOptimizationPatternFXController extends PatternFXContro
return "BusBandwidthOptimizationPatternInterface.fxml";
}
/**
* Creates a viewer for the table of transmission units and the radio buttons.
*/
private class BusBandwidthViewer {
/** Constructor. */
public BusBandwidthViewer() {
DSE dse = IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE();
SuperSet<TransmissionUnit> transmissionUnits =
dse.getCurrentStep().getSuperSetMap().get(TransmissionUnit.class);
@SuppressWarnings("unchecked") DynamicTreeUIProviderBase<EObject> uiProvider =
(DynamicTreeUIProviderBase<EObject>)(DynamicTreeUIProviderBase<?>)createNameProvider();
// The constructed Object is not needed. It is called from the passed TreeView.
new DynamicTreeViewer<EObject>(view, transmissionUnits, false, 0,
new SuperSetContentProvider<TransmissionUnit>(), uiProvider);
// add a column with transmission units