[med-svn] [jmodeltest] 02/14: Imported Upstream version 2.1.9+dfsg
Andreas Tille
tille at debian.org
Tue May 10 13:00:04 UTC 2016
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository jmodeltest.
commit d9247988673a082beab59909de066cb1fc32db0a
Author: Andreas Tille <tille at debian.org>
Date: Fri Jan 15 17:38:51 2016 +0100
Imported Upstream version 2.1.9+dfsg
---
build.xml | 18 ++--
manual/manual.tex | 9 ++
.../darwin/jmodeltest/ApplicationOptions.java | 7 +-
.../java/es/uvigo/darwin/jmodeltest/ModelTest.java | 48 ++++------
.../darwin/jmodeltest/ModelTestConfiguration.java | 6 +-
.../jmodeltest/exception/InternalException.java | 2 +-
.../darwin/jmodeltest/exe/PhymlSingleModel.java | 33 ++++---
.../es/uvigo/darwin/jmodeltest/exe/RunPhyml.java | 106 +++++++++++++++++++--
.../es/uvigo/darwin/jmodeltest/gui/FrameMain.java | 4 +-
.../es/uvigo/darwin/jmodeltest/gui/XManager.java | 5 +-
.../es/uvigo/darwin/jmodeltest/gui/icons/JMT24.gif | Bin
.../es/uvigo/darwin/jmodeltest/gui/icons/JMT48.gif | Bin
.../es/uvigo/darwin/jmodeltest/gui/icons/JMT96.gif | Bin
.../uvigo/darwin/jmodeltest/gui/icons/Open16.gif | Bin
.../uvigo/darwin/jmodeltest/gui/icons/Open24.gif | Bin
.../uvigo/darwin/jmodeltest/io/HtmlReporter.java | 1 +
.../darwin/jmodeltest/tree/TreeDistancesCache.java | 2 +-
.../darwin/jmodeltest/utilities/Utilities.java | 33 +++++--
src/main/resources/CHANGELOG | 7 ++
src/main/resources/README | 2 +-
src/main/resources/conf/jmodeltest.conf | 5 +-
21 files changed, 205 insertions(+), 83 deletions(-)
diff --git a/build.xml b/build.xml
index 9912efd..0052998 100644
--- a/build.xml
+++ b/build.xml
@@ -2,7 +2,8 @@
<project name="jModelTest" default="jar" basedir=".">
<property name="src.dir" location="src/main/java" />
- <property name="bin.dir" location="build/classes" />
+ <property name="build.base.dir" location="build" />
+ <property name="build.dir" location="${build.base.dir}/classes" />
<property name="lib.dir" location="lib" />
<property name="dist.dir" location="dist" />
<property name="exe.dir" location="${dist.dir}/exe/phyml" />
@@ -28,26 +29,23 @@
</target>
<target name="compile" description="Compile code">
- <mkdir dir="${bin.dir}" />
+ <mkdir dir="${build.dir}" />
<mkdir dir="${lib.dir}" />
<property environment="env" />
<property name="java6.boot.classpath" value="${env.JAVA6_BOOTCLASSES}" />
- <javac srcdir="${src.dir}" destdir="${bin.dir}" includeAntRuntime="no"
+ <javac srcdir="${src.dir}" destdir="${build.dir}" includeAntRuntime="no"
target="1.6" source="1.6" bootclasspath="${java5.boot.classpath}"
classpathref="lib.path" debug="${compile.debug}">
<compilerarg value="-Xlint:all"/>
</javac>
- <copy todir="${bin.dir}/es">
- <fileset dir="${src.resources.dir}/es" includes="**/*.xml,**/*.properties,**/*.gif,**/*.ico" />
- </copy>
-
</target>
<target name="jar" depends="compile" description="Build jar">
<mkdir dir="${dist.dir}" />
- <jar jarfile="${jarfile}" basedir="${bin.dir}" manifest="Manifest">
+ <jar jarfile="${jarfile}" basedir="${build.dir}" manifest="Manifest">
+ <fileset dir="${src.dir}" includes="**/*.xml,**/*.properties,**/*.gif,**/*.ico" />
<!-- Merge library jars into final jar file
- <zipgroupfileset refid="lib.jars"/>-->
+ <zipgroupfileset refid="lib.jars"/>-->
</jar>
<mkdir dir="${dist.dir}/lib" />
<copy todir="${dist.dir}/lib">
@@ -70,7 +68,7 @@
</target>
<target name="clean" description="Remove build and dist directories">
- <delete dir="${bin.dir}" />
+ <delete dir="${build.base.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${manual.dir}" includes="*.aux *.bbl *.out *.toc *.log *.blg *.dvi" />
</target>
diff --git a/manual/manual.tex b/manual/manual.tex
index 62bc31e..5adc82f 100644
--- a/manual/manual.tex
+++ b/manual/manual.tex
@@ -88,6 +88,15 @@ These programs are protected by their own license and conditions, and using jMod
\begin{itemize}
+ \item 15 Jan 2016 - Version 2.1.9
+
+ \begin{itemize}
+ \item Added automatic search for PhyML binary in /usr/bin
+ \item Removed non-ASCII characters
+ \item Disable logging if writing is not possible
+ \item Merge GUI images into jarfile
+ \end{itemize}
+
\item 20 Oct 2015 - Version 2.1.8
\begin{itemize}
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/ApplicationOptions.java b/src/main/java/es/uvigo/darwin/jmodeltest/ApplicationOptions.java
index f632b4e..c3e570d 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/ApplicationOptions.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/ApplicationOptions.java
@@ -169,7 +169,12 @@ public class ApplicationOptions implements Serializable {
if (ModelTestConfiguration.isPhymlLogEnabled() && getInputFile() != null) {
logFile = new File(ModelTestConfiguration.getLogDir() + File.separator + getInputFile().getName()
+ ".phyml." + executionName + ".log");
- } else {
+ if (!logFile.canWrite())
+ {
+ logFile = null;
+ }
+ }
+ if (logFile == null) {
logFile = File.createTempFile("jmodeltest-phyml", ".log");
logFile.deleteOnExit();
}
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/ModelTest.java b/src/main/java/es/uvigo/darwin/jmodeltest/ModelTest.java
index 20d4c2d..5393bf0 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/ModelTest.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/ModelTest.java
@@ -96,7 +96,7 @@ public class ModelTest {
public static final double INFINITY = 9999;
public static final int MAX_NUM_MODELS = 88;
public static final int MAX_NAME = 60;
- public static final String CURRENT_VERSION = "2.1.8 v20151020";
+ public static final String CURRENT_VERSION = "2.1.9 v20160115";
public static final String programName = ("jModeltest");
public static final String URL = "http://code.google.com/p/jmodeltest2";
public static final String WIKI = "http://code.google.com/p/jmodeltest2/wiki/GettingStarted";
@@ -165,15 +165,7 @@ public class ModelTest {
execMode = ExecMode.GUI;
XManager.getInstance();
// Check binary
- if (!ModelTestConfiguration.isGlobalPhymlBinary()) {
- if (!RunPhyml.phymlBinary.exists()) {
- Utilities
- .printRed("ERROR: PhyML binary cannot be found: " + RunPhyml.phymlBinary.getAbsolutePath() + "\n");
- } else if (!RunPhyml.phymlBinary.canExecute()) {
- Utilities
- .printRed("ERROR: PhyML binary exists, but it cannot be executed: " + RunPhyml.phymlBinary.getAbsolutePath() + "\n");
- }
- }
+ RunPhyml.checkBinary();
} else {
System.err.println("");
System.err.println("ERROR: You are trying to run a GUI interface in a headless server.");
@@ -189,17 +181,21 @@ public class ModelTest {
execMode = ExecMode.CONSOLE;
ParseArguments();
+ if (MPJ_ME == 0) {
+ // print header information
+ printHeader(MAIN_CONSOLE);
+
+ // print citation information
+ printCitation(MAIN_CONSOLE);
+
+ // print notice information
+ printNotice(MAIN_CONSOLE);
+ }
+
// Check binary
- if (!ModelTestConfiguration.isGlobalPhymlBinary()) {
- if (!RunPhyml.phymlBinary.exists()) {
- System.err.println(" ");
- System.err.println("ERROR: PhyML binary cannot be found: " + RunPhyml.phymlBinary.getAbsolutePath());
- finalize(-1);
- } else if (!RunPhyml.phymlBinary.canExecute()) {
- System.err.println(" ");
- System.err.println("ERROR: PhyML binary exists, but it cannot be executed: " + RunPhyml.phymlBinary.getAbsolutePath());
- finalize(-1);
- }
+ if (!RunPhyml.checkBinary())
+ {
+ finalize(-1);
}
options.createLogFile();
@@ -300,15 +296,6 @@ public class ModelTest {
public void runCommandLine() {
if (MPJ_ME == 0) {
- // print header information
- printHeader(MAIN_CONSOLE);
-
- // print citation information
- printCitation(MAIN_CONSOLE);
-
- // print notice information
- printNotice(MAIN_CONSOLE);
-
// print the command line
MAIN_CONSOLE.println(" ");
MAIN_CONSOLE.print("Arguments =");
@@ -1389,7 +1376,8 @@ public class ModelTest {
stream.println("jModelTest " + CURRENT_VERSION);
stream.println("Copyright (C) 2011 D. Darriba, G.L. Taboada, R. Doallo and D. Posada");
stream.println("This program comes with ABSOLUTELY NO WARRANTY");
- stream.println("This is free software, and you are welcome to redistribute it under certain conditions");
+ stream.println("This is free software, and you are welcome to redistribute it under certain");
+ stream.println("conditions");
stream.println(" ");
stream.println("Notice: This program may contain errors. Please inspect results carefully.");
stream.println(" ");
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/ModelTestConfiguration.java b/src/main/java/es/uvigo/darwin/jmodeltest/ModelTestConfiguration.java
index ac88975..a9b4a66 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/ModelTestConfiguration.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/ModelTestConfiguration.java
@@ -114,9 +114,9 @@ public abstract class ModelTestConfiguration {
}
if (!existsKey(LOG_DIR)) {
- APPLICATION_PROPERTIES.setProperty(HTML_LOG, "disabled");
- APPLICATION_PROPERTIES.setProperty(PHYML_LOG, "disabled");
- APPLICATION_PROPERTIES.setProperty(CKP_LOG, "disabled");
+ disableHtmlLog();
+ disablePhymlLog();
+ disableCkpLog();
}
} catch (IOException e) {
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/exception/InternalException.java b/src/main/java/es/uvigo/darwin/jmodeltest/exception/InternalException.java
index cef9583..8e9e91d 100755
--- a/src/main/java/es/uvigo/darwin/jmodeltest/exception/InternalException.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/exception/InternalException.java
@@ -20,7 +20,7 @@ package es.uvigo.darwin.jmodeltest.exception;
/**
* The Class ProtTestInternalException.
*
- * @author Diego Darriba López
+ * @author Diego Darriba
*/
public class InternalException extends RuntimeException {
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/exe/PhymlSingleModel.java b/src/main/java/es/uvigo/darwin/jmodeltest/exe/PhymlSingleModel.java
index 610afc4..a1db6df 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/exe/PhymlSingleModel.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/exe/PhymlSingleModel.java
@@ -23,12 +23,9 @@ import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Observable;
-import javax.sql.rowset.spi.SyncResolver;
-
import pal.tree.TreeParseException;
import es.uvigo.darwin.jmodeltest.ApplicationOptions;
import es.uvigo.darwin.jmodeltest.ModelTest;
-import es.uvigo.darwin.jmodeltest.ModelTestConfiguration;
import es.uvigo.darwin.jmodeltest.io.TextInputStream;
import es.uvigo.darwin.jmodeltest.model.Model;
import es.uvigo.darwin.jmodeltest.observer.ProgressInfo;
@@ -64,9 +61,9 @@ public class PhymlSingleModel extends Observable implements Runnable {
this.ignoreGaps = ignoreGaps;
this.phymlStatFileName = options.getAlignmentFile().getAbsolutePath()
- + RunPhyml.PHYML_STATS_SUFFIX + model.getName() + ".txt";
+ + RunPhyml.PHYML_STATS_SUFFIX + model.getName();
this.phymlTreeFileName = options.getAlignmentFile().getAbsolutePath()
- + RunPhyml.PHYML_TREE_SUFFIX + model.getName() + ".txt";
+ + RunPhyml.PHYML_TREE_SUFFIX + model.getName();
}
public PhymlSingleModel(Model model, int index, boolean justGetJCTree,
@@ -217,8 +214,9 @@ public class PhymlSingleModel extends Observable implements Runnable {
private void executeCommandLine() {
String[] executable = new String[1];
+ boolean printLog = options.getLogFile() != null;
try {
- if (!ModelTestConfiguration.isGlobalPhymlBinary()) {
+ if (!RunPhyml.isPhymlGlobal()) {
if (!RunPhyml.phymlBinary.exists()) {
notifyObservers(
ProgressInfo.ERROR_BINARY_NOEXISTS, index, model, RunPhyml.phymlBinary.getAbsolutePath());
@@ -246,12 +244,16 @@ public class PhymlSingleModel extends Observable implements Runnable {
// any output?
FileOutputStream logFile = new FileOutputStream(
options.getLogFile(), true);
- StreamGobbler outputGobbler = new StreamGobbler(
+ StreamGobbler outputGobbler = null;
+
+ if (printLog)
+ outputGobbler = new StreamGobbler(
proc.getInputStream(), "PHYML", logFile, ModelTest.getPhymlConsole());
// kick them off
errorGobbler.start();
- outputGobbler.start();
+ if (printLog)
+ outputGobbler.start();
// any error???
int exitVal = proc.waitFor();
@@ -280,7 +282,7 @@ public class PhymlSingleModel extends Observable implements Runnable {
if (ModelTest.getPhymlConsole() != null) {
synchronized (ModelTest.getPhymlConsole()) {
ModelTest.getPhymlConsole().println(" ");
- ModelTest.getPhymlConsole().println("Command line used for process "+ outputGobbler.getRunId() +":");
+ ModelTest.getPhymlConsole().println("Command line used for process "+ errorGobbler.getRunId() +":");
ModelTest.getPhymlConsole().println(" " + RunPhyml.phymlBinary.getAbsolutePath() + " "
+ uCommand);
ModelTest.getPhymlConsole().println(" ");
@@ -288,7 +290,6 @@ public class PhymlSingleModel extends Observable implements Runnable {
ModelTest.getPhymlConsole().close();
}
}
-
} catch (InterruptedException e) {
notifyObservers(ProgressInfo.INTERRUPTED, index, model, null);
interrupted = true;
@@ -314,11 +315,13 @@ public class PhymlSingleModel extends Observable implements Runnable {
boolean showParsing = false;
- // Get model likelihood
- // TextInputStream phymlLkFile = new TextInputStream(phymlLkFileName);
- // currentModel.lnL = (-1.0) * phymlLkFile.readFloat();
- // phymlLkFile.close();
-
+ File f = new File(phymlStatFileName);
+ if (!f.exists())
+ {
+ phymlStatFileName += ".txt";
+ phymlTreeFileName += ".txt";
+ }
+
// Get model likelihood and parameter estimates
try {
TextInputStream phymlStatFile = new TextInputStream(
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/exe/RunPhyml.java b/src/main/java/es/uvigo/darwin/jmodeltest/exe/RunPhyml.java
index 52d43b7..809ef57 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/exe/RunPhyml.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/exe/RunPhyml.java
@@ -17,7 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package es.uvigo.darwin.jmodeltest.exe;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -60,7 +64,8 @@ public abstract class RunPhyml extends Observable implements Observer {
protected Model[] models;
protected Model gtrModel = null;
- public static final String PHYML_VERSION = "3.0";
+ public static final String[] COMPATIBLE_VERSIONS = {"20130103", "20131022", "20141009", "20141029", "20150501"};
+ public static String PHYML_VERSION = "3.0";
public static String PHYML_TREE_SUFFIX = "_phyml_tree_";
public static String PHYML_STATS_SUFFIX = "_phyml_stats_";
@@ -68,16 +73,93 @@ public abstract class RunPhyml extends Observable implements Observer {
public static File phymlBinary;
public static String phymlBinaryStr;
private static String CURRENT_DIRECTORY = ModelTestConfiguration.PATH;
- private static boolean PHYML_GLOBAL = false;
+ private static boolean PHYML_GLOBAL = ModelTestConfiguration.isGlobalPhymlBinary();
public static String PHYML_PATH = CURRENT_DIRECTORY + "exe/phyml/";
-
+ private static boolean compatiblePhyml = false;
protected Observer progress;
+ public static boolean isCompatible() {
+ return compatiblePhyml;
+ }
+
+ public static boolean checkBinary() {
+ boolean canExecute = false;
+ if (!ModelTestConfiguration.isGlobalPhymlBinary()) {
+ if (!RunPhyml.phymlBinary.exists()) {
+ Utilities
+ .printRed("ERROR: PhyML binary cannot be found: " + RunPhyml.phymlBinary.getAbsolutePath() + "\n");
+ } else if (!RunPhyml.phymlBinary.canExecute()) {
+ Utilities
+ .printRed("ERROR: PhyML binary exists, but it cannot be executed: " + RunPhyml.phymlBinary.getAbsolutePath() + "\n");
+ } else if (!RunPhyml.isCompatible()){
+ Utilities
+ .printRed("WARNING: PhyML binary is not in the list of compatibility: \n");
+ Utilities
+ .printRed(RunPhyml.phymlBinary.getAbsolutePath() + " v" + RunPhyml.PHYML_VERSION +"\n");
+ Utilities.printRed("Compatible versions: ");
+ for (int i=0; i<RunPhyml.COMPATIBLE_VERSIONS.length; i++)
+ Utilities.printBlue(RunPhyml.COMPATIBLE_VERSIONS[i] + " ");
+ Utilities.printBlue("\n");
+ Utilities
+ .printRed("jModelTest will try to continue execution anyway, but it might fail.\n");
+ canExecute = true;
+ } else {
+ Utilities
+ .printBlue("PhyML binary: " + RunPhyml.phymlBinary.getAbsolutePath() + " v" + RunPhyml.PHYML_VERSION + "\n");
+ canExecute = true;
+ }
+ }
+ return canExecute;
+ }
+ private static boolean checkPhymlCompatibility(String binary) {
+ boolean binaryFound = false;
+ if (Utilities.findCurrentOS() != Utilities.OS_LINUX)
+ return false;
+ // get process and execute command line
+ String cmd[] = {binary, "--version"};
+ Runtime rt = Runtime.getRuntime();
+ Process proc;
+ try {
+ proc = rt.exec(cmd, null, null);
+ InputStream stdin = proc.getInputStream();
+ InputStreamReader isr = new InputStreamReader(stdin);
+ BufferedReader br = new BufferedReader(isr);
+
+ String line = null;
+ while ( (line = br.readLine()) != null) {
+ if (line.toLowerCase().contains("phyml version")) {
+ String[] linesplit = line.trim().replace(".", "").split(" ");
+ String version = linesplit[linesplit.length - 1];
+ PHYML_VERSION = version;
+ if (Arrays.asList(COMPATIBLE_VERSIONS).contains(version)) {
+ compatiblePhyml = true;
+ } else {
+ compatiblePhyml = false;
+ }
+ binaryFound = true;
+ }
+ }
+ br.close();
+ isr.close();
+ stdin.close();
+ proc.destroy();
+ } catch (IOException e) {
+ return false;
+ }
+ return binaryFound;
+ }
+
+ public static boolean isPhymlGlobal() {
+ return PHYML_GLOBAL;
+ }
+
static {
if (PHYML_GLOBAL) {
PHYML_PATH = "";
+ phymlBinaryStr = "phyml";
} else {
+ /* check the local paths */
String path = ModelTestConfiguration.getExeDir();
if (!path.startsWith(File.separator)) {
PHYML_PATH = CURRENT_DIRECTORY + File.separator + path;
@@ -87,18 +169,26 @@ public abstract class RunPhyml extends Observable implements Observer {
if (!PHYML_PATH.endsWith(File.separator)) {
PHYML_PATH += File.separator;
}
- }
- if (PHYML_GLOBAL) {
- phymlBinaryStr = "phyml";
- } else {
phymlBinary = new File(PHYML_PATH + "phyml");
if (phymlBinary.exists() && phymlBinary.canExecute()) {
phymlBinaryStr = phymlBinary.getAbsolutePath();
+ compatiblePhyml = true;
} else {
phymlBinaryStr = PHYML_PATH + Utilities.getBinaryVersion();
}
- /* Check if binary exists */
+ /* Check if binary exists and is compatible */
phymlBinary = new File(phymlBinaryStr);
+ if (!checkPhymlCompatibility(phymlBinaryStr)) {
+ /* Check for system wide PhyML */
+ if (!(phymlBinary.exists() && phymlBinary.canExecute()))
+ {
+ if(checkPhymlCompatibility("/usr/bin/phyml")) {
+ PHYML_PATH = "/usr/bin";
+ phymlBinary = new File(PHYML_PATH + "/phyml");
+ phymlBinaryStr = phymlBinary.getAbsolutePath();
+ }
+ }
+ }
}
}
public RunPhyml(Observer progress, ApplicationOptions options,
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/gui/FrameMain.java b/src/main/java/es/uvigo/darwin/jmodeltest/gui/FrameMain.java
index da1fbcd..107e5ad 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/gui/FrameMain.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/gui/FrameMain.java
@@ -537,7 +537,7 @@ public class FrameMain extends JModelTestFrame {
// getContentPane().setLayout(null);
getContentPane().setLayout(new BorderLayout());
setTitle("jModelTest " + ModelTest.CURRENT_VERSION);
- setSize(new java.awt.Dimension(630, 695));
+ setSize(new java.awt.Dimension(780, 695));
setResizable(true);
// event handling
@@ -1142,7 +1142,7 @@ public class FrameMain extends JModelTestFrame {
private void menuAboutCreditsActionPerformed(java.awt.event.ActionEvent e) {
try {
String credits = "Likelihood calculations with Phyml by Stephane Guindon et al.\n";
- credits += "Alignment conversion with ALTER by Daniel Glez-Peña et al.\n";
+ credits += "Alignment conversion with ALTER by Daniel Glez-Pena et al.\n";
credits += "Phylogenetic trees management with PAL: Phylogenetic Analysis Library by A. Drummond and K. Strimmer\n";
credits += "Table utilities by Philip Milne\n";
credits += "BrowserLauncher by Eric Albert and Jeff Chapman\n";
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/gui/XManager.java b/src/main/java/es/uvigo/darwin/jmodeltest/gui/XManager.java
index 8bef0e7..66f496e 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/gui/XManager.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/gui/XManager.java
@@ -59,6 +59,7 @@ public class XManager {
public static final Point MAIN_LOCATION = new Point(281, 80);
+ public static SimpleAttributeSet blueText;
public static SimpleAttributeSet redText;
public static SimpleAttributeSet blackText;
@@ -82,9 +83,11 @@ public class XManager {
FONT_STATUS = new Font("Dialog", 0, 9);
FONT_TABULAR = new java.awt.Font("Verdana", 0, 12);
- redText = new SimpleAttributeSet();
blackText = new SimpleAttributeSet();
+ redText = new SimpleAttributeSet();
+ blueText = new SimpleAttributeSet();
+ StyleConstants.setForeground(blueText, Color.blue);
StyleConstants.setForeground(redText, Color.red);
StyleConstants.setForeground(blackText, Color.black);
}
diff --git a/src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/JMT24.gif b/src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/JMT24.gif
similarity index 100%
rename from src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/JMT24.gif
rename to src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/JMT24.gif
diff --git a/src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/JMT48.gif b/src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/JMT48.gif
similarity index 100%
rename from src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/JMT48.gif
rename to src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/JMT48.gif
diff --git a/src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/JMT96.gif b/src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/JMT96.gif
similarity index 100%
rename from src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/JMT96.gif
rename to src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/JMT96.gif
diff --git a/src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/Open16.gif b/src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/Open16.gif
similarity index 100%
rename from src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/Open16.gif
rename to src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/Open16.gif
diff --git a/src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/Open24.gif b/src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/Open24.gif
similarity index 100%
rename from src/main/resources/es/uvigo/darwin/jmodeltest/gui/icons/Open24.gif
rename to src/main/java/es/uvigo/darwin/jmodeltest/gui/icons/Open24.gif
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/io/HtmlReporter.java b/src/main/java/es/uvigo/darwin/jmodeltest/io/HtmlReporter.java
index c7a16a4..0e4137e 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/io/HtmlReporter.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/io/HtmlReporter.java
@@ -625,6 +625,7 @@ public abstract class HtmlReporter {
}
}
+ @SuppressWarnings("resource")
public static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/tree/TreeDistancesCache.java b/src/main/java/es/uvigo/darwin/jmodeltest/tree/TreeDistancesCache.java
index a4b3a9b..d28e567 100755
--- a/src/main/java/es/uvigo/darwin/jmodeltest/tree/TreeDistancesCache.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/tree/TreeDistancesCache.java
@@ -28,7 +28,7 @@ import pal.tree.Tree;
*
* This cache support both euclidean and RF distances.
*
- * @author Diego Darriba López
+ * @author Diego Darriba
*
* @since 3.0
*/
diff --git a/src/main/java/es/uvigo/darwin/jmodeltest/utilities/Utilities.java b/src/main/java/es/uvigo/darwin/jmodeltest/utilities/Utilities.java
index 5e510e4..64fc3f1 100644
--- a/src/main/java/es/uvigo/darwin/jmodeltest/utilities/Utilities.java
+++ b/src/main/java/es/uvigo/darwin/jmodeltest/utilities/Utilities.java
@@ -31,6 +31,7 @@ import java.util.Locale;
import java.util.StringTokenizer;
import javax.swing.text.Document;
+import javax.swing.text.SimpleAttributeSet;
import pal.alignment.Alignment;
import es.uvigo.darwin.jmodeltest.ModelTest;
@@ -263,21 +264,37 @@ public final class Utilities {
}
}
- /**
- * printRed
- *
- * Prints to the main console text in red
- */
-
- public static void printRed(String text) {
+ private static void printColor(String text, SimpleAttributeSet color) {
if (ModelTest.buildGUI) {
try {
Document doc = XManager.getInstance().getPane().getDocument();
- doc.insertString(doc.getLength(), text, XManager.redText);
+ doc.insertString(doc.getLength(), text, color);
} catch (javax.swing.text.BadLocationException e) {
+ System.err.println("Bad Location Exception");
}
+ } else {
+ System.out.print(text);
}
}
+
+ /**
+ * printRed
+ *
+ * Prints to the main console text in red
+ */
+ public static void printRed(String text) {
+ printColor(text, XManager.redText);
+ }
+
+ /**
+ * printBlue
+ *
+ * Prints to the main console text in blue
+ */
+
+ public static void printBlue(String text) {
+ printColor(text, XManager.blueText);
+ }
/******************
* RoundDoubleTo **************************
diff --git a/src/main/resources/CHANGELOG b/src/main/resources/CHANGELOG
index a16c616..a2d38d3 100644
--- a/src/main/resources/CHANGELOG
+++ b/src/main/resources/CHANGELOG
@@ -1,3 +1,10 @@
+15 Jan 2016 Version 2.1.9 Revision 20160115
+
+ * Added automatic search for PhyML binary in /usr/bin
+ * Removed non-ASCII characters
+ * Disable logging if writing is not possible
+ * Merge GUI images into jarfile
+
20 Oct 2015 Version 2.1.8 Revision 20151020
* Removed ReadSeq dependency
diff --git a/src/main/resources/README b/src/main/resources/README
index b2c18ff..1d4fd02 100644
--- a/src/main/resources/README
+++ b/src/main/resources/README
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
-jModelTest 2.1.8 Readme - Oct/20/2015
+jModelTest 2.1.9 Readme - Jan/15/2016
Diego Darriba (ddarriba at udc.es)
Guillermo L. Taboada (taboada at udc.es)
diff --git a/src/main/resources/conf/jmodeltest.conf b/src/main/resources/conf/jmodeltest.conf
index d55ee37..8368c7d 100644
--- a/src/main/resources/conf/jmodeltest.conf
+++ b/src/main/resources/conf/jmodeltest.conf
@@ -39,9 +39,10 @@ log-dir = log
# #
# Environment variables in curly brackets can be used #
# e.g., ${HOME} or ${PHYML_HOME} #
+# #
##########################################################
global-phyml-exe = false
-exe-dir = exe/phyml
+exe-dir = exe/phyml
##########################################################
# #
@@ -58,4 +59,4 @@ exe-dir = exe/phyml
##########################################################
gamma-threads = 4
inv-threads = 2
-uniform-threads = 1
+uniform-threads = 1
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/jmodeltest.git
More information about the debian-med-commit
mailing list