Commit a964ff5b authored by Simon Barner's avatar Simon Barner
Browse files

Cleanup:

- Rename some variables
- Adjust some comments
parent aa475a93
......@@ -44,7 +44,7 @@ import org.fortiss.af3.deployment.model.annotation.VlReceivers;
* @author diewald
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 1A9380A0BD4B04F068D1538B0F90026B
* @ConQAT.Rating GREEN Hash: BCE83E855369477D724C57D0C7DD67B6
*/
public class VlReceiversStaticImpl {
......@@ -52,14 +52,14 @@ public class VlReceiversStaticImpl {
public static EList<TransceiverPort> getDerivedValue(VlReceivers spec) {
EList<TransceiverPort> receiverPortList = new BasicEList<>();
VirtualLink dreamsVL = (VirtualLink)spec.getSpecificationOf();
if(dreamsVL != null) {
VirtualLink virtualLink = (VirtualLink)spec.getSpecificationOf();
if(virtualLink != null) {
Collection<TransceiverPort> receiverPorts = new ArrayList<>();
Queue<Segment> vlSegments = new LinkedList<>();
if(dreamsVL.getRootSegment() == null) {
if(virtualLink.getRootSegment() == null) {
return receiverPortList;
}
vlSegments.add(dreamsVL.getRootSegment());
vlSegments.add(virtualLink.getRootSegment());
while(!vlSegments.isEmpty()) {
Segment currentSegment = vlSegments.poll();
List<Segment> next = currentSegment.getNext();
......@@ -74,7 +74,7 @@ public class VlReceiversStaticImpl {
}
}
Deployment deployment = getParentElement(dreamsVL, Deployment.class, false);
Deployment deployment = getParentElement(virtualLink, Deployment.class, false);
Stream<TransceiverPortAllocation> allocStream =
deployment.getTransceiverPortAllocation().parallelStream();
......
......@@ -36,17 +36,17 @@ import org.fortiss.af3.deployment.model.annotation.VlSender;
* @author diewald
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: D749F23EC31E53C82145B415C29FAFBA
* @ConQAT.Rating GREEN Hash: FDA6D67FAF2F1174E484259ED9AE41F2
*/
public class VlSenderStaticImpl {
/** Implementation of the {@link #VlSender.getDerivedValue(VlSender)} method. */
public static TransceiverPort getDerivedValue(VlSender spec) {
VirtualLink dreamsVL = (VirtualLink)spec.getSpecificationOf();
if(dreamsVL != null) {
Segment senderSegment = dreamsVL.getRootSegment();
VirtualLink virtualLink = (VirtualLink)spec.getSpecificationOf();
if(virtualLink != null) {
Segment senderSegment = virtualLink.getRootSegment();
if(senderSegment != null) {
Deployment deployment = getParentElement(dreamsVL, Deployment.class, false);
Deployment deployment = getParentElement(virtualLink, Deployment.class, false);
Stream<TransceiverPortAllocation> allocStream =
deployment.getTransceiverPortAllocation().parallelStream();
......
......@@ -33,22 +33,23 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.window.Window;
import org.fortiss.af3.deployment.model.Deployment;
import org.fortiss.af3.exploration.lang.ExplorationExpressionDeploymentValidator;
import org.fortiss.af3.exploration.model.ExplorationConstraint;
import org.fortiss.af3.exploration.model.ExplorationSpecification;
import org.fortiss.af3.exploration.ui.dialog.ListSelectionDialog;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.model.execution.ExecutionConfiguration;
import org.fortiss.tooling.kernel.model.INamedElement;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
/**
* Creates a context menu entry for "Design Space Exploration (DREAMS)" models of AF3 projects that
* enables easy launching (algorithmic) experimental code.
* Creates a context menu entry to validate {@link Deployment}s against a set of
* {@link ExplorationConstraint}s.
*
* @author diewald
* @author $Author: diewald $
* @version $Rev: 1108 $
* @ConQAT.Rating YELLOW Hash: 910ECAD433FE36FD6A3E466AD484D5EE
* @ConQAT.Rating YELLOW Hash: 79AF1FE05C49F60486D449F08CB75CAE
*/
public class DeploymentValidatorStartMenu implements IContextMenuContributor {
......@@ -65,7 +66,7 @@ public class DeploymentValidatorStartMenu implements IContextMenuContributor {
if(selection instanceof Deployment) {
selDeployment = (Deployment)selection;
List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
contributionItems.add(new ActionContributionItem(new ExperimentEasyStartAction()));
contributionItems.add(new ActionContributionItem(new DeploymentValidationAction()));
return contributionItems;
}
return Collections.emptyList();
......@@ -74,8 +75,7 @@ public class DeploymentValidatorStartMenu implements IContextMenuContributor {
/** {@inheritDoc} */
@Override
public String getMenuSectionID() {
// TODO Auto-generated method stub
return null;
return IContextMenuService.AFTER_GLOBAL_MENU_SECTION_ID;
}
/** Returns the icon that is visible in the context menu for this entry. */
......@@ -83,14 +83,14 @@ public class DeploymentValidatorStartMenu implements IContextMenuContributor {
return null;
}
/** Action for executing a {@link ExecutionConfiguration}. */
protected class ExperimentEasyStartAction extends Action {
/** Action for executing a {@link Deployment} validation. */
protected class DeploymentValidationAction extends Action {
/** The target element to be simulated. */
protected INamedElement target;
/** Constructor. */
public ExperimentEasyStartAction() {
public DeploymentValidationAction() {
super(MENU_NAME, getActionIcon());
}
......
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