Switch to side-by-side view

--- a/src/net/timbusproject/extractors/TavernaExtractor.java
+++ b/src/net/timbusproject/extractors/TavernaExtractor.java
@@ -20,15 +20,10 @@
 
 import java.awt.Dimension;
 import java.awt.Point;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringWriter;
+import java.io.*;
 import java.net.URL;
 import java.nio.file.Files;
+import java.nio.file.InvalidPathException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
@@ -49,6 +44,7 @@
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 
+import edu.emory.mathcs.backport.java.util.Arrays;
 import net.sf.taverna.t2.activities.beanshell.BeanshellActivity;
 import net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean;
 import net.sf.taverna.t2.activities.dataflow.DataflowActivity;
@@ -340,6 +336,12 @@
             return;
         }
 
+
+        // current classpath
+        String classpath = System.getProperty("java.class.path");
+        String[] classpathEntries = classpath.split(File.pathSeparator);
+        List<String> cleanClasspathEntries = cleanedClasspath(Arrays.asList(classpathEntries));
+
         factory = IArchimateFactory.eINSTANCE;
 
         IArchimateModel model = factory.createArchimateModel();
@@ -354,7 +356,7 @@
         applicationFolder = model.getFolder(FolderType.APPLICATION);
         relationsFolder = model.getFolder(FolderType.RELATIONS);
 
-        // LAYERD VIEWS
+        // LAYERED VIEWS
         layeredView = factory.createArchimateDiagramModel();
         layeredView.setName("Layered View");
         layeredView.setViewpoint(IViewpoint.LAYERED_VIEWPOINT);
@@ -971,9 +973,7 @@
                 // do proper checking whether the file exists !
                 Path pathToDep = Paths.get(fileName);
                 if (Files.exists(pathToDep)) {
-                    String license = null;
-
-                    license = licenseCheck.extract(pathToDep.toAbsolutePath().toString());
+                    String license = licenseCheck.extract(pathToDep.toAbsolutePath().toString());
 
                     if (license.equals("Unknown license")) {
                         LOGGER.debug("\t Unknown license for dependency [" + item + "].");
@@ -1788,8 +1788,13 @@
 
     private boolean isDotAvailable() {
 
-        // TODO improve checking if DOT is available on system.
         if (dotLocation != null && !dotLocation.isEmpty()) {
+
+            try {
+                Paths.get(dotLocation);
+            }catch(InvalidPathException ipe){
+                return false;
+            }
             return true;
         }
         return false;
@@ -1880,6 +1885,19 @@
         }
     }
 
+
+    private List<String> cleanedClasspath(List<String> classpathEntries){
+
+        List<String> cleanedClasspathEntries = new ArrayList<String>();
+
+        for(String entry : classpathEntries)
+            if(entry.contains("taverna-2."))
+                cleanedClasspathEntries.add(entry);
+
+
+        return cleanedClasspathEntries;
+    }
+
     private URL getJarLocationOfClass(Class clazz) {
         return clazz.getProtectionDomain().getCodeSource().getLocation();
     }