@@ -0,0 +1,1743 @@
+/**%0A * %0A */%0Apackage org.objectweb.proactive.extensions.scheduler.examples.docking;%0A%0Aimport java.io.IOException;%0A%0Aimport javax.swing.JPanel;%0A%0Aimport org.objectweb.proactive.extensions.scheduler.common.task.ResultPreview;%0Aimport org.objectweb.proactive.extensions.scheduler.common.task.TaskResult;%0Aimport org.objectweb.proactive.extensions.scheduler.common.task.util.ResultPreviewTool.SimpleTextPanel;%0A%0A/**%0A * @author cdelbe%0A *%0A */%0Apublic class Mol2FilePreview extends ResultPreview %7B%0A%0A%09private static final String MATCH_PATTERN = %22Produced output file : %22;%0A%0A%09@Override%0A%09public JPanel getGraphicalDescription(TaskResult r) %7B%0A%09%09try %7B%0A%09%09%09String pathToResult = this.getPathToFile(r.getOuput().getStdoutLogs(false));%0A%09%09%09String molEditor = System.getenv(%22MOL_EDITOR%22);%0A%09%09%09if (molEditor==null)%7B%0A%09%09%09%09// mercury is default (supposed to be in the path)%0A%09%09%09%09molEditor = %22mercury%22;%0A%09%09%09%7D%0A%09%09%09String command = molEditor + %22 %22 + pathToResult;%0A%09%09%09try %7B%0A%09%09%09%09Runtime.getRuntime().exec(command); %0A%09%09%09%7D catch (IOException e) %7B%0A%09%09%09%09return new SimpleTextPanel(%22Unable to open external display : %22 + e.getMessage());%0A%09%09%09%7D%0A%09%09%09return new SimpleTextPanel(%22External display : %22 + command);%0A%09%09%7D catch (RuntimeException e) %7B%0A%09%09%09return new SimpleTextPanel(%22Unable to open external display : %22 + e.getMessage());%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public String getTextualDescription(TaskResult r) %7B%0A%09%09return %22Ouput file : %22 + this.getPathToFile(r.getOuput().getStdoutLogs(false));%0A%09%7D%0A%0A%09private String getPathToFile(String output) %7B%0A%09%09int pos = output.indexOf(MATCH_PATTERN, 0);%0A%09%09pos += MATCH_PATTERN.length();%0A%09%09String extracted = output.substring(pos, output.indexOf(%22.mol2%22, pos));%0A%09%09//extracted = ResultPreviewTool.getSystemCompliantPath(extracted);%0A%09%09return extracted + %22.mol2%22;%0A%09%7D%0A%0A%7D%0A

Add viewer for .mol2 files (molecular docking demo)