Bug 563666 - Fix Sonar issues to improve code quality
* removed deprecated applet generation
diff --git a/plugins/org.eclipse.app4mc.multicore.partitioning/plugin.xml b/plugins/org.eclipse.app4mc.multicore.partitioning/plugin.xml
index b97f274..1d0daba 100644
--- a/plugins/org.eclipse.app4mc.multicore.partitioning/plugin.xml
+++ b/plugins/org.eclipse.app4mc.multicore.partitioning/plugin.xml
@@ -8,10 +8,6 @@
             commandId="org.eclipse.app4mc.multicore.partitioning.perform">
       </handler>
       <handler
-            class="org.eclipse.app4mc.multicore.partitioning.handlers.WriteAppletHandler"
-            commandId="org.eclipse.app4mc.multicore.partitioning.visualize">
-      </handler>
-      <handler
             class="org.eclipse.app4mc.multicore.partitioning.handlers.WriteGraphvizHandler"
             commandId="org.eclipse.app4mc.multicore.partitioning.visualize2">
       </handler>
@@ -104,10 +100,6 @@
             name="Perform Partitioning">
       </command>
       <command
-            id="org.eclipse.app4mc.multicore.partitioning.visualize"
-            name="Generate Applet">
-      </command>
-      <command
             id="org.eclipse.app4mc.multicore.partitioning.visualize2"
             name="Generate Graphviz">
       </command>
diff --git a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/IParConstants.java b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/IParConstants.java
index 62fa86b..4e58d06 100644
--- a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/IParConstants.java
+++ b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/IParConstants.java
@@ -26,13 +26,10 @@
 	public static final String PRE_GGP = PREFIX + "boolGGP";
 	public static final String PRE_MIN_EDGES = PREFIX + "boolMinEdges";
 	public static final String PRE_EFF_EDGE = PREFIX + "boolEffEdge";
-	// public static final String PRE_CPP = PREFIX + "boolCPP";
 	public static final String PRE_GCP = PREFIX + "boolGCP";
 	public static final String PRE_PARTITIONING_ALG = PREFIX + "partAlgorithm";
-	// public static final String PRE_ESSP = PREFIX + "boolESSP";
 	public static final String PRE_INT = PREFIX + "intThreads";
 	public static final String PRE_TA = PREFIX + "boolTA";
-	public static final String PRE_VIS = PREFIX + "boolVis";
 	public static final String PRE_LOC_STRING = PREFIX + "loc";
 	public static final String PRE_LOC_RADIO = PREFIX + "locRadio";
 	public static final String PRE_DEBUG = PREFIX + "debug";
diff --git a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/ParPreferenceInitializer.java b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/ParPreferenceInitializer.java
index bc69464..1374a81 100644
--- a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/ParPreferenceInitializer.java
+++ b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/ParPreferenceInitializer.java
@@ -33,12 +33,9 @@
 		this.store.setDefault(IParConstants.PRE_GGP, false);
 		this.store.setDefault(IParConstants.PRE_MIN_EDGES, false);
 		this.store.setDefault(IParConstants.PRE_EFF_EDGE, false);
-		// store.setDefault(IParConstants.PRE_CPP, false);
 		this.store.setDefault(IParConstants.PRE_GCP, false);
-		// store.setDefault(IParConstants.PRE_ESSP, true);
 		this.store.setDefault(IParConstants.PRE_INT, "4");
 		this.store.setDefault(IParConstants.PRE_TA, false);
-		this.store.setDefault(IParConstants.PRE_VIS, false);
 		this.store.setDefault(IParConstants.PRE_DEBUG, false);
 		this.store.setDefault(IParConstants.PRE_LOC_STRING, "output");
 		this.store.setDefault(IParConstants.PRE_LOC_RADIO, "0");
