diff --git a/build.xml b/build.xml index b213f05..26cc088 100644 --- a/build.xml +++ b/build.xml @@ -17,7 +17,7 @@ - + diff --git a/src/beast/app/beauti/FileInputEditor.java b/src/beast/app/beauti/FileInputEditor.java index ab474a2..b7bcb5a 100644 --- a/src/beast/app/beauti/FileInputEditor.java +++ b/src/beast/app/beauti/FileInputEditor.java @@ -55,7 +55,7 @@ public void actionPerformed(ActionEvent arg0) { m_entry.setText(file.getName()); m_input.setValue(newFile(file), m_beastObject); String path = file.getPath(); - Beauti.g_sDir = path; + Beauti.setCurrentDir(path); } } catch (Exception e) { // TODO Auto-generated catch block diff --git a/src/beast/app/beauti/OutFileInputEditor.java b/src/beast/app/beauti/OutFileInputEditor.java index f14845f..9a42bda 100644 --- a/src/beast/app/beauti/OutFileInputEditor.java +++ b/src/beast/app/beauti/OutFileInputEditor.java @@ -51,7 +51,7 @@ public void actionPerformed(ActionEvent arg0) { m_entry.setText(file.getName()); m_input.setValue(new OutFile(file.getPath()), m_beastObject); String path = file.getPath(); - Beauti.g_sDir = path; + Beauti.setCurrentDir(path); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/src/beast/app/draw/SpreadSheet.java b/src/beast/app/draw/SpreadSheet.java index 0a44375..e62fea2 100644 --- a/src/beast/app/draw/SpreadSheet.java +++ b/src/beast/app/draw/SpreadSheet.java @@ -88,6 +88,7 @@ import beast.core.BEASTObject; import beast.evolution.alignment.Alignment; import beast.evolution.alignment.Sequence; +import beast.util.BEASTClassLoader; import beast.util.PackageManager; import beast.util.XMLParser; import beast.util.XMLProducer; @@ -236,7 +237,7 @@ public void mouseClicked(MouseEvent e) { "select", JOptionPane.PLAIN_MESSAGE, null, m_sPlugInNames, null); if (sClassName != null) { try { - BEASTObject plugin = (beast.core.BEASTObject) Class.forName(sClassName).newInstance(); + BEASTObject plugin = (beast.core.BEASTObject) BEASTClassLoader.forName(sClassName).newInstance(); m_objects[iRow][iCol] = plugin; m_pluginLocation.put(plugin, iRow + iCol * MAX_ROW); m_plugins.add(plugin); @@ -701,7 +702,7 @@ void parsePlugin(String sStr, int iRow, int iCol) { } BEASTObject plugin = null; if (m_objects[iRow][iCol]==null || !m_objects[iRow][iCol].getClass().getName().equals(sClass)) { - plugin = (BEASTObject) Class.forName(sClass).newInstance(); + plugin = (BEASTObject) BEASTClassLoader.forName(sClass).newInstance(); } else { plugin = (BEASTObject) m_objects[iRow][iCol]; } diff --git a/src/beast/app/util/Application.java b/src/beast/app/util/Application.java index 59f66c5..f90f1be 100644 --- a/src/beast/app/util/Application.java +++ b/src/beast/app/util/Application.java @@ -12,6 +12,7 @@ import org.json.JSONObject; +import beast.app.beauti.Beauti; import beast.app.beauti.BeautiConfig; import beast.app.beauti.BeautiDoc; import beast.app.draw.BEASTObjectDialog; @@ -20,6 +21,7 @@ import beast.core.Description; import beast.core.Input; import beast.core.util.Log; +import beast.util.BEASTClassLoader; @Description("BEAST application that handles argument parsing by introspection " + "using Inputs declared in the class.") @@ -155,6 +157,10 @@ public void parseArgs(String[] args, boolean sloppy) throws Exception { Log.info.println(getUsage()); // CLI usage only System.exit(0); + } else if (name.equals("wd")) { + // set working directory + Beauti.g_sDir = value; + i++; } if (matchingInput == null) { @@ -195,6 +201,7 @@ public String getUsage() { try { List> inputs = myBeastObject.listInputs(); buf.append("Usage: " + myBeastObject.getClass().getName() + "\n"); + buf.append(myBeastObject.getDescription() + "\n"); for (Input input : inputs) { buf.append("-" + input.getName() + " "); try { @@ -225,7 +232,7 @@ public void run() throws Exception { public static void main(final String[] args) throws Exception { Application main = null; try { - BEASTObject myBeastObject = (BEASTObject) Class.forName(args[0]) + BEASTObject myBeastObject = (BEASTObject) BEASTClassLoader.forName(args[0]) .newInstance(); main = new Application(myBeastObject); String[] args2 = new String[args.length - 1]; diff --git a/src/beast/inference/ParticleFilter.java b/src/beast/inference/ParticleFilter.java index 8594224..521fcb9 100644 --- a/src/beast/inference/ParticleFilter.java +++ b/src/beast/inference/ParticleFilter.java @@ -28,6 +28,7 @@ import beast.core.BEASTObject; import beast.core.Input.Validate; import beast.math.statistic.DiscreteStatistics; +import beast.util.BEASTClassLoader; import beast.util.Randomizer; import beast.util.XMLProducer; @@ -375,7 +376,7 @@ public void run() throws Exception { m_nCountDown = new CountDownLatch(m_nParticles); for (int i = 0; i < m_nParticles; i++) { - Object o = Class.forName(m_sParticleLauncher.get()).newInstance(); + Object o = BEASTClassLoader.forName(m_sParticleLauncher.get()).newInstance(); if (!(o instanceof ParticleLauncher)) { throw new Exception(m_sParticleLauncher.get() + " is not a particle launcher."); } diff --git a/src/beast/math/distributions/MultiMRCAPriors.java b/src/beast/math/distributions/MultiMRCAPriors.java index ee4313b..4fcc421 100644 --- a/src/beast/math/distributions/MultiMRCAPriors.java +++ b/src/beast/math/distributions/MultiMRCAPriors.java @@ -16,10 +16,10 @@ public class MultiMRCAPriors extends MultiMonophyleticConstraint { public Input> calibrationsInput = new Input>("distribution", "Set of calibrated nodes", new ArrayList()); - private int[] nodeToCladeGroup = null; - private int prevNodeCount = -1; - private int[] ctops = null; - private boolean[] ctopParent = null; + protected int[] nodeToCladeGroup = null; + protected int prevNodeCount = -1; + protected int[] ctops = null; + protected boolean[] ctopParent = null; @Override public void initAndValidate() { diff --git a/version.xml b/version.xml index 225777f..04b779b 100644 --- a/version.xml +++ b/version.xml @@ -1,5 +1,5 @@ - - + +