diff --git a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/algorithms/PerformPartitioning.java b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/algorithms/PerformPartitioning.java
index d400b53..4520b05 100755
--- a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/algorithms/PerformPartitioning.java
+++ b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/algorithms/PerformPartitioning.java
@@ -34,7 +34,6 @@
 import org.eclipse.app4mc.amalthea.model.SWModel;
 import org.eclipse.app4mc.multicore.partitioning.IParConstants;
 import org.eclipse.app4mc.multicore.partitioning.PartitioningPlugin;
-import org.eclipse.app4mc.multicore.partitioning.handlers.WriteAppletHandler;
 import org.eclipse.app4mc.multicore.partitioning.utils.CreateTAInput;
 import org.eclipse.app4mc.multicore.partitioning.utils.CycleElimination;
 import org.eclipse.app4mc.multicore.partitioning.utils.Helper;
@@ -130,13 +129,6 @@
 			Helper.writeModelFile(outputParser.parseOutputFileURI(file, "_TAInput"), amodels);
 			PartLog.getInstance().log("**Generating a runnable sequencing constraints alternative finished**");
 		}
-		if (store.getBoolean(IParConstants.PRE_VIS)) {
-			PartLog.getInstance().log("**Generating Applet**");
-			final WriteAppletHandler wa = new WriteAppletHandler();
-			wa.write(amodels.getSwModel(), amodels.getConstraintsModel(), file.getLocation().toString());
-			PartLog.getInstance().log("**Applet generation finished**");
-		}
-
 
 		// print result
 		final long swmInstructionsCount = getSWMInstructions(amodels.getSwModel());
diff --git a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/handlers/WriteAppletHandler.java b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/handlers/WriteAppletHandler.java
deleted file mode 100644
index c14a3a5..0000000
--- a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/handlers/WriteAppletHandler.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017-2020 Dortmund University of Applied Sciences and Arts and others.
- *  
- *  This program and the accompanying materials are made
- *  available under the terms of the Eclipse Public License 2.0
- *  which is available at https://www.eclipse.org/legal/epl-2.0/
- *   
- *  SPDX-License-Identifier: EPL-2.0
- *  
- *  Contributors:
- *      Dortmund University of Applied Sciences and Arts - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.app4mc.multicore.partitioning.handlers;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Writer;
-
-import org.apache.log4j.Level;
-import org.eclipse.app4mc.amalthea.model.ConstraintsModel;
-import org.eclipse.app4mc.amalthea.model.ProcessPrototype;
-import org.eclipse.app4mc.amalthea.model.Runnable;
-import org.eclipse.app4mc.amalthea.model.RunnableCall;
-import org.eclipse.app4mc.amalthea.model.RunnableSequencingConstraint;
-import org.eclipse.app4mc.amalthea.model.SWModel;
-import org.eclipse.app4mc.multicore.partitioning.utils.CycleElimination;
-import org.eclipse.app4mc.multicore.partitioning.utils.PartLog;
-import org.eclipse.app4mc.multicore.partitioning.utils.TopologicalCalculation;
-import org.eclipse.app4mc.multicore.sharelibs.UniversalHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Writes an Applet, that can be either startet from eclipse or loaded within a webpage, in order to visualize and move the runnables as rectangles. Requires
- * constrainsmodel with RunnableSequencingConstraints (dependencies) referencing runnables from a Softwaremodel
- */
-public class WriteAppletHandler extends org.eclipse.core.commands.AbstractHandler {
-	private ConstraintsModel cm;
-	private SWModel swm;
-	private static final int XDISTANCE = 275;
-	private static final int YDISTANCE = 75;
-
-	public WriteAppletHandler(final SWModel swm, final ConstraintsModel cm) {
-		this.swm = swm;
-		this.cm = cm;
-	}
-
-	public WriteAppletHandler() {
-	}
-
-	String className = "";
-
-
-	public void write(final SWModel swmi, final ConstraintsModel cmi, String file) {
-		this.swm = swmi;
-		this.cm = cmi;
-		final String fname = ".amxmi";
-		PartLog.getInstance().setEnableTargetConsoleLog(true);
-		PartLog.getInstance().setEnableSourceConsoleLog(true);
-		PartLog.getInstance().setLogName("Applet Writer");
-		final StringBuilder output = new StringBuilder();
-		this.className = "applet";
-		if (file == null) {
-			this.className = "applet";
-			file = "applet.java";
-		}
-		else if (file.endsWith(fname)) {
-			file = file.replace(fname, "_Applet.java");
-			if (file.contains("\\")) {
-				this.className = file.substring(file.lastIndexOf('\\') + 1, file.lastIndexOf('.'));
-			}
-			else {
-				this.className = file.substring(0, file.lastIndexOf('.'));
-			}
-		}
-		else if (!file.endsWith(fname)) {
-			PartLog.getInstance().log("Applet can only be generated for .amxmi files", null);
-			return;
-		}
-		PartLog.getInstance().log("File: " + file + " Classname: " + this.className);
-		try {
-			fillOutput(output);
-		}
-		catch (final Exception e) {
-			PartLog.getInstance().getMyPartLog().log(Level.ERROR, " ", e);
-		}
-		try (Writer w = new BufferedWriter(new FileWriter(file))) {
-			w.write(output.toString());
-			PartLog.getInstance().log("Applet written: " + file + " (please refresh Project / Model Explorer)");
-		}
-		catch (final IOException e) {
-			PartLog.getInstance().log("Writing file aborted: " + e.getMessage());
-			PartLog.getInstance().getMyPartLog().log(Level.ERROR, " ", e);
-		}
-	}
-
-	private void fillOutput(final StringBuilder output) {
-		output.append(initString());
-		final CycleElimination ce = new CycleElimination(this.swm, this.cm);
-		if (ce.containsCycles()) {
-			ce.run(null);
-		}
-		if (this.cm.getRunnableSequencingConstraints().isEmpty() || this.swm.getRunnables().isEmpty()) {
-			// at least runnables and dependencies must be here
-			PartLog.getInstance().log("No Runnables or Sequencing Constraints present. ABORTING", null);
-			return;
-		}
-		for (final Runnable r : this.swm.getRunnables()) {
-			tryWriteVertex(output, r);
-		}
-		output.append("\n");
-		for (final RunnableSequencingConstraint rsc : this.cm.getRunnableSequencingConstraints()) {
-			tryWritingEdge(output, rsc);
-		}
-		int size = 0;
-
-		final Runnable fr = new TopologicalCalculation(this.swm, this.cm).getFarthestNode(Integer.MAX_VALUE);
-		size = new TopologicalCalculation(this.swm, this.cm).calcNodesToSink(fr);
-		final int[] x = new int[size + 1];
-		for (int i = 0; i < size; i++) {
-			x[i] = 0;
-		}
-		if (this.swm.getProcessPrototypes().size() <= 1) {
-			for (final Runnable r : this.swm.getRunnables()) {
-				tryWritingVertex(output, size, x, r);
-			}
-		}
-		else {
-			int xpos = 0;
-			for (final ProcessPrototype pp : this.swm.getProcessPrototypes()) {
-				int ypos = 0;
-				for (final RunnableCall trc : pp.getRunnableCalls()) {
-					output.append("		positionVertexAt(\"" + trc.getRunnable().getName() + "\", " + Integer.toString(xpos * WriteAppletHandler.XDISTANCE)
-							+ ", " + Integer.toString(ypos * WriteAppletHandler.YDISTANCE) + ");\n");
-					ypos++;
-				}
-				xpos++;
-			}
-		}
-		output.append("\n } \n ");
-		output.append(endString());
-	}
-
-	private void tryWriteVertex(final StringBuilder output, final Runnable r) {
-		try {
-			output.append("		g.addVertex(\"" + r.getName() + "\");\n");
-		}
-		catch (final Exception e) {
-			PartLog.getInstance().getMyPartLog().log(Level.ERROR, " ", e);
-		}
-	}
-
-	private void tryWritingVertex(final StringBuilder output, final int size, final int[] x, final Runnable r) {
-		try {
-			final int temp = size - new TopologicalCalculation(this.swm, this.cm).calcNodesToSink(r);
-
-			output.append("		positionVertexAt(\"" + r.getName() + "\", " + Integer.toString(x[temp] * WriteAppletHandler.XDISTANCE) + ", "
-					+ Integer.toString(temp * WriteAppletHandler.YDISTANCE) + ");\n");
-			x[temp]++;
-		}
-		catch (final Exception e) {
-			PartLog.getInstance().getMyPartLog().log(Level.ERROR, " ", e);
-		}
-	}
-
-	private void tryWritingEdge(final StringBuilder output, final RunnableSequencingConstraint rsc) {
-		try {
-			output.append("		g.addEdge(\"" + rsc.getRunnableGroups().get(0).getRunnables().get(0).getName() + "\",\""
-					+ rsc.getRunnableGroups().get(1).getRunnables().get(0).getName() + "\");\n");
-		}
-		catch (final Exception e) {
-			PartLog.getInstance().getMyPartLog().log(Level.ERROR, " ", e);
-		}
-	}
-
-	private String endString() {
-		final String str = "		}\n";
-		return "	private void adjustDisplaySettings(final JGraph jg) {\n" + "		jg.setPreferredSize(DEFAULT_SIZE);\n" + "\n"
-				+ "		Color c = DEFAULT_BG_COLOR;\n" + "		String colorStr = null;\n" + "\n" + "		try {\n"
-				+ "			colorStr = getParameter(\"bgcolor\");\n" + str + "		catch (final Exception e) {\n" + str + "\n"
-				+ "		if (colorStr != null) {\n" + "			c = Color.decode(colorStr);\n" + str + "\n" + "		jg.setBackground(c);\n" + "	}\n" + "\n"
-				+ "\n" + "	private void positionVertexAt(final Object vertex, final int x, final int y) {\n"
-				+ "		final DefaultGraphCell cell = this.m_jgAdapter.getVertexCell(vertex);\n" + "		final Map attr = cell.getAttributes();\n"
-				+ "		final Rectangle2D b = GraphConstants.getBounds(attr);\n" + "		b.setRect(x, y, 250, b.getHeight());\n"
-				+ "		GraphConstants.setBounds(attr, b);\n" + "\n" + "		final Map cellAttr = new HashMap();\n" + "		cellAttr.put(cell, attr);\n"
-				+ "		this.m_jgAdapter.edit(cellAttr, null, null, null);\n" + "	}\n" + "}";
-	}
-
-	private String initString() {
-		int maxRcount = 0;
-		for (final ProcessPrototype pp : this.swm.getProcessPrototypes()) {
-			if (pp.getRunnableCalls().size() > maxRcount) {
-				maxRcount = pp.getRunnableCalls().size();
-			}
-		}
-		return "package MyPackage;\n" + "\n" + "import java.awt.Color;\n" + "import java.awt.Dimension;\n" + "import java.awt.geom.Rectangle2D;\n"
-				+ "import java.util.HashMap;\n" + "import java.util.Map;\n" + "\n" + "import javax.swing.JApplet;\n" + "import javax.swing.JScrollPane;\n"
-				+ "\n" + "import org.jgraph.JGraph;\n" + "import org.jgraph.graph.DefaultGraphCell;\n" + "import org.jgraph.graph.GraphConstants;\n"
-				+ "import org.jgrapht.ListenableGraph;\n" + "import org.jgrapht.ext.JGraphModelAdapter;\n" + "import org.jgrapht.graph.DefaultEdge;\n"
-				+ "import org.jgrapht.graph.ListenableDirectedGraph;\n" + "\n" + "public class " + this.className + " extends JApplet {\n"
-				+ "	private static final Color DEFAULT_BG_COLOR = Color.decode(\"#FAFBFF\");\n"
-				+ "	private static final Dimension DEFAULT_SIZE = new Dimension(" + this.swm.getProcessPrototypes().size() * WriteAppletHandler.XDISTANCE + ", "
-				+ maxRcount * WriteAppletHandler.YDISTANCE + ");\n" + "	private JGraphModelAdapter m_jgAdapter;\n" + "\n" + "	@Override\n"
-				+ "	public void init() {\n" + "		// create a JGraphT graph\n"
-				+ "		final ListenableGraph g = new ListenableDirectedGraph(DefaultEdge.class);\n"
-				+ "		// create a visualization using JGraph, via an adapter\n" + "		this.m_jgAdapter = new JGraphModelAdapter(g);\n"
-				+ "		final JGraph jgraph = new JGraph(this.m_jgAdapter);\n" + "		adjustDisplaySettings(jgraph);\n"
-				+ "		getContentPane().add(jgraph);\n" + "		JScrollPane sp = new JScrollPane(jgraph);\n"
-				+ "		sp.setPreferredSize(DEFAULT_SIZE);\n" + "		getContentPane().add( sp);\n" + "		resize(new Dimension(1000,800));\n";
-	}
-
-	public ConstraintsModel getCm() {
-		return this.cm;
-	}
-
-	public void setCm(final ConstraintsModel cm) {
-		this.cm = cm;
-	}
-
-	public SWModel getSwm() {
-		return this.swm;
-	}
-
-	public void setSwm(final SWModel swm) {
-		this.swm = swm;
-	}
-
-	@Override
-	public Object execute(final ExecutionEvent event) throws ExecutionException {
-		PartLog.getInstance().setLogName("Applet Writer");
-		PartLog.getInstance().setEnableSourceConsoleLog(true);
-		PartLog.getInstance().setEnableTargetConsoleLog(true);
-		PartLog.getInstance().log("Starting to generate an applet...");
-		final ISelection selection = HandlerUtil.getCurrentSelection(event);
-		if (selection instanceof IStructuredSelection) {
-			final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-			Object element = structuredSelection.getFirstElement();
-			if (element instanceof IAdaptable) {
-				final Object adapter = ((IAdaptable) element).getAdapter(IFile.class);
-				if (adapter instanceof IFile) {
-					element = adapter;
-				}
-			}
-			if (element instanceof IFile) {
-				try {
-					final IFile file = (IFile) element;
-					tryPerform(file);
-				}
-				catch (final Exception e) {
-					PartLog.getInstance().log("Error during writing Applet");
-					PartLog.getInstance().getMyPartLog().log(Level.ERROR, " ", e);
-				}
-			}
-		}
-		return null;
-	}
-
-	private void tryPerform(final IFile file) {
-		try {
-			perform(file);
-		}
-		catch (final Exception e) {
-			PartLog.getInstance().log("File " + file.getFullPath().toString() + " can not be visualized. File must provide label analysis!");
-		}
-	}
-
-	private void perform(final IFile file) {
-		final URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
-		UniversalHandler.getInstance().dropCache();
-		UniversalHandler.getInstance().readModels(uri, false);
-		this.swm = UniversalHandler.getInstance().getSwModel();
-		this.cm = UniversalHandler.getInstance().getConstraintsModel();
-		if (this.swm == null || this.swm.getRunnables().isEmpty()) {
-			PartLog.getInstance().log("Failed: Applet generation requires valid software model.\n");
-			return;
-		}
-		if (this.cm == null || this.cm.getRunnableSequencingConstraints().isEmpty()) {
-			PartLog.getInstance().log("Failed: Applet generation requires valid constraints model.\n");
-			return;
-		}
-
-		try {
-			write(this.swm, this.cm, file.getRawLocation().toOSString());
-		}
-		catch (final Exception e) {
-			PartLog.getInstance().getMyPartLog().log(Level.ERROR, " ", e);
-		}
-	}
-}
diff --git a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/handlers/WriteGraphvizHandler.java b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/handlers/WriteGraphvizHandler.java
index 4550284..f0229df 100644
--- a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/handlers/WriteGraphvizHandler.java
+++ b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/handlers/WriteGraphvizHandler.java
@@ -50,7 +50,6 @@
 		final boolean validRSCs = new Helper().allRSCsHave2ValidEntries(cm.getRunnableSequencingConstraints());
 		final Set<RunnableSequencingConstraint> writtenRSCs = new HashSet<>();
 		final String filename = this.file.getName().substring(0, this.file.getName().lastIndexOf('.'));
-		//		Writer output = null;
 		try (Writer output = new BufferedWriter(new FileWriter(
 				new File(this.file.getRawLocation().toString().substring(0, this.file.getRawLocation().toString().lastIndexOf('/')), filename + ".dot")))) {
 			output.write("digraph G { \n");
@@ -84,7 +83,7 @@
 	}
 
 	private void writeSubGraphPerPP(final SWModel swm, final ConstraintsModel cm, final boolean validRSCs, final Set<RunnableSequencingConstraint> writtenRSCs,
-			Writer output) throws IOException {
+			final Writer output) throws IOException {
 		for (final ProcessPrototype pp : swm.getProcessPrototypes()) {
 			output.write("subgraph cluster_" + swm.getProcessPrototypes().indexOf(pp)
 					+ " { \n style=filled; \n color=lightgrey; \n node [style=filled,color=white];\n");
diff --git a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/workflow/GenerateApplet.java b/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/workflow/GenerateApplet.java
deleted file mode 100644
index eb7cbcd..0000000
--- a/plugins/org.eclipse.app4mc.multicore.partitioning/src/org/eclipse/app4mc/multicore/partitioning/workflow/GenerateApplet.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017-2020 Dortmund University of Applied Sciences and Arts and others.
- *  
- *  This program and the accompanying materials are made
- *  available under the terms of the Eclipse Public License 2.0
- *  which is available at https://www.eclipse.org/legal/epl-2.0/
- *   
- *  SPDX-License-Identifier: EPL-2.0
- *  
- *  Contributors:
- *      Dortmund University of Applied Sciences and Arts - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.app4mc.multicore.partitioning.workflow;
-
-import org.eclipse.app4mc.amalthea.model.Amalthea;
-import org.eclipse.app4mc.amalthea.workflow.core.Context;
-import org.eclipse.app4mc.amalthea.workflow.core.WorkflowComponent;
-import org.eclipse.app4mc.multicore.partitioning.handlers.WriteAppletHandler;
-import org.eclipse.app4mc.multicore.partitioning.utils.PartLog;
-
-public class GenerateApplet extends WorkflowComponent {
-
-	private static final boolean ENABLELOG = false;
-	private String outputDir;
-
-	@Override
-	protected void runInternal(final Context ctx) {
-		final Amalthea modelCopy = getAmaltheaModelCopy(ctx);
-		assert null != modelCopy.getSwModel() && null != modelCopy.getConstraintsModel();
-		PartLog.getInstance().setLogName("Applet generation");
-		if (modelCopy.getSwModel().getRunnables().isEmpty() || modelCopy.getConstraintsModel().getRunnableSequencingConstraints().isEmpty()) {
-			PartLog.getInstance().log("Applet Input is not correct. No Runnables / Sequencing Constraints available!!", null);
-			return;
-		}
-		if (isEnableLog()) {
-			PartLog.getInstance().setEnableSourceConsoleLog(true);
-		}
-		final WriteAppletHandler wa = new WriteAppletHandler();
-		wa.write(modelCopy.getSwModel(), modelCopy.getConstraintsModel(), this.outputDir);
-		if (this.outputDir == null) {
-			this.outputDir = "-Project folder-";
-		}
-		PartLog.getInstance().log("No result slot needed for Applet generation. Applet has been saved at " + this.outputDir + ".");
-		PartLog.getInstance().log("Applet generation finished");
-	}
-
-	private boolean isEnableLog() {
-		return GenerateApplet.ENABLELOG;
-	}
-
-	public String getOutputDir() {
-		return this.outputDir;
-	}
-
-	public void setOutputDir(final String outputDir) {
-		this.outputDir = outputDir;
-	}
-}