diff --git a/.classpath b/.classpath index da844a22c..f16b26a7a 100644 --- a/.classpath +++ b/.classpath @@ -24,5 +24,6 @@ + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index ef8a789ca..657d9e408 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -9,4 +9,5 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.6 diff --git a/Additional Files/executablesJava17Plus-macOS-June2018.zip b/Additional Files/executablesJava17Plus-macOS-June2018.zip new file mode 100644 index 000000000..0d36b6a1f Binary files /dev/null and b/Additional Files/executablesJava17Plus-macOS-June2018.zip differ diff --git a/Additional Files/jars.zip b/Additional Files/jars.zip index 583eab2d8..067cc0dc3 100644 Binary files a/Additional Files/jars.zip and b/Additional Files/jars.zip differ diff --git a/Mesquite_Folder.zip b/Mesquite_Folder.zip deleted file mode 100644 index ce552f8a9..000000000 Binary files a/Mesquite_Folder.zip and /dev/null differ diff --git a/Source/mesquite/Mesquite.java b/Source/mesquite/Mesquite.java index d2fd637f8..4ca36fde1 100644 --- a/Source/mesquite/Mesquite.java +++ b/Source/mesquite/Mesquite.java @@ -37,24 +37,28 @@ public class Mesquite extends MesquiteTrunk { /*.................................................................................................................*/ public String getCitation() { - return "Maddison, W.P. & D.R. Maddison. 2018. Mesquite: A modular system for evolutionary analysis. Version 3.51. http://www.mesquiteproject.org"; + return "Maddison, W.P. & D.R. Maddison. 2018. Mesquite: A modular system for evolutionary analysis. Version 3.6. http://www.mesquiteproject.org"; } /*.................................................................................................................*/ public String getVersion() { - return "3.51"; + return "3.6"; } /*.................................................................................................................*/ public int getVersionInt() { - return 351; + return 360; } /*.................................................................................................................*/ public double getMesquiteVersionNumber(){ - return 3.51; + return 3.6; } /*.................................................................................................................*/ public String getDateReleased() { - return "June 2018"; //"April 2007"; + return "December 2018"; //"April 2007"; + } + /*.................................................................................................................*/ + public boolean isPrerelease(){ + return false; } /*.................................................................................................................*/ @@ -69,24 +73,20 @@ public String getHomePhoneNumber(){ return "https://raw.githubusercontent.com/MesquiteProject/MesquiteCore/development/noticesAndUpdates/noticesPrerelease.xml"; - /* Version 3.2 through 3.4 + /* Version 3.2 through 3.4 if (!isPrerelease() && !debugMode) return "https://raw.githubusercontent.com/MesquiteProject/MesquiteCore/master/noticesAndUpdates/notices.xml"; else return "https://raw.githubusercontent.com/MesquiteProject/MesquiteCore/development/noticesAndUpdates/noticesPrerelease.xml"; - */ - - /* Version 2.75 through 3.11 + */ + + /* Version 2.75 through 3.11 if (!isPrerelease() && !debugMode) return "http://mesquiteproject.org/mesquite/notice/notices.xml"; else return "http://mesquiteproject.org/mesquite/prereleasenotices/notices.xml"; - */ - } - /*.................................................................................................................*/ - public boolean isPrerelease(){ - return false; + */ } /*.................................................................................................................*/ public void getEmployeeNeeds(){ //This gets called on startup to harvest information; override this and inside, call registerEmployeeNeed @@ -1273,7 +1273,8 @@ private void openMesquiteFAQ(){ /*End new code added April.02.07 oliver*/ public void employeeQuit(MesquiteModule mb){ - helpSearchManager.employeeQuit(mb); + if (helpSearchManager!=null) + helpSearchManager.employeeQuit(mb); super.employeeQuit(mb); } /*.................................................................................................................*/ @@ -2462,6 +2463,8 @@ else if (MesquiteTrunk.isMacOSX()) { } catch (NoSuchMethodError e) { } + catch (NoClassDefFoundError e) { //WAYNECHECK: DAVIDCHECK: need to add alternative macos application event handling methods for post-1.8 Java + } } } @@ -2667,7 +2670,7 @@ static void addToStartupNotices(String s){ Method gsn = starter.getClass().getDeclaredMethod("getStartupNotices", null); startupNotices = (Vector)gsn.invoke(starter, null); } catch (Exception e) { - System.out.println("Failed to get startup notices vector"); + System.out.println("Failed to get startup notices vector"); } } if (startupNotices != null) @@ -2719,7 +2722,7 @@ public static URLClassLoader makeModuleClassLoader(String mesquiteDirectoryPath, //Go through each package listed in classpaths.txt for (int i = 0; i>>8; - - + + public static final int TOTALBITS = 64; //for use by other classes that might want to make, say, an array for the bits - + private static final int MAXBIT = 63; //MAXBIT for bitwise manipulations long set; //the value stored for an instantiation of this - + public CategoricalState () { set = unassigned; } @@ -184,6 +184,31 @@ public boolean equals(CharacterState s, boolean allowMissing, boolean allowNearE return equals(s, allowMissing, allowNearExact, false); } /*..........................................CategoricalState.....................................*/ + /**returns true iff state sets are same, or could be the same given ambiguity */ + public boolean couldBeEqual(CharacterState s) { + if (s==null) + return false; + if (!(s instanceof CategoricalState)) + return false; + if (isUnassigned() || s.isUnassigned()) + return true; + long t = getValue(); + long tO = ((CategoricalState)s).getValue(); + boolean tUncertain = isUncertain(t); + boolean tOUncertain = isUncertain(tO); + t = statesBitsMask & t; + tO = statesBitsMask & tO; + if (t == tO) + return true; + if (tUncertain){ // t is uncertain, and t0 is a subset of it + return (tO == (t & tO)); + } + if (tOUncertain){ // t0 is uncertain, and t is a subset of it + return (t == (t & tO)); + } + return false; + } + /*..........................................CategoricalState.....................................*/ /**returns true iff state sets are same */ public boolean equals(CharacterState s, boolean allowMissing, boolean allowNearExact, boolean allowSubset) { if (s==null) @@ -191,7 +216,7 @@ public boolean equals(CharacterState s, boolean allowMissing, boolean allowNearE if (!(s instanceof CategoricalState)) return false; if (allowMissing && (isUnassigned() || s.isUnassigned())) //fixed June 02 - return true; + return true; long t = getValue(); long tO = ((CategoricalState)s).getValue(); if (allowSubset) { @@ -297,7 +322,7 @@ public static boolean isElement(long s, int e) { public static boolean isSubset(long sub, long s) { return (statesBitsMask & sub & s) == (statesBitsMask & sub); } - + /*..........................................CategoricalState.....................................*/ /**returns minimum element in state set s */ public static int minimum(long s) { @@ -322,20 +347,20 @@ public static int getOnlyElement(long s) { /**returns number of states in state set shortS */ public static int cardinality(int shortS) { int count =0; - for (int e=0; e<= getMaxPossibleStateStatic(); e++) { - if (((1L<=0; e--) { if (((1L<>>53; //5 for high bits + 48 for reduction from 64 to 16 - public static final long intStatesBitsMaskL = (~0L)>>>37; //5 for high bits + 32 for reduction from 64 to 32 + public static final long intStatesBitsMaskL = (~0L)>>>37; //5 for high bits + 32 for reduction from 64 to 32 - /*..........................................CategoricalState.....................................*/ - public static boolean compressibleToShort(long s){ - return (s & shortStatesBitsMaskL) == (s & CategoricalState.statesBitsMask); - } - /*..........................................CategoricalState.....................................*/ - public static short compressToShort(long s){ - return (short)((s & shortStatesBitsMaskL) | ((s & CategoricalState.highBitsMask)>>>48)); - } - /*..........................................CategoricalState.....................................*/ - public static long expandFromShort(short s){ - long LS = ((long)s); - return (LS & shortStatesBitsMaskL) | ((LS << 48) & CategoricalState.highBitsMask); - } - /*..........................................CategoricalState.....................................*/ - public static boolean compressibleToInt(long s){ - return (s & intStatesBitsMaskL) == (s & CategoricalState.statesBitsMask); - } - /*..........................................CategoricalState.....................................*/ - public static int compressToInt(long s){ - return (int)((s & intStatesBitsMaskL) | ((s & CategoricalState.highBitsMask)>>>32)); - } - /*..........................................CategoricalState.....................................*/ - public static long expandFromInt(int s){ - long LS = ((long)s); - return (LS & intStatesBitsMaskL) | ((LS << 32) & CategoricalState.highBitsMask); - } - /*..........................................CategoricalState.....................................*/ - /** Expands state set (passed as long) to full array of included elements. */ - public static int[] expand(long s) { - int numStates = cardinality(s); - int count=0; - int[] result = new int[numStates]; - for (int e=0; e<=maxCategoricalState; e++) { - if (isElement(s, e)) { - result[count]=e; - count++; + /*..........................................CategoricalState.....................................*/ + public static boolean compressibleToShort(long s){ + return (s & shortStatesBitsMaskL) == (s & CategoricalState.statesBitsMask); } - } - return result; - } - /*..........................................CategoricalState.....................................*/ - /** Compresses array listing included elements into state set form (long, with bits set). This is inverse of expand.*/ - public static long compressFromList(int[] states) { - if (states == null) //added 20 Oct 01 - return 0L; - long s=0L; - for (int i=0; i=0 && states[i]<=maxCategoricalState) - s= addToSet(s, states[i]); - } - return s; - } - /*..........................................CategoricalState.....................................*/ - /** Compresses array with presence (>0) or absence (<=0) for each element into state set form (long, with bits set).*/ - public static long compressFromPresence(double[] states) { - if (states == null) //added 20 Oct 01 - return 0L; - long s=0L; - for (int i=0; i0.0) - s= addToSet(s, i); - } - return s; - } - /*..........................................CategoricalState.....................................*/ - /** sets the value to inapplicable*/ - public void setToInapplicable() { - set = inapplicable; - } - /*..........................................CategoricalState.....................................*/ - /** sets the value to unassigned*/ - public void setToUnassigned() { - set = unassigned; - } - /*..........................................CategoricalState.....................................*/ - /**gets the value of the state set */ - public long getValue() { - return set; - } - /*..........................................CategoricalState.....................................*/ - /**sets the value of the state set to the long variable passed*/ - public void setValue(long value) { - set = value; - } - - - /*..........................................CategoricalState.....................................*/ - /**sets the value using the passed CharacterState's value if of same type */ - public void setValue(CharacterState cs){ - if (cs!=null && cs instanceof CategoricalState) { - setValue(((CategoricalState)cs).getValue()); - } - } - /*..........................................CategoricalState.....................................*/ - /** sets its value to the value given by the String passed to it starting at position pos �* + /*..........................................CategoricalState.....................................*/ + public static short compressToShort(long s){ + return (short)((s & shortStatesBitsMaskL) | ((s & CategoricalState.highBitsMask)>>>48)); + } + /*..........................................CategoricalState.....................................*/ + public static long expandFromShort(short s){ + long LS = ((long)s); + return (LS & shortStatesBitsMaskL) | ((LS << 48) & CategoricalState.highBitsMask); + } + /*..........................................CategoricalState.....................................*/ + public static boolean compressibleToInt(long s){ + return (s & intStatesBitsMaskL) == (s & CategoricalState.statesBitsMask); + } + /*..........................................CategoricalState.....................................*/ + public static int compressToInt(long s){ + return (int)((s & intStatesBitsMaskL) | ((s & CategoricalState.highBitsMask)>>>32)); + } + /*..........................................CategoricalState.....................................*/ + public static long expandFromInt(int s){ + long LS = ((long)s); + return (LS & intStatesBitsMaskL) | ((LS << 32) & CategoricalState.highBitsMask); + } + /*..........................................CategoricalState.....................................*/ + /** Expands state set (passed as long) to full array of included elements. */ + public static int[] expand(long s) { + int numStates = cardinality(s); + int count=0; + int[] result = new int[numStates]; + for (int e=0; e<=maxCategoricalState; e++) { + if (isElement(s, e)) { + result[count]=e; + count++; + } + } + return result; + } + /*..........................................CategoricalState.....................................*/ + /** Compresses array listing included elements into state set form (long, with bits set). This is inverse of expand.*/ + public static long compressFromList(int[] states) { + if (states == null) //added 20 Oct 01 + return 0L; + long s=0L; + for (int i=0; i=0 && states[i]<=maxCategoricalState) + s= addToSet(s, states[i]); + } + return s; + } + /*..........................................CategoricalState.....................................*/ + /** Compresses array with presence (>0) or absence (<=0) for each element into state set form (long, with bits set).*/ + public static long compressFromPresence(double[] states) { + if (states == null) //added 20 Oct 01 + return 0L; + long s=0L; + for (int i=0; i0.0) + s= addToSet(s, i); + } + return s; + } + /*..........................................CategoricalState.....................................*/ + /** sets the value to inapplicable*/ + public void setToInapplicable() { + set = inapplicable; + } + /*..........................................CategoricalState.....................................*/ + /** sets the value to unassigned*/ + public void setToUnassigned() { + set = unassigned; + } + /*..........................................CategoricalState.....................................*/ + /**gets the value of the state set */ + public long getValue() { + return set; + } + /*..........................................CategoricalState.....................................*/ + /**sets the value of the state set to the long variable passed*/ + public void setValue(long value) { + set = value; + } + + + /*..........................................CategoricalState.....................................*/ + /**sets the value using the passed CharacterState's value if of same type */ + public void setValue(CharacterState cs){ + if (cs!=null && cs instanceof CategoricalState) { + setValue(((CategoricalState)cs).getValue()); + } + } + /*..........................................CategoricalState.....................................*/ + /** sets its value to the value given by the String passed to it starting at position pos �* public void setValue(String s, MesquiteInteger pos){ if (s==null){ set = unassigned; @@ -786,7 +811,7 @@ public void setValue(String s, MesquiteInteger pos){ char c = s.charAt(loc++); //get next dark character in string while (ParseUtil.whitespace(c, null) && c!=0 && loc1) + temp ="{" + temp + "}"; + return temp; } - } - if (first) - temp += '!'; //no state found! - if (temp.length()>1) - temp ="{" + temp + "}"; - return temp; - } - /*..........................................CategoricalState.....................................*/ - /** converts passed long (treated as CategoricalState) to string. Uses default symbols for states. */ - public String toNEXUSString() { - return toNEXUSString(set); - } - /*..........................................CategoricalState.....................................*/ - /** converts passed long (treated as CategoricalState) to string. Uses default symbols for states. */ - public static String toNEXUSString(long s) { - if (isInapplicable(s)) - return "" + CharacterData.defaultInapplicableChar; - if (isUnassigned(s)) - return "" + CharacterData.defaultMissingChar; - String temp=""; - for (int e=0; e<=maxCategoricalState; e++) { - if (((1L<1) - temp ="{" + temp + "}"; - return temp; - } - /*..........................................CategoricalState.....................................*/ - /** converts passed long (treated as CategoricalState) to string. Uses default symbols for states. Includes High Bits. Used for development/debugging. �*/ - public static String toSimpleStringHB(long s) { - if (isInapplicable(s)) - return "" + CharacterData.defaultInapplicableChar; - if (isUnassigned(s)) - return "" + CharacterData.defaultMissingChar; - boolean first=true; - String temp=""; - for (int e=0; e<=maxCategoricalState; e++) { - if (((1L<1) + temp ="{" + temp + "}"; + return temp; } - } - for (int e=maxCategoricalState+1; e<=MAXBIT; e++) { - if (((1L<1) + temp ="{" + temp + "}"; + return temp; } - } - if (temp.length()>1) - temp ="{" + temp + "}"; - return temp; - } - /*..........................................CategoricalState.....................................*/ - /** converts passed long as bits. */ - public static String toStringBits(long s) { - StringBuffer temp= new StringBuffer(); - for (int e=63; e>=0; e--) { - if (((1L<=0; e--) { + if (((1L<0){ Taxa taxa = data.getTaxa(); if (!taxa.anySelected()) return; for (int i=0; i"}; public boolean startJob(String arguments, Object condition, boolean hiredByName) { @@ -155,6 +156,9 @@ public void processSingleXMLPreference (String tag, String content) { if ("matchCurrentTaxonName".equalsIgnoreCase(tag)){ matchCurrentTaxonName.setValue(content); } + if ("changeColor".equalsIgnoreCase(tag)){ + changeColor.setValue(content); + } preferencesSet = true; } /*.................................................................................................................*/ @@ -163,6 +167,7 @@ public String preparePreferencesForXML () { StringUtil.appendXMLTag(buffer, 2, "sampleCodeListPath", sampleCodeListPath); StringUtil.appendXMLTag(buffer, 2, "chosenNameCategory", chosenNameCategory); StringUtil.appendXMLTag(buffer, 2, "matchCurrentTaxonName", matchCurrentTaxonName); + StringUtil.appendXMLTag(buffer, 2, "changeColor", changeColor); preferencesSet = true; return buffer.toString(); } @@ -174,6 +179,7 @@ public boolean queryOptions() { ExtensibleDialog dialog = new ExtensibleDialog(containerOfModule(), "Rename Taxa Based On Table with File",buttonPressed); //MesquiteTrunk.mesquiteTrunk.containerOfModule() Checkbox matchTaxonName = dialog.addCheckBox("Match Current Taxon Name (otherwise OTU ID code)", matchCurrentTaxonName.getValue()); + Checkbox colorChanged = dialog.addCheckBox("Color changed taxa", changeColor.getValue()); sampleCodeFilePathField = dialog.addTextField("File with Replacement Names:", sampleCodeListPath,26); sampleCodeFilePathField.addTextListener(this); final Button dnaCodesBrowseButton = dialog.addAListenedButton("Browse...",null, this); @@ -211,6 +217,7 @@ public boolean queryOptions() { if (success) { sampleCodeListPath = sampleCodeFilePathField.getText(); chosenNameCategory = categoryChoice.getSelectedIndex(); + changeColor.setValue(colorChanged.getState()); matchCurrentTaxonName.setValue(matchTaxonName.getState()); // initialize(); // is this needed? } @@ -276,10 +283,12 @@ public String getSeqNamesFromTabDelimitedFile(MesquiteString sampleCode, String } // got here and no match found -- log an error - MesquiteMessage.warnUser("No matching name or code named '" + sampleCode + "' found in taxon names file."); + //MesquiteMessage.warnUser("No matching name or code named '" + sampleCode + "' found in taxon names file."); + log("-"); return null; } + NameReference colorNameRef = NameReference.getNameReference("color"); /*.................................................................................................................*/ /** Called to alter the taxon name in a single cell. If you use the alterContentOfCells method of this class, then you must supply a real method for this, not just this stub. */ @@ -296,6 +305,9 @@ public boolean alterName(Taxa taxa, int it){ if (StringUtil.notEmpty(newName)){ logln("Taxon \"" + taxa.getTaxonName(it) +"\" renamed to \"" + newName + "\""); taxa.setTaxonName(it, newName, false); + if (changeColor.getValue()) + taxa.setAssociatedLong(colorNameRef, it, 14); + } nameChanged = true; } diff --git a/Source/mesquite/externalCommunication/lib/RESTCommunicator.java b/Source/mesquite/externalCommunication/lib/RESTCommunicator.java deleted file mode 100644 index 80811245c..000000000 --- a/Source/mesquite/externalCommunication/lib/RESTCommunicator.java +++ /dev/null @@ -1,162 +0,0 @@ -package mesquite.externalCommunication.lib; - -import mesquite.lib.*; - -import org.apache.http.auth.AuthScope; -import org.apache.http.auth.UsernamePasswordCredentials; -import org.apache.http.client.*; -import org.apache.http.impl.client.BasicCredentialsProvider; -import org.apache.http.impl.client.HttpClientBuilder; - - - -public abstract class RESTCommunicator implements XMLPreferencesProcessor { - protected static String username = ""; - protected static String password = ""; - protected String xmlPrefsString = null; - protected String[] outputFilePaths; //local copies of files - protected MesquiteModule ownerModule; - protected boolean verbose = MesquiteTrunk.debugMode; - protected boolean aborted = false; - - protected OutputFileProcessor outputFileProcessor; // for reconnection - protected ShellScriptWatcher watcher; // for reconnection - - - public RESTCommunicator () { - } - - public RESTCommunicator (MesquiteModule mb, String xmlPrefsString,String[] outputFilePaths) { - if (xmlPrefsString != null) - XMLUtil.readXMLPreferences(mb, this, xmlPrefsString); - this.outputFilePaths = outputFilePaths; - ownerModule = mb; - } - - - public String getAPITestUserName(){ - return ""; - } - public String getAPITestPassword(){ - return ""; - } - public boolean useAPITestUser() { - return false; - } - public boolean isAborted() { - return aborted; - } - - public void setAborted(boolean aborted) { - this.aborted = aborted; - } - - /*.................................................................................................................*/ - public String getUserName(){ - if (useAPITestUser()) { - return getAPITestUserName(); - } else - return username; - } - /*.................................................................................................................*/ - public void setUserName(String newName){ - if (!useAPITestUser()) - username=newName; - } - /*.................................................................................................................*/ - public String getPassword(){ - if (useAPITestUser()) { - return getAPITestPassword(); - } else - return password; - } - /*.................................................................................................................*/ - public void setPassword(String newPassword){ - if (!useAPITestUser()) - password=newPassword; - } - - /*.................................................................................................................*/ - public Snapshot getSnapshot(MesquiteFile file) { - Snapshot temp = new Snapshot(); - temp.addLine("setUsername " + ParseUtil.tokenize(username)); - return temp; - } - Parser parser = new Parser(); - /*.................................................................................................................*/ - public Object doCommand(String commandName, String arguments, CommandChecker checker) { - if (checker.compare(this.getClass(), "Sets the username", "[username]", commandName, "setUsername")) { - username = parser.getFirstToken(arguments); - } - return null; - } - public void processSingleXMLPreference (String tag, String content) { - processSingleXMLPreference(tag, null, content); - - } - - /*.................................................................................................................*/ - public void processSingleXMLPreference (String tag, String flavor, String content) { - if ("userName".equalsIgnoreCase(tag)) - username = StringUtil.cleanXMLEscapeCharacters(content); - } - /*.................................................................................................................*/ - public String preparePreferencesForXML () { - StringBuffer buffer = new StringBuffer(200); - StringUtil.appendXMLTag(buffer, 2, "username", username); - return buffer.toString(); - } - /*.................................................................................................................*/ - public void forgetPassword() { - password=""; - } - - - /*.................................................................................................................*/ - public abstract String getBaseURL(); - /*.................................................................................................................*/ - public abstract String getAPIURL(); - /*.................................................................................................................*/ - public abstract String getRESTURL(); - /*.................................................................................................................*/ - public abstract String getRegistrationURL(); - /*.................................................................................................................*/ - public abstract String getSystemName(); - /*.................................................................................................................*/ - protected boolean checkUsernamePassword(boolean tellUserAboutSystem){ - if (StringUtil.blank(getUserName()) || StringUtil.blank(password)){ - MesquiteBoolean answer = new MesquiteBoolean(false); - MesquiteString usernameString = new MesquiteString(); - if (getUserName()!=null) - usernameString.setValue(getUserName()); - MesquiteString passwordString = new MesquiteString(); - if (getPassword()!=null) - passwordString.setValue(getPassword()); - String help = "You need an account on the "+getSystemName()+" REST system to use this service. To register, go to " + getRegistrationURL(); - String registrationHint = "Touch on the web link icon on the left to register for this service."; - new UserNamePasswordDialog(ownerModule.containerOfModule(), "Sign in to "+getSystemName(), help, getRegistrationURL(), registrationHint, "Username", "Password", answer, usernameString, passwordString); - if (answer.getValue()){ - setUserName(usernameString.getValue()); - setPassword(passwordString.getValue()); - } - ownerModule.storePreferences(); - } - boolean success = StringUtil.notEmpty(getUserName()) && StringUtil.notEmpty(getPassword()); - if (!success && tellUserAboutSystem) { - MesquiteMessage.discreetNotifyUser("Use of the "+getSystemName()+" service requires an account with the service. Go to "+ getRegistrationURL()+" to register for an account"); - } - return success; - - } - - /*.................................................................................................................*/ - public HttpClient getHttpClient(){ - // from http://www.artima.com/forums/flat.jsp?forum=121&thread=357685 - CredentialsProvider provider = new BasicCredentialsProvider(); - UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(username, password); - provider.setCredentials(AuthScope.ANY, credentials); - return HttpClientBuilder.create().setDefaultCredentialsProvider(provider).build(); - } - - -} diff --git a/Source/mesquite/externalCommunication/lib/RemoteJobFile.java b/Source/mesquite/externalCommunication/lib/RemoteJobFile.java new file mode 100644 index 000000000..ef08dce66 --- /dev/null +++ b/Source/mesquite/externalCommunication/lib/RemoteJobFile.java @@ -0,0 +1,41 @@ +package mesquite.externalCommunication.lib; + +public class RemoteJobFile { + String downloadURL = null; + String downloadTitle = null; + String fileName = null; + String lastModified = null; + long length=0; + + public String getDownloadURL() { + return downloadURL; + } + public void setDownloadURL(String downloadURL) { + this.downloadURL = downloadURL; + } + public String getDownloadTitle() { + return downloadTitle; + } + public void setDownloadTitle(String downloadTitle) { + this.downloadTitle = downloadTitle; + } + public String getFileName() { + return fileName; + } + public void setFileName(String fileName) { + this.fileName = fileName; + } + public long getLength() { + return length; + } + public void setLength(long length) { + this.length = length; + } + public String getLastModified() { + return lastModified; + } + public void setLastModified(String lastModified) { + this.lastModified = lastModified; + } + +} diff --git a/Source/mesquite/externalCommunication/lib/UsernamePasswordKeeper.java b/Source/mesquite/externalCommunication/lib/UsernamePasswordKeeper.java new file mode 100644 index 000000000..3496dee68 --- /dev/null +++ b/Source/mesquite/externalCommunication/lib/UsernamePasswordKeeper.java @@ -0,0 +1,14 @@ +package mesquite.externalCommunication.lib; + +public interface UsernamePasswordKeeper { + + public void setUsername(String username); + + public String getUsername(); + + public String getPassword() ; + + public void setPassword(String password) ; + + +} diff --git a/Source/mesquite/genesis/EvolveDNAChars/EvolveDNAChars.java b/Source/mesquite/genesis/EvolveDNAChars/EvolveDNAChars.java index a38216315..e2d4b31e8 100644 --- a/Source/mesquite/genesis/EvolveDNAChars/EvolveDNAChars.java +++ b/Source/mesquite/genesis/EvolveDNAChars/EvolveDNAChars.java @@ -262,10 +262,11 @@ void stampWithCurrentSpecsSet (CharacterData currentData) { public void cleanupAfterSimulation(MAdjustableDistribution matrix){ if (modelSource.modelFromModelSet()) { - for (int ic=0; ic0) { outputBuffer.append(getCommandName()+fileInterpreter.getLineEnding()); diff --git a/Source/mesquite/io/lib/InterpretPhylip.java b/Source/mesquite/io/lib/InterpretPhylip.java index fe18076bb..393dee1e6 100644 --- a/Source/mesquite/io/lib/InterpretPhylip.java +++ b/Source/mesquite/io/lib/InterpretPhylip.java @@ -177,7 +177,7 @@ public void readFile(MesquiteProject mf, MesquiteFile file, String arguments) { if (file.openReading()) { TaxaManager taxaTask = (TaxaManager)findElementManager(Taxa.class); CharactersManager charTask = (CharactersManager)findElementManager(CharacterData.class); - + Taxa taxa = taxaTask.makeNewTaxa("Taxa", 0, false); taxa.addToFile(file, getProject(), taxaTask); CategoricalData data = (CategoricalData)createData(charTask,taxa); @@ -340,7 +340,8 @@ public TreeVector findTreesToExport(MesquiteFile file, Taxa taxa, String argumen if (treeVectors.length==1) treeVector = (TreeVector)treeVectors[0]; else - treeVector = (TreeVector)ListDialog.queryList(containerOfModule(), "Include trees in file?", "Include trees in file?", MesquiteString.helpString, treeVectors, 0); + treeVector = (TreeVector)ListDialog.queryList(containerOfModule(), "Include trees in file?", "Include trees in file?", MesquiteString.helpString, "Include", "No trees", treeVectors, 0); + //treeVector = (TreeVector)ListDialog.queryList(containerOfModule(), "Include trees in file?", "Include trees in file?", MesquiteString.helpString, treeVectors, 0); previousVector = treeVector; return treeVector; } diff --git a/Source/mesquite/io/lib/InterpretPhylipTrees.java b/Source/mesquite/io/lib/InterpretPhylipTrees.java index 92b7912bf..17840b6d9 100644 --- a/Source/mesquite/io/lib/InterpretPhylipTrees.java +++ b/Source/mesquite/io/lib/InterpretPhylipTrees.java @@ -77,6 +77,8 @@ public void readTreeFile(MesquiteProject mf, MesquiteFile file, String arguments Taxa taxa = getProject().chooseTaxa(containerOfModule(), "From what taxa are these trees composed?"); if (taxa== null) { TaxaManager taxaTask = (TaxaManager)findElementManager(Taxa.class); + if (taxaTask==null) + return; taxa = taxaTask.makeNewTaxa("Taxa", 0, false); taxa.addToFile(file, getProject(), taxaTask); enlargeTaxaBlock = true; diff --git a/Source/mesquite/lib/AlertDialog.java b/Source/mesquite/lib/AlertDialog.java index b5e1b32f2..0c6f54cfa 100644 --- a/Source/mesquite/lib/AlertDialog.java +++ b/Source/mesquite/lib/AlertDialog.java @@ -128,7 +128,11 @@ public static void noticeHTML(Object parent, String title, String message, int w if (id.isInWizard()) id.appendToHelpString("

Notice

"); id.addHTMLPanel(message, w, h, linkTouchedCommand); - id.completeAndShowDialog(okString,null,null,okString); + try { + id.completeAndShowDialog(okString,null,null,okString); + } catch (Exception e) { + MesquiteMessage.println("exception: " + e.getMessage()); + } id.dispose(); } public static void notice(Object parent, String title, String message) { diff --git a/Source/mesquite/lib/ColorPickerPanel.java b/Source/mesquite/lib/ColorPickerPanel.java index fafc2b44a..9229991eb 100644 --- a/Source/mesquite/lib/ColorPickerPanel.java +++ b/Source/mesquite/lib/ColorPickerPanel.java @@ -225,6 +225,9 @@ public void mouseExited(MouseEvent e) { public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { + int x = e.getX(); + int y = e.getY(); + setColorFromXY(x, y); } public Color getColor(){ diff --git a/Source/mesquite/lib/HelpSearchManager.java b/Source/mesquite/lib/HelpSearchManager.java index a4b2e954c..2350c30e2 100644 --- a/Source/mesquite/lib/HelpSearchManager.java +++ b/Source/mesquite/lib/HelpSearchManager.java @@ -360,7 +360,7 @@ else if (manualLoading == 2){ ww.setText(results); ww.setVisible(true); } - else*/ if (searchWindowBabysitter.getModuleWindow()!= null){ + else*/ if (searchWindowBabysitter!=null && searchWindowBabysitter.getModuleWindow()!= null){ MesquiteHTMLWindow w = (MesquiteHTMLWindow)searchWindowBabysitter.getModuleWindow(); w.setDataWindow(null); w.setText(results); diff --git a/Source/mesquite/lib/ListDialog.java b/Source/mesquite/lib/ListDialog.java index 52c496582..910901661 100644 --- a/Source/mesquite/lib/ListDialog.java +++ b/Source/mesquite/lib/ListDialog.java @@ -637,6 +637,25 @@ public static Listable queryList(MesquiteWindow parent, String title, String mes } else return null; } + public static Listable queryList(MesquiteWindow parent, String title, String message, String helpString, String OKButton, String cancelButton, Listable[] objects, int current) { + if (objects==null) + return null; + MesquiteInteger io = new MesquiteInteger(current); +// public ListDialog (MesquiteWindow parent, String title, String message, boolean autoComplete, String helpString, Object names, MesquiteInteger selected, String okButton, String cancelButton, String thirdButton, boolean prioritize, Class priorityClass, boolean hasDefault, boolean multipleMode) { + ListDialog id = new ListDialog(parent, title, message, true,helpString, objects, io, OKButton, cancelButton, null,false, null, true, false); +// public ListDialog (MesquiteWindow parent, String title, String message, boolean autoComplete, String helpString, Object names, MesquiteInteger selected, String thirdButton, boolean hasDefault, boolean multipleMode) { +// ListDialog id = new ListDialog(parent, title, message, true,helpString, objects, io, null,true, false); + id.setVisible(true); + id.dispose(); + int result = io.getValue(); + if (io.isUnassigned()) + return null; + if (result>=0 && resultmaxScriptedPoppedWidth) + maxScriptedPoppedWidth = width; + if (height>maxScriptedPoppedHeight) + maxScriptedPoppedHeight = height; + } + else { + if (width>maxScriptedMainWidth) + maxScriptedMainWidth = width; + if (height>maxScriptedMainHeight) + maxScriptedMainHeight = height; + } + } + public void checkScriptedWindowSizes(){ //This is a kludge to fix the bug where windows can open at much greater width than they should have + if (maxScriptedPoppedWidth == 0) + return; + int ow = getBounds().width; + if (ow != maxScriptedMainWidth){ + Insets insets = getInsets(); + storeInsets(insets); + + int totalNeededWidth = maxScriptedMainWidth + insets.left + insets.right; + setSavedDimensions(totalNeededWidth, getBounds().height); + setSize(totalNeededWidth, getBounds().height); + resetSizes(true); + for (int i = 0; i=0)) //POPOUTBUGS: If window is popped out in separate window, then this doesn't work, in part as windows.indexOf(w)=0 but there is only one window. return; diff --git a/Source/mesquite/lib/MesquiteHTMLWindow.java b/Source/mesquite/lib/MesquiteHTMLWindow.java index 310af241a..57e96304b 100644 --- a/Source/mesquite/lib/MesquiteHTMLWindow.java +++ b/Source/mesquite/lib/MesquiteHTMLWindow.java @@ -204,7 +204,7 @@ public String getTextContents() { public void windowResized(){ super.windowResized(); if (scrollPane!=null){ - if (showBack) + if (showBack && controls != null) controls.setBounds(0, 0, getWidth(), controlHeight); if (showExtraPanel) { extraPanelHeight = defaultExtraPanelHeight; diff --git a/Source/mesquite/lib/MesquiteModule.java b/Source/mesquite/lib/MesquiteModule.java index 75422f110..bebb30155 100644 --- a/Source/mesquite/lib/MesquiteModule.java +++ b/Source/mesquite/lib/MesquiteModule.java @@ -63,16 +63,16 @@ module is compatible with a particular condition (e.g. operating on continuous-v */ -public abstract class MesquiteModule extends EmployerEmployee implements Commandable, Showable, Logger, FunctionExplainable, Identifiable, FileDirtier, MesquiteListener, XMLPreferencesProcessor { +public abstract class MesquiteModule extends EmployerEmployee implements Commandable, Showable, Logger, FunctionExplainable, Identifiable, FileDirtier, MesquiteListener, XMLPreferencesProcessor, ObjectCommenter { /*.................................................................................................................*/ /** returns build date of the Mesquite system (e.g., "22 September 2003") */ public final static String getBuildDate() { - return "28 June 2018"; + return "27 December 2018"; } /*.................................................................................................................*/ /** returns version of the Mesquite system */ public final static String getMesquiteVersion() { - return "3.51"; + return "3.6"; } /*.................................................................................................................*/ /** returns letter in the build number of the Mesquite system (e.g., "e" of "e58") */ @@ -85,7 +85,7 @@ public final static String getBuildLetter() { public final static int getBuildNumber() { //as of 26 Dec 08, build naming changed from letter + number to just number. Accordingly j105 became 473, based on // highest build numbers of d51+e81+g97+h66+i69+j105 + 3 for a, b, c - return 898; + return 917; } //0.95.80 14 Mar 01 - first beta release //0.96 2 April 01 beta - second beta release @@ -136,6 +136,7 @@ public final static int getBuildNumber() { //3.40 = 877 released 27 Jan 2O18 //3.50 = 888 released 4 May 2O18 //3.51 = 898 released 28 June 2O18 + //3.6 = 917 released 27 Dec 2O18 /*.................................................................................................................*/ /** returns a string if this is a special version of Mesquite */ public final static String getSpecialVersion() { @@ -1996,6 +1997,36 @@ public Snapshot getSnapshot(MesquiteFile file) { //this allows employees to be return temp; } + /*.................................................................................................................* + * If overriding getObjectComment, we suggest this to recover from descendent employees as well + public String getObjectComment(Object object){ + String q = "this is my comment"; + + String accumulated = super.getObjectComment(object); + if (!StringUtil.blank(accumulated)) + return q + "\n" + accumulated; + else + return q; + } + + /*.................................................................................................................*/ + //See model above for overridden version + public String getObjectComment(Object object){ + StringBuffer sb = new StringBuffer(); + Enumeration e = employees.elements(); + boolean first = true; + while (e.hasMoreElements()) { + MesquiteModule mb = ((MesquiteModule)e.nextElement()); + String s = mb.getObjectComment(object); + if (!StringUtil.blank(s)){ + if (!first) + sb.append("\n"); + first = false; + sb.append(s); + } + } + return sb.toString(); + } /*__________________________________________________________*/ /** for the paging system (may be defunct)*/ public void pageModule(MesquiteModule fromModule, boolean persistent){ diff --git a/Source/mesquite/lib/MesquiteTree.java b/Source/mesquite/lib/MesquiteTree.java index 54b5053a9..895195fba 100644 --- a/Source/mesquite/lib/MesquiteTree.java +++ b/Source/mesquite/lib/MesquiteTree.java @@ -2771,21 +2771,23 @@ public double distanceToRoot (int node, boolean countUnassigned, double perUnass } /*-----------------------------------------*/ - static boolean numericalLabelInterpretationSetRUN = false; + public static boolean numericalLabelInterpretationSetRUN = false; boolean numericalLabelInterpretationSet = false; - static boolean interpretNumericalLabelsAsOnBranchesRUN = false; + public static boolean interpretNumericalLabelsAsOnBranchesRUN = false; boolean interpretNumericalLabelsAsOnBranches = false; - static boolean interpretLabelsAsNumericalRUN = false; + public static boolean interpretLabelsAsNumericalRUN = false; boolean interpretLabelsAsNumerical = false; - static String defaultValueCodeRUN = ""; + public static String defaultValueCodeRUN = ""; String defaultValueCode = ""; NameReference defaultValueCodeRef = null; boolean checkNumericalLabelInterpretation(String c){ if (numericalLabelInterpretationSet){ //user has answered, therefore follow guidance - if (interpretLabelsAsNumerical) - return true; - return false; + return (interpretLabelsAsNumerical); + } + if (MesquiteThread.isScripting()){ //scripting; use default + interpretLabelsAsNumerical = interpretLabelsAsNumericalRUN; + return (interpretLabelsAsNumerical); } if (taxa != null){ @@ -2794,6 +2796,8 @@ boolean checkNumericalLabelInterpretation(String c){ TreesManager em = (TreesManager)fc.findManager(fc, TreeVector.class); boolean[] interps = new boolean[4]; //0 interpret as number (vs. text); 1 interpret as on branch (vs. node); 2 remember MesquiteString n = new MesquiteString(); //the code name of the value, e.g. "consensusFrequency" + + //Ask ManageTrees to query the user; otherwise see scripting possibility in ManageTrees via command setDefaultNumericalLabelInterpetation numericalLabelInterpretationSet = em.queryAboutNumericalLabelIntepretation(interps, c, n); if (numericalLabelInterpretationSet){ if (interps[0]){ // treat as number @@ -3199,6 +3203,10 @@ public boolean readTree(String TreeDescription, TaxonNamer namer) { /** Reads the tree description string and sets the tree object to store the tree described.*/ public boolean readTree(String TreeDescription, TaxonNamer namer, String whitespaceString, String punctuationString) { + return readTree(TreeDescription, namer, whitespaceString, punctuationString, true); + } + /** Reads the tree description string and sets the tree object to store the tree described.*/ + public boolean readTree(String TreeDescription, TaxonNamer namer, String whitespaceString, String punctuationString, boolean readAssociated) { deassignAssociated(); MesquiteInteger stringLoc = new MesquiteInteger(0); @@ -3226,9 +3234,9 @@ public boolean readTree(String TreeDescription, TaxonNamer namer, String whitesp } String c = ParseUtil.getToken(TreeDescription, stringLoc, whitespaceString, punctuationString); //skip comma or parens if (!StringUtil.blank(c) && !(";".equals(c))){ //TODO: all these "equals" should be replaced by StringUtil static methods - if (!((",".equals(c))||(")".equals(c)) || (":".equals(c)) || "<".equals(c) || "%".equals(c) || "#".equals(c)))// name of internal node!!!! + if (!((",".equals(c))||(")".equals(c)) || (":".equals(c)) || ("<".equals(c) && readAssociated) || "%".equals(c) || "#".equals(c)))// name of internal node!!!! c = readNamedInternal(TreeDescription, c, root, stringLoc); - while (":".equals(c) || "<".equals(c)|| "%".equals(c) || "#".equals(c)) { + while (":".equals(c) || ("<".equals(c) && readAssociated)|| "%".equals(c) || "#".equals(c)) { if (":".equals(c)) { readLength(TreeDescription, root, stringLoc); c = ParseUtil.getToken(TreeDescription, stringLoc, whitespaceString, punctuationString); //skip comma or parens @@ -3247,7 +3255,7 @@ else if ("%".equals(c)||"#".equals(c)) { return false; } } - else if ("<".equals(c)) { + else if ("<".equals(c) && readAssociated) { readAssociatedInTree(TreeDescription, root, stringLoc); c = ParseUtil.getToken(TreeDescription, stringLoc, whitespaceString, punctuationString); //skip comma or parens if (!(c!=null && ":".equals(c)) && !expectedPunctuation(c)) { @@ -3255,11 +3263,11 @@ else if ("<".equals(c)) { MesquiteMessage.warnProgrammer("bad token in tree where , ) ; expected (" + c + ") 9"); return false; } - if ("<".equals(c)){ + if ("<".equals(c) && readAssociated){ readAttachedProperties(TreeDescription, stringLoc); c = ParseUtil.getToken(TreeDescription, stringLoc, whitespaceString, punctuationString); //skip comma or parens } - if ("<".equals(c)){ + if ("<".equals(c) && readAssociated){ readExtras(TreeDescription, stringLoc); c = ParseUtil.getToken(TreeDescription, stringLoc, whitespaceString, punctuationString); //skip comma or parens } diff --git a/Source/mesquite/lib/MesquiteTrunk.java b/Source/mesquite/lib/MesquiteTrunk.java index 2b7b2d56c..85132687e 100644 --- a/Source/mesquite/lib/MesquiteTrunk.java +++ b/Source/mesquite/lib/MesquiteTrunk.java @@ -243,6 +243,10 @@ public static boolean isMacOSX(){ return System.getProperty("os.name").startsWith("Mac OS X"); } /*.................................................................................................................*/ + public static String getUserName(){ + return System.getProperty("user.name"); + } + /*.................................................................................................................*/ /** Returns the first three characters of "java.version" as a string; e.g., "1.4.1" is returned as the string 1.4 */ public static String getJavaVersionAsString(){ return System.getProperty("java.version").substring(0,3); diff --git a/Source/mesquite/lib/MesquiteWindow.java b/Source/mesquite/lib/MesquiteWindow.java index 8611cf484..e117c73d6 100644 --- a/Source/mesquite/lib/MesquiteWindow.java +++ b/Source/mesquite/lib/MesquiteWindow.java @@ -57,7 +57,7 @@ public abstract class MesquiteWindow implements Listable, Commandable, OwnedByMo boolean readyToPaint = true; protected Font currentFont; public static Font defaultFont; - + boolean suppressExplanationAreaUpdates=false; private MesquiteTool currentTool; @@ -2159,7 +2159,7 @@ boolean sameName(MenuComponent current, MenuComponent target){ if ((currentMM.getLabel()== null && targetMM.getLabel()==null)) return true; if (currentMM.getLabel()== null || targetMM.getLabel()==null) - return false; + return false; return currentMM.getLabel().equals(targetMM.getLabel()); } if (current instanceof MenuItem && target instanceof MenuItem){ @@ -2168,7 +2168,7 @@ boolean sameName(MenuComponent current, MenuComponent target){ if ((currentMMI.getLabel()== null && targetMMI.getLabel()==null)) return true; if (currentMMI.getLabel()== null || targetMMI.getLabel()==null) - return false; + return false; return currentMMI.getLabel().equals(targetMMI.getLabel()); } return true; @@ -2227,6 +2227,8 @@ String listMenus(MenuBar c){ } /*........................................................*/ int sameUntil(MenuBar current, MenuBar target){ + if (current==null || target==null) + return 0; int it = 0; while (it=startOfDifference; it--){ try{ Menu m = current.getMenu(it); - disposeMenuComponent(m); - current.remove(it); + disposeMenuComponent(m); + current.remove(it); } catch (NullPointerException e){ } + catch (ArrayIndexOutOfBoundsException e){ + } } Menu[] toTransfer = new Menu[target.getMenuCount()-startOfDifference+1]; int k = 0; @@ -2824,6 +2828,7 @@ else if (checker.compare(MesquiteWindow.class, "Sets the size of the window", "[ if (MesquiteInteger.isCombinable(width) && MesquiteInteger.isCombinable(height)) { fromScriptCommand = true;//this is needed to counteract difficulties with popping in/out and size setting in window constructors setWindowSize(width, height); + parentFrame.recordScriptedWindowSize(this, width, height); fromScriptCommand = false; } } @@ -2863,20 +2868,30 @@ else if (checker.compare(MesquiteWindow.class, "Sets the location of the window" MesquiteInteger io = new MesquiteInteger(0); int x= MesquiteInteger.fromString(arguments, io); int y= MesquiteInteger.fromString(arguments, io); + int minimalVisible = 16; if (MesquiteInteger.isCombinable(x) && MesquiteInteger.isCombinable(y)) { - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - if (x> screenSize.width-16) - x=screenSize.width-64; - else if (x+getBounds().width<16) - x= 16 - getBounds().width; - if (y> screenSize.height-16) - y=screenSize.height-64; - else if (y+getBounds().height<16) - y= 16 - getBounds().height; - if (y<0) - y=0; - if (MesquiteTrunk.isMacOSX() && y<22 && x<0) //workaround for bug in OS X; June 2004 - x=0; + Rectangle effectiveScreenSize = getEffectiveScreenSize(); + double top = effectiveScreenSize.getY(); + double height = effectiveScreenSize.getHeight(); + double bottom = top+height; + double left = effectiveScreenSize.getX(); + double width = effectiveScreenSize.getWidth(); + double right = left+width; + + if (x> right-minimalVisible) { // too far to right + x=(int)width/2; + } + else if (x+getParentFrame().getBounds().width bottom-minimalVisible) // too far down + y=(int)height/2; + else if (y+getParentFrame().getBounds().height= line.length()) return null; - char c=getNextChar(); + char c=getNextCharRaw(); //Debugg.println(this had used NEXUS characters, i.e. skipped brackets) OK to have changed? buffer.setLength(0); while (!lineEndCharacter(c) && pos.getValue()<=line.length() && c!=(char)0) { buffer.append(c); - c=getNextChar(); + c=getNextCharRaw(); } if (c=='\r' && lineEndsAreDefaults()) { int pos = getPosition(); - c=getNextChar(); + c=getNextCharRaw(); if (c!='\n') // if the next char is a newline, we want to go past it; otherwise, step back setPosition(pos); } @@ -1343,6 +1343,15 @@ else if (hadBrack) { return c; } /*.................................................................................................................*/ + public char getNextCharRaw() { + int posTemp = pos.getValue(); + if (posTemp>=line.length()) + return 0; + char c = line.charAt(posTemp); + pos.increment(); + return c; + } + /*.................................................................................................................*/ public String getTokenNumber(String s, int tokenNumber) { setString(s); return getTokenNumber(tokenNumber); diff --git a/Source/mesquite/lib/PendingCommand.java b/Source/mesquite/lib/PendingCommand.java index 874f05e05..368a7b3df 100644 --- a/Source/mesquite/lib/PendingCommand.java +++ b/Source/mesquite/lib/PendingCommand.java @@ -272,11 +272,7 @@ else if (command.getOwner() instanceof Component){ //don't send command to grap finishUp(); return; } - /* - catch (InterruptedException e){ - Thread.currentThread().interrupt(); - } - */ + catch (Exception e){ crashed = true; MesquiteDialog.closeWizard(); diff --git a/Source/mesquite/lib/Puppeteer.java b/Source/mesquite/lib/Puppeteer.java index 71c715226..e63d75c10 100644 --- a/Source/mesquite/lib/Puppeteer.java +++ b/Source/mesquite/lib/Puppeteer.java @@ -341,7 +341,7 @@ else if (StringUtil.startsWithIgnoreCase(st,"String")) { else return MesquiteInteger.fromString(name); } /*--------------------------------------*/ - private boolean debugging = false; + private boolean debugging = false; private boolean logOnly = false; private MesquiteTimer timer; private boolean showTime = false; diff --git a/Source/mesquite/lib/Reconnectable.java b/Source/mesquite/lib/Reconnectable.java index cc7086788..40267e04c 100644 --- a/Source/mesquite/lib/Reconnectable.java +++ b/Source/mesquite/lib/Reconnectable.java @@ -18,5 +18,7 @@ public interface Reconnectable { /** Called when Mesquite re-reads a file that had had unfinished tree filling, e.g. by an external process, to pass along the command that should be executed on the main thread when trees are ready.*/ public void reconnectToRequester(MesquiteCommand command); + /** Called when Mesquite re-reads a file that had had unfinished tree filling, e.g. by an external process, to pass along the command that should be executed on the main thread when trees are ready.*/ + public boolean successfulReconnect(); } diff --git a/Source/mesquite/lib/ShellScriptRunner.java b/Source/mesquite/lib/ShellScriptRunner.java index a97e9190c..7fc8ff577 100644 --- a/Source/mesquite/lib/ShellScriptRunner.java +++ b/Source/mesquite/lib/ShellScriptRunner.java @@ -151,14 +151,14 @@ public void resetLastModified(int i){ if (i>=0 && i=0; i--) { char c = token.charAt(i); - if (!(defaultWhitespace.indexOf(c)>=0 || defaultPunctuation.indexOf(c)>=0)){ // not (whitespace or punctuation) + if (!(defaultWhitespace.indexOf(c)>=0 || (punct!=null && punct.indexOf(c)>=0))){ // not (whitespace or punctuation) firstDark = i; break; } diff --git a/Source/mesquite/lib/TreeDisplay.java b/Source/mesquite/lib/TreeDisplay.java index f34a1c823..0f8e4ad87 100644 --- a/Source/mesquite/lib/TreeDisplay.java +++ b/Source/mesquite/lib/TreeDisplay.java @@ -74,6 +74,14 @@ public class TreeDisplay extends TaxaTreeDisplay { private int minDist=8; int minForTerminalBoxes = 0; + /** What is the mode for highlighting selected taxa in tree displays? */ + public static final int sTHM_NONE = 0; + public static final int sTHM_GREYBOX = 1; + public static final int sTHM_BIGNAME = 2; //selectedTaxonHighlightMode/bigNameDivisor is how much bigger + // 2 should translate to 1.25X, 3 to 1.5X, 4 to 1.75X, 5 to 2X (i.e. (selectedTaxonHighlightMode + 3)/4) + public static int sTHM_DEFAULT = sTHM_GREYBOX; + public int selectedTaxonHighlightMode = sTHM_DEFAULT; + protected boolean showBranchColors = true; public static boolean printTreeNameByDefault = false; diff --git a/Source/mesquite/lib/TreeVector.java b/Source/mesquite/lib/TreeVector.java index e3f5ef1c9..ea2853240 100644 --- a/Source/mesquite/lib/TreeVector.java +++ b/Source/mesquite/lib/TreeVector.java @@ -281,7 +281,8 @@ else if (checker.compare(this.getClass(), "Duplicates the tree block", null, com } trees.addToFile(getFile(), getProject(), getManager()); - getManager().elementAdded(trees); + if (getManager()!=null) + getManager().elementAdded(trees); if (getProject() != null) getProject().decrementProjectWindowSuppression(); return trees; diff --git a/Source/mesquite/lib/characters/CharacterState.java b/Source/mesquite/lib/characters/CharacterState.java index 9c27d15ef..d9bab314b 100644 --- a/Source/mesquite/lib/characters/CharacterState.java +++ b/Source/mesquite/lib/characters/CharacterState.java @@ -91,6 +91,8 @@ public abstract class CharacterState { public abstract boolean isImpossible(); /** returns whether value is combinable (i.e. a valid assigned state) or not.*/ public abstract boolean isCombinable(); + /** returns whether the contents of the character states could be identical, given ambiguity*/ + public abstract boolean couldBeEqual(CharacterState s); /** returns whether the contents of the character states are identical*/ public abstract boolean equals(CharacterState s); /** returns whether the contents of the character states are identical, allowing some to be missing if allowMissing is true*/ diff --git a/Source/mesquite/lib/duties/TaxonNameStyler.java b/Source/mesquite/lib/duties/TaxonNameStyler.java new file mode 100644 index 000000000..dfd843586 --- /dev/null +++ b/Source/mesquite/lib/duties/TaxonNameStyler.java @@ -0,0 +1,54 @@ +/* Mesquite source code. Copyright 1997 and onward, W. Maddison and D. Maddison. + + +Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. +The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. +Perhaps with your help we can be more than a few, and make Mesquite better. + +Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. +Mesquite's web site is http://mesquiteproject.org + +This source code and its compiled class files are free and modifiable under the terms of +GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) +*/ +package mesquite.lib.duties; + +import java.awt.*; +import mesquite.lib.*; + + +/* ======================================================================== */ + +public abstract class TaxonNameStyler extends MesquiteModule { + + public Class getDutyClass() { + return TaxonNameStyler.class; + } + public String[] getDefaultModule() { + return new String[] { "#NoColorForTaxon"}; + } + public String getDutyName() { + return "Supplier of color for taxon name"; + } + public void initialize(Taxa taxa){ + } + + /*Use this to survey all the taxa as needed, e.g. for minima and maxima. + * This is called before a lot of requests for styles for individual taxa are made. + * This is a bit dangerous. because the data could be stale because of multithreading.*/ + public void prepareToStyle(Taxa taxa){ + } + + public String getObjectComment(Object obj){ + return null; + } + public Color getTaxonNameColor(Taxa taxa, int it){ + return Color.red; + } + public boolean getTaxonNameBoldness(Taxa taxa, int it){ + return false; + } + +} + + diff --git a/Source/mesquite/lib/duties/TreeBlockFiller.java b/Source/mesquite/lib/duties/TreeBlockFiller.java index 23cb61013..8be9882ea 100644 --- a/Source/mesquite/lib/duties/TreeBlockFiller.java +++ b/Source/mesquite/lib/duties/TreeBlockFiller.java @@ -41,7 +41,7 @@ public String[] getDefaultModule() { } /** TreeBlockFillers should override this if they want special commands to be sent to a tree window if a tree window is created after they are used. */ - public String getExtraTreeWindowCommands (boolean finalTree){ + public String getExtraTreeWindowCommands (boolean finalTree, long treeBlockID){ return ""; } diff --git a/Source/mesquite/lib/duties/TreeInferer.java b/Source/mesquite/lib/duties/TreeInferer.java index 872bf597c..c9378f704 100644 --- a/Source/mesquite/lib/duties/TreeInferer.java +++ b/Source/mesquite/lib/duties/TreeInferer.java @@ -115,7 +115,7 @@ public Snapshot getSnapshot(MesquiteFile file) { public Object doCommand(String commandName, String arguments, CommandChecker checker) { if (checker.compare(this.getClass(), "Sets the module showing the tree", "[name of module]", commandName, "setWindowMaker")) { tWindowMaker = (TWindowMaker)hireNamedEmployee(TWindowMaker.class, "#ObedientTreeWindow"); - String commands = getExtraTreeWindowCommands(false); + String commands = getExtraTreeWindowCommands(false, MesquiteLong.unassigned); //DAVIDCHECK: MesquiteWindow w = tWindowMaker.getModuleWindow(); if (w != null){ @@ -186,7 +186,7 @@ else if (orientation == TreeDisplay.UP || orientation == TreeDisplay.DOWN){ public void showIntermediatesWindow(){ if (tWindowMaker == null) { tWindowMaker = (TWindowMaker)hireNamedEmployee(TWindowMaker.class, "#ObedientTreeWindow"); - String commands = getExtraTreeWindowCommands(false); + String commands = getExtraTreeWindowCommands(false, MesquiteLong.unassigned); MesquiteWindow w = tWindowMaker.getModuleWindow(); if (w != null){ diff --git a/Source/mesquite/lib/duties/TreeSearcher.java b/Source/mesquite/lib/duties/TreeSearcher.java index 35c6894ae..36c09f51e 100644 --- a/Source/mesquite/lib/duties/TreeSearcher.java +++ b/Source/mesquite/lib/duties/TreeSearcher.java @@ -65,11 +65,14 @@ public String getTreeBlockName(boolean completedRun){ public String getExtraTreeWindowCommands (boolean finalTree){ - return ""; - } + return ""; + } + public String getExtraTreeWindowCommands (boolean finalTree, long treeBlockID){ + return ""; + } public String getExtraIntermediateTreeWindowCommands (){ - return ""; - } + return ""; + } /** Fills the passed tree block with trees. */ public abstract void fillTreeBlock(TreeVector treeList); diff --git a/Source/mesquite/lib/table/MesquiteTable.java b/Source/mesquite/lib/table/MesquiteTable.java index 44df40636..b36d76823 100644 --- a/Source/mesquite/lib/table/MesquiteTable.java +++ b/Source/mesquite/lib/table/MesquiteTable.java @@ -1897,9 +1897,11 @@ public int getMatrixHeight() { private synchronized void printComponent(Graphics g, Panel c) { int shiftX = c.getBounds().x; int shiftY = c.getBounds().y; - g.translate(shiftX, shiftY); - c.print(g); - g.translate(-shiftX, -shiftY); + if (g!=null) { + g.translate(shiftX, shiftY); + c.print(g); + g.translate(-shiftX, -shiftY); + } } /* ............................................................................................................... */ @@ -5658,12 +5660,12 @@ public void setShowRowNames(boolean showRowNames) { this.showRowNames = showRowNames; } - public synchronized void mouseWheelMoved(MouseWheelEvent e) { + public synchronized void mouseWheelMoved(MouseWheelEvent e) { //scrollwheel int amount = e.getScrollAmount(); //verticalScrollPageIncrement, numColumnsVisible boolean blockScroll = e.getScrollType()==MouseWheelEvent.WHEEL_BLOCK_SCROLL; boolean vert = !e.isShiftDown(); boolean upleft=false; - if (MesquiteTrunk.isJavaGreaterThanOrEqualTo(1.7)) // this and following line are to fix the bug in Java 8 update 161 + if (MesquiteTrunk.isJavaGreaterThanOrEqualTo(1.8)) // this and following line are to fix the bug in Java 8 update 161 upleft = e.getPreciseWheelRotation()<0; else upleft = e.getWheelRotation()<0; diff --git a/Source/mesquite/lists/TaxonList/TaxonList.java b/Source/mesquite/lists/TaxonList/TaxonList.java index 159d8f51b..1081db75b 100644 --- a/Source/mesquite/lists/TaxonList/TaxonList.java +++ b/Source/mesquite/lists/TaxonList/TaxonList.java @@ -467,7 +467,7 @@ public void setRowName(int row, String name){ String warning = taxa.checkNameLegality(row, name); if (warning == null) taxa.setTaxonName(row, name); - else + else if (ownerModule!=null) ownerModule.discreetAlert( warning); } } diff --git a/Source/mesquite/lists/TaxonListVoucherCode/TaxonListVoucherCode.java b/Source/mesquite/lists/TaxonListVoucherCode/TaxonListVoucherCode.java index e8a7bbc92..ef386dcaa 100644 --- a/Source/mesquite/lists/TaxonListVoucherCode/TaxonListVoucherCode.java +++ b/Source/mesquite/lists/TaxonListVoucherCode/TaxonListVoucherCode.java @@ -1 +1 @@ -/* Mesquite source code. Copyright 2005 and onward, David Maddison and Wayne Maddison. Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. Perhaps with your help we can be more than a few, and make Mesquite better. Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. Mesquite's web site is http://mesquiteproject.org This source code and its compiled class files are free and modifiable under the terms of GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) */ package mesquite.lists.TaxonListVoucherCode; /*~~ */ import mesquite.lists.lib.*; import mesquite.lib.characters.*; import mesquite.lib.*; import mesquite.lib.table.*; /* ======================================================================== */ public class TaxonListVoucherCode extends TaxonListAssistant { Taxa taxa; MesquiteTable table=null; OTUIDCodeInfoCoord voucherInfoTask; MesquiteMenuItemSpec msSetID, fd, wpmMI; /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName) { //temporary voucherInfoTask = (OTUIDCodeInfoCoord)hireEmployee(OTUIDCodeInfoCoord.class, null); return true; } //temporary public String getExplanationForRow(int ic){ if (taxa!=null && voucherInfoTask != null) { VoucherInfoFromOTUIDDB vi= voucherInfoTask.getVoucherInfo((String)taxa.getAssociatedObject(VoucherInfoFromOTUIDDB.voucherDBRef, ic), (String)taxa.getAssociatedObject(VoucherInfoFromOTUIDDB.voucherCodeRef, ic)); if (vi != null) return vi.toGenBankString(); } return null; } /*.................................................................................................................*/ public void setTableAndTaxa(MesquiteTable table, Taxa taxa){ if (this.taxa != null) this.taxa.removeListener(this); this.taxa = taxa; if (this.taxa != null) this.taxa.addListener(this); this.table = table; deleteMenuItem(msSetID); msSetID = addMenuItem("Get OTU ID code from first token of taxon name", makeCommand("setIDFromNameFirstToken", this)); msSetID = addMenuItem("Get OTU ID code from last token of taxon name", makeCommand("setIDFromName", this)); msSetID = addMenuItem("Prefix OTU ID code...", makeCommand("prefixIDCode", this)); fd = addMenuItem("Select taxa with duplicate IDs", makeCommand("selectDuplicates", this)); // wpmMI = addMenuItem("Find Voucher ID in taxon name (WPM Lab Only)", makeCommand("findWPMID", this)); } /*.................................................................................................................*/ public void dispose() { super.dispose(); if (taxa!=null) taxa.removeListener(this); } /*.................................................................................................................*/ private void prefixIDCode(){ if (table !=null && taxa!=null) { MesquiteString prefix = new MesquiteString(""); if (!QueryDialogs.queryShortString(containerOfModule(), "Prefix", "Prefix", prefix)) return; if (StringUtil.blank(prefix.toString())) return; String id = ""; boolean changed=false; boolean anySelected = table.anyCellSelectedAnyWay(); if (employer!=null && employer instanceof ListModule) { int c = ((ListModule)employer).getMyColumn(this); for (int i=0; i=0) id = name.substring(name.indexOf("JXZ"), name.indexOf("JXZ")+6); else if (name.indexOf("MRB") >=0) id = name.substring(name.indexOf("MRB"), name.indexOf("MRB")+6); else if (name.indexOf(".DNA") >=0) id = name.substring(name.indexOf(".DNA")+1, name.indexOf(".DNA")+8); else if (name.indexOf(".d") >=0) id = name.substring(name.indexOf(".d")+1, name.indexOf(".d")+5); else if (name.indexOf(".s") >=0) id = name.substring(name.indexOf(".s")+1, name.indexOf(".s")+5); else if (name.indexOf(".S") >=0){ int st = name.indexOf(".S"); int lg = name.length(); if (st+5<= lg) id = name.substring(name.indexOf(".S")+1, name.indexOf(".S")+5); else if (st+4<= lg) id = name.substring(name.indexOf(".S")+1, name.indexOf(".S")+4); else if (st+3<= lg) id = name.substring(name.indexOf(".S")+1, name.indexOf(".S")+3); else if (st+2<= lg) id = name.substring(name.indexOf(".S")+1, name.indexOf(".S")+2); } else if (name.indexOf(".GR") >=0) id = name.substring(name.indexOf(".GR")+1, name.indexOf(".GR")+6); else if (name.indexOf("d0") >=0) id = name.substring(name.indexOf("d0"), name.indexOf("d0")+4); else if (name.indexOf("d1") >=0) id = name.substring(name.indexOf("d1"), name.indexOf("d1")+4); else if (name.indexOf("d2") >=0) id = name.substring(name.indexOf("d2"), name.indexOf("d2")+4); else if (name.indexOf("d3") >=0) id = name.substring(name.indexOf("d3"), name.indexOf("d3")+4); else if (name.indexOf("d4") >=0) id = name.substring(name.indexOf("d4"), name.indexOf("d4")+4); if (!StringUtil.blank(id)){ taxa.setAssociatedObject(VoucherInfoFromOTUIDDB.voucherCodeRef, i, id); if (!changed) outputInvalid(); changed = true; } } } } // if (changed) // data.notifyListeners(this, new Notification(MesquiteListener.NAMES_CHANGED)); //TODO: bogus! should notify via specs not data??? outputInvalid(); parametersChanged(); } } /*.................................................................................................................*/ public Object doCommand(String commandName, String arguments, CommandChecker checker) { if (checker.compare(this.getClass(), "Sets the OTU ID code to be the last token of the taxon name", null, commandName, "setIDFromName")) { setIDFromTaxonName(true); } else if (checker.compare(this.getClass(), "Sets the OTU ID code to be the first token of the taxon name", null, commandName, "setIDFromNameFirstToken")) { setIDFromTaxonName(false); } else if (checker.compare(this.getClass(), "Prefixes the OTU ID code with a string", null, commandName, "prefixIDCode")) { prefixIDCode(); } else if (checker.compare(this.getClass(), "Finds the OTU ID code in the taxon name (WPM lab only)", null, commandName, "findWPMID")) { findIDInTaxonNameWPM(); } else if (checker.compare(this.getClass(), "Selects taxa with duplicate Names", null, commandName, "selectDuplicates")) { selectDuplicates(); } else return super.doCommand(commandName, arguments, checker); return null; } public void changed(Object caller, Object obj, Notification notification){ outputInvalid(); parametersChanged(notification); } public String getTitle() { return "OTU ID code"; } public String getStringForTaxon(int ic){ if (taxa!=null) { Object n = (String)taxa.getAssociatedObject(VoucherInfoFromOTUIDDB.voucherCodeRef, ic); if (n !=null) return ((String)n); } return "-"; } /*...............................................................................................................*/ /** returns whether or not a cell of table is editable.*/ public boolean isCellEditable(int row){ return true; } /*...............................................................................................................*/ /** for those permitting editing, indicates user has edited to incoming string.*/ public void setString(int row, String s){ if (taxa!=null) { taxa.setAssociatedObject(VoucherInfoFromOTUIDDB.voucherCodeRef, row, s); } } public boolean useString(int ic){ return true; } public String getWidestString(){ return "88888888888888888 "; } /*.................................................................................................................*/ public String getName() { return "OTU ID Code"; } /*.................................................................................................................*/ public boolean isPrerelease(){ return false; } /*.................................................................................................................*/ /** returns the version number at which this module was first released. If 0, then no version number is claimed. If a POSITIVE integer * then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite. * If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/ public int getVersionOfFirstRelease(){ return -1; } /*.................................................................................................................*/ /** returns whether this module is requesting to appear as a primary choice */ public boolean requestPrimaryChoice(){ return true; } /*.................................................................................................................*/ /** returns an explanation of what the module does.*/ public String getExplanation() { return "Lists the OTU ID code for a taxon." ; } } \ No newline at end of file +/* Mesquite source code. Copyright 2005 and onward, David Maddison and Wayne Maddison. Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. Perhaps with your help we can be more than a few, and make Mesquite better. Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. Mesquite's web site is http://mesquiteproject.org This source code and its compiled class files are free and modifiable under the terms of GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) */ package mesquite.lists.TaxonListVoucherCode; /*~~ */ import mesquite.lists.lib.*; import mesquite.lib.characters.*; import java.awt.Label; import mesquite.lib.*; import mesquite.lib.table.*; /* ======================================================================== */ public class TaxonListVoucherCode extends TaxonListAssistant { Taxa taxa; MesquiteTable table=null; OTUIDCodeInfoCoord voucherInfoTask; MesquiteMenuItemSpec msSetID, fd, wpmMI; /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName) { //temporary voucherInfoTask = (OTUIDCodeInfoCoord)hireEmployee(OTUIDCodeInfoCoord.class, null); return true; } //temporary public String getExplanationForRow(int ic){ if (taxa!=null && voucherInfoTask != null) { VoucherInfoFromOTUIDDB vi= voucherInfoTask.getVoucherInfo((String)taxa.getAssociatedObject(VoucherInfoFromOTUIDDB.voucherDBRef, ic), (String)taxa.getAssociatedObject(VoucherInfoFromOTUIDDB.voucherCodeRef, ic)); if (vi != null) return vi.toGenBankString(); } return null; } /*.................................................................................................................*/ public void setTableAndTaxa(MesquiteTable table, Taxa taxa){ if (this.taxa != null) this.taxa.removeListener(this); this.taxa = taxa; if (this.taxa != null) this.taxa.addListener(this); this.table = table; deleteMenuItem(msSetID); msSetID = addMenuItem("Get OTU ID code from first token of taxon name", makeCommand("setIDFromNameFirstToken", this)); msSetID = addMenuItem("Get OTU ID code from last token of taxon name", makeCommand("setIDFromName", this)); msSetID = addMenuItem("Prefix OTU ID code...", makeCommand("prefixIDCode", this)); msSetID = addMenuItem("Search and Replace in OTU ID code...", makeCommand("searchReplaceIDCode", this)); fd = addMenuItem("Select taxa with duplicate IDs", makeCommand("selectDuplicates", this)); // wpmMI = addMenuItem("Find Voucher ID in taxon name (WPM Lab Only)", makeCommand("findWPMID", this)); } /*.................................................................................................................*/ public void dispose() { super.dispose(); if (taxa!=null) taxa.removeListener(this); } /*.................................................................................................................*/ private void prefixIDCode(){ if (table !=null && taxa!=null) { MesquiteString prefix = new MesquiteString(""); if (!QueryDialogs.queryShortString(containerOfModule(), "Prefix", "Prefix", prefix)) return; if (StringUtil.blank(prefix.toString())) return; String id = ""; boolean changed=false; boolean anySelected = table.anyCellSelectedAnyWay(); if (employer!=null && employer instanceof ListModule) { int c = ((ListModule)employer).getMyColumn(this); for (int i=0; i=0) id = name.substring(name.indexOf("JXZ"), name.indexOf("JXZ")+6); else if (name.indexOf("MRB") >=0) id = name.substring(name.indexOf("MRB"), name.indexOf("MRB")+6); else if (name.indexOf(".DNA") >=0) id = name.substring(name.indexOf(".DNA")+1, name.indexOf(".DNA")+8); else if (name.indexOf(".d") >=0) id = name.substring(name.indexOf(".d")+1, name.indexOf(".d")+5); else if (name.indexOf(".s") >=0) id = name.substring(name.indexOf(".s")+1, name.indexOf(".s")+5); else if (name.indexOf(".S") >=0){ int st = name.indexOf(".S"); int lg = name.length(); if (st+5<= lg) id = name.substring(name.indexOf(".S")+1, name.indexOf(".S")+5); else if (st+4<= lg) id = name.substring(name.indexOf(".S")+1, name.indexOf(".S")+4); else if (st+3<= lg) id = name.substring(name.indexOf(".S")+1, name.indexOf(".S")+3); else if (st+2<= lg) id = name.substring(name.indexOf(".S")+1, name.indexOf(".S")+2); } else if (name.indexOf(".GR") >=0) id = name.substring(name.indexOf(".GR")+1, name.indexOf(".GR")+6); else if (name.indexOf("d0") >=0) id = name.substring(name.indexOf("d0"), name.indexOf("d0")+4); else if (name.indexOf("d1") >=0) id = name.substring(name.indexOf("d1"), name.indexOf("d1")+4); else if (name.indexOf("d2") >=0) id = name.substring(name.indexOf("d2"), name.indexOf("d2")+4); else if (name.indexOf("d3") >=0) id = name.substring(name.indexOf("d3"), name.indexOf("d3")+4); else if (name.indexOf("d4") >=0) id = name.substring(name.indexOf("d4"), name.indexOf("d4")+4); if (!StringUtil.blank(id)){ taxa.setAssociatedObject(VoucherInfoFromOTUIDDB.voucherCodeRef, i, id); if (!changed) outputInvalid(); changed = true; } } } } // if (changed) // data.notifyListeners(this, new Notification(MesquiteListener.NAMES_CHANGED)); //TODO: bogus! should notify via specs not data??? outputInvalid(); parametersChanged(); } } /*.................................................................................................................*/ public Object doCommand(String commandName, String arguments, CommandChecker checker) { if (checker.compare(this.getClass(), "Sets the OTU ID code to be the last token of the taxon name", null, commandName, "setIDFromName")) { setIDFromTaxonName(true); } else if (checker.compare(this.getClass(), "Sets the OTU ID code to be the first token of the taxon name", null, commandName, "setIDFromNameFirstToken")) { setIDFromTaxonName(false); } else if (checker.compare(this.getClass(), "Prefixes the OTU ID code with a string", null, commandName, "prefixIDCode")) { prefixIDCode(); } else if (checker.compare(this.getClass(), "Searches and replaces text in the OTU ID code", null, commandName, "searchReplaceIDCode")) { searchReplaceIDCode(); } else if (checker.compare(this.getClass(), "Finds the OTU ID code in the taxon name (WPM lab only)", null, commandName, "findWPMID")) { findIDInTaxonNameWPM(); } else if (checker.compare(this.getClass(), "Selects taxa with duplicate Names", null, commandName, "selectDuplicates")) { selectDuplicates(); } else return super.doCommand(commandName, arguments, checker); return null; } public void changed(Object caller, Object obj, Notification notification){ outputInvalid(); parametersChanged(notification); } public String getTitle() { return "OTU ID code"; } public String getStringForTaxon(int ic){ if (taxa!=null) { Object n = (String)taxa.getAssociatedObject(VoucherInfoFromOTUIDDB.voucherCodeRef, ic); if (n !=null) return ((String)n); } return "-"; } /*...............................................................................................................*/ /** returns whether or not a cell of table is editable.*/ public boolean isCellEditable(int row){ return true; } /*...............................................................................................................*/ /** for those permitting editing, indicates user has edited to incoming string.*/ public void setString(int row, String s){ if (taxa!=null) { taxa.setAssociatedObject(VoucherInfoFromOTUIDDB.voucherCodeRef, row, s); } } public boolean useString(int ic){ return true; } public String getWidestString(){ return "88888888888888888 "; } /*.................................................................................................................*/ public String getName() { return "OTU ID Code"; } /*.................................................................................................................*/ public boolean isPrerelease(){ return false; } /*.................................................................................................................*/ /** returns the version number at which this module was first released. If 0, then no version number is claimed. If a POSITIVE integer * then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite. * If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/ public int getVersionOfFirstRelease(){ return -1; } /*.................................................................................................................*/ /** returns whether this module is requesting to appear as a primary choice */ public boolean requestPrimaryChoice(){ return true; } /*.................................................................................................................*/ /** returns an explanation of what the module does.*/ public String getExplanation() { return "Lists the OTU ID code for a taxon." ; } } \ No newline at end of file diff --git a/Source/mesquite/lists/lib/ListWindow.java b/Source/mesquite/lists/lib/ListWindow.java index 94296e8c9..d279b89ba 100644 --- a/Source/mesquite/lists/lib/ListWindow.java +++ b/Source/mesquite/lists/lib/ListWindow.java @@ -131,7 +131,8 @@ public ListWindow (ListModule ownerModule) { resetTitle(); } public void requestFocus(){ - table.requestFocus(); + if (table!=null) + table.requestFocus(); } public String getFindLabel(){ return "Find String in Table..."; diff --git a/Source/mesquite/meristic/lib/MeristicState.java b/Source/mesquite/meristic/lib/MeristicState.java index 590773e4e..1c806f0ab 100644 --- a/Source/mesquite/meristic/lib/MeristicState.java +++ b/Source/mesquite/meristic/lib/MeristicState.java @@ -239,6 +239,11 @@ public boolean equals(CharacterState s, boolean allowMissing) { public boolean equals(CharacterState s, boolean allowMissing, boolean allowNearExact) { return equals(s,allowMissing); } + /*..........................................MeristicState.....................................*/ + /**returns true iff state sets are same, or could be the same given ambiguity */ + public boolean couldBeEqual(CharacterState s) { + return equals(s, true); + } /*..........................................MeristicState................*/ public static int absolute(int d) { if (d== unassigned || d==inapplicable || d==impossible || d==infinite) diff --git a/Source/mesquite/minimal/BasicFileCoordinator/ProjectWindow.java b/Source/mesquite/minimal/BasicFileCoordinator/ProjectWindow.java index 6391993a3..ad7076754 100644 --- a/Source/mesquite/minimal/BasicFileCoordinator/ProjectWindow.java +++ b/Source/mesquite/minimal/BasicFileCoordinator/ProjectWindow.java @@ -696,7 +696,7 @@ void resetSizes(){ resetSizes(getBounds().width, getBounds().height); } void resetSizes(int w, int h){ - if (bfc.isDoomed() || bfc.getProject().refreshSuppression>0) + if (bfc!=null && (bfc.isDoomed() || bfc.getProject().refreshSuppression>0)) return; int max = getHeight(); int vertical = 2; diff --git a/Source/mesquite/minimal/Installer/Installer.java b/Source/mesquite/minimal/Installer/Installer.java index 7da6a1225..f1a2faf1b 100644 --- a/Source/mesquite/minimal/Installer/Installer.java +++ b/Source/mesquite/minimal/Installer/Installer.java @@ -361,7 +361,7 @@ public boolean executeScriptString(String script, boolean precedeWithCDToMesquit MesquiteBoolean b = new MesquiteBoolean(); String scriptPath = createSupportDirectory(b) + MesquiteFile.fileSeparator + "script"; if (precedeWithCDToMesquiteFolder) - script = ShellScriptUtil.getChangeDirectoryCommand(getRootPath()) + script; + script = ShellScriptUtil.getChangeDirectoryCommand(MesquiteTrunk.isWindows(), getRootPath()) + script; MesquiteFile.putFileContents(scriptPath, script, false); return ShellScriptUtil.executeAndWaitForShell(scriptPath, "installScript"); } diff --git a/Source/mesquite/minimal/InterpretNEXUS/InterpretNEXUS.java b/Source/mesquite/minimal/InterpretNEXUS/InterpretNEXUS.java index ded1816e9..af61f91ce 100644 --- a/Source/mesquite/minimal/InterpretNEXUS/InterpretNEXUS.java +++ b/Source/mesquite/minimal/InterpretNEXUS/InterpretNEXUS.java @@ -433,8 +433,11 @@ else if (getProject().getNumberTaxas()>0){ } if (getProject() != null) { resolveCharMatrixIDs(); + MesquiteFrame f = getProject().getFrame(); + f.checkScriptedWindowSizes(); } decrementMenuResetSuppression(); + } /*.................................................................................................................*/ private int getNumberCharMatricesWithAssignedID(long ref) { //MOVE TO InterpretNEXUS diff --git a/Source/mesquite/molec/ColorTaxonByNumDataInMatrices/ColorTaxonByNumDataInMatrices.java b/Source/mesquite/molec/ColorTaxonByNumDataInMatrices/ColorTaxonByNumDataInMatrices.java new file mode 100644 index 000000000..286509c67 --- /dev/null +++ b/Source/mesquite/molec/ColorTaxonByNumDataInMatrices/ColorTaxonByNumDataInMatrices.java @@ -0,0 +1,117 @@ +/* Mesquite source code. Copyright 1997 and onward, W. Maddison and D. Maddison. + + +Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. +The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. +Perhaps with your help we can be more than a few, and make Mesquite better. + +Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. +Mesquite's web site is http://mesquiteproject.org + +This source code and its compiled class files are free and modifiable under the terms of +GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) + */ +package mesquite.molec.ColorTaxonByNumDataInMatrices; + +import java.util.*; +import java.awt.*; +import mesquite.lib.*; +import mesquite.lib.characters.CharacterData; +import mesquite.lib.duties.*; + +/* ======================================================================== */ +public class ColorTaxonByNumDataInMatrices extends TaxonNameStyler { + /*.................................................................................................................*/ + public boolean startJob(String arguments, Object condition, boolean hiredByName) { + return true; + } + + /*.................................................................................................................*/ + /** returns whether this module is requesting to appear as a primary choice */ + public boolean requestPrimaryChoice(){ + return true; + } + /*.................................................................................................................*/ + public boolean isSubstantive(){ + return false; + } + /*.................................................................................................................*/ + public boolean isPrerelease(){ + return false; + } + /*.................................................................................................................*/ + public int getVersionOfFirstRelease(){ + return 360; + } + + private int getNumMatricesWithDataForTaxon(Taxa taxa, int it){ + int totMatrices = getProject().getNumberCharMatrices(taxa); + int numMatrices = 0; + if (totMatrices >0){ + for (int im = 0; im < totMatrices; im++){ + CharacterData data = getProject().getCharacterMatrix(taxa, im); + if (data.hasDataForTaxon(it)){ + numMatrices++; + } + } + } + return numMatrices; + } + /*.................................................................................................................*/ + MesquiteColorTable colorTable = MesquiteColorTable.DEFAULTGRAYTABLE.cloneColorTable(); + + public Color getTaxonNameColor(Taxa taxa, int it){ + int totMatrices = getProject().getNumberCharMatrices(taxa); + if (totMatrices >0){ + int numMatrices = getNumMatricesWithDataForTaxon(taxa, it); + return colorTable.getColor(totMatrices+1, numMatrices); + } + return null; + } + public boolean getTaxonNameBoldness(Taxa taxa, int it){ + int totMatrices = getProject().getNumberCharMatrices(taxa); + if (totMatrices >0){ + int numMatrices = getNumMatricesWithDataForTaxon(taxa, it); + return totMatrices ==numMatrices; + } + return false; + } + public String getObjectComment(Object obj){ + Taxon taxon = ((Taxon)obj); + Taxa taxa = taxon.getTaxa(); + int it = taxon.getNumber(); + String s = ""; + int totMatrices = getProject().getNumberCharMatrices(taxa); + int matricesWithData = 0; + if (totMatrices >0){ + for (int im = 0; im < totMatrices; im++){ + CharacterData data = getProject().getCharacterMatrix(taxa, im); + if (data.hasDataForTaxon(it)){ + matricesWithData++; + s = s + " — " + data.getName(); + } + } + } + + if (matricesWithData==1) + return "Taxon has data in this matrix " + s; + else if (matricesWithData >1) { + if (s.length()<300) + return "Taxon has data in these " + matricesWithData + " matrices: " + s; + else + return "Taxon has data in " + matricesWithData + " matrices"; + } + else + return "Taxon has data in no matrices"; + + } + /*.................................................................................................................*/ + public String getName() { + return "Emphasize Taxa With Data in More Matrices"; + } + /*.................................................................................................................*/ + /** returns an explanation of what the module does.*/ + public String getExplanation() { + return "Supplies the colors and boldness proportional to the number of matrices for which the taxon has data." ; + } +} diff --git a/Source/mesquite/molec/ColorTaxonByNumber/ColorTaxonByNumber.java b/Source/mesquite/molec/ColorTaxonByNumber/ColorTaxonByNumber.java new file mode 100644 index 000000000..7c6a68e95 --- /dev/null +++ b/Source/mesquite/molec/ColorTaxonByNumber/ColorTaxonByNumber.java @@ -0,0 +1,173 @@ +/* Mesquite source code. Copyright 1997 and onward, W. Maddison and D. Maddison. + + +Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. +The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. +Perhaps with your help we can be more than a few, and make Mesquite better. + +Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. +Mesquite's web site is http://mesquiteproject.org + +This source code and its compiled class files are free and modifiable under the terms of +GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) + */ +package mesquite.molec.ColorTaxonByNumber; + +import java.util.*; +import java.awt.*; +import mesquite.lib.*; +import mesquite.lib.characters.CharacterData; +import mesquite.lib.duties.*; + +/* ======================================================================== */ +public class ColorTaxonByNumber extends TaxonNameStyler { + NumberForTaxon numberTask; + MesquiteString ntName; + MesquiteCommand nTC; + MesquiteSubmenuSpec mss; + Taxa myTaxa = null; + /*.................................................................................................................*/ + public boolean startJob(String arguments, Object condition, boolean hiredByName) { + numberTask = (NumberForTaxon)hireEmployee(NumberForTaxon.class, "Value for coloring cells");//shouldn't ask as this is an init and might not be needed. "Value to calculate for character state in taxon" + if (numberTask == null) + return false; + ntName = new MesquiteString(); + nTC =makeCommand("setNumberTask", this); + numberTask.setHiringCommand(nTC); + ntName.setValue(numberTask.getName()); + if (numModulesAvailable(NumberForTaxon.class)>0) { + mss = addSubmenu(null, "Values for Colors of Taxon Names", nTC, NumberForTaxon.class); + mss.setSelected(ntName); + } + return true; + } + + /*.................................................................................................................*/ + /** returns whether this module is requesting to appear as a primary choice */ + public boolean requestPrimaryChoice(){ + return true; + } + /*.................................................................................................................*/ + public boolean isSubstantive(){ + return false; + } + /*.................................................................................................................*/ + public boolean isPrerelease(){ + return false; + } + /*.................................................................................................................*/ + public int getVersionOfFirstRelease(){ + return 360; + } + + /*.................................................................................................................*/ + public Snapshot getSnapshot(MesquiteFile file) { + if (numberTask ==null) + return null; + Snapshot temp = new Snapshot(); + temp.addLine("setNumberTask ", numberTask); + return temp; + } + /*.................................................................................................................*/ + public Object doCommand(String commandName, String arguments, CommandChecker checker) { + if (checker.compare(this.getClass(), "Sets the module that calculates numbers by which to color the taxon names", "[name of module]", commandName, "setNumberTask")) { + NumberForTaxon temp = (NumberForTaxon)replaceEmployee(NumberForTaxon.class, arguments, "Module to calculate numbers by which to color taxon names", numberTask); + if (temp!=null) { + numberTask = temp; + ntName.setValue(numberTask.getName()); + numberTask.setHiringCommand(nTC); + ntName.setValue(numberTask.getName()); + parametersChanged(); + return numberTask; + } + } + else + return super.doCommand(commandName, arguments, checker); + return null; + } + private int getNumMatricesWithDataForTaxon(Taxa taxa, int it){ + int totMatrices = getProject().getNumberCharMatrices(taxa); + int numMatrices = 0; + if (totMatrices >0){ + for (int im = 0; im < totMatrices; im++){ + CharacterData data = getProject().getCharacterMatrix(taxa, im); + if (data.hasDataForTaxon(it)){ + numMatrices++; + } + } + } + return numMatrices; + } + /*.................................................................................................................*/ + MesquiteColorTable colorTable = MesquiteColorTable.DEFAULTGRAYTABLE.cloneColorTable(); + MesquiteNumber minimum = new MesquiteNumber(); + MesquiteNumber maximum = new MesquiteNumber(); + public void initialize(Taxa taxa){ + colorTable.setMode(MesquiteColorTable.GRAYSCALE); + if (myTaxa != taxa){ + numberTask.initialize(taxa); + myTaxa = taxa; + } + } + + public void prepareToStyle(Taxa taxa){ + if (myTaxa != taxa){ + numberTask.initialize(taxa); + myTaxa = taxa; + parametersChanged(); + return; + } + minimum.setToUnassigned(); + maximum.setToUnassigned(); + MesquiteNumber result = new MesquiteNumber(); + for (int it = 0; itMIN){ + //make min 20% smaller so that min isn't white + MIN = MIN - 0.2*(MAX-MIN); + Taxon taxon = taxa.getTaxon(it); + numberTask.calculateNumber(taxon, result, null); + if (result.isCombinable()){ + return colorTable.getColor(result.getDoubleValue(), MIN, MAX); + } + } + } + return null; + } + public boolean getTaxonNameBoldness(Taxa taxa, int it){ + return true; + } + public String getObjectComment(Object obj){ + Taxon taxon = ((Taxon)obj); + Taxa taxa = taxon.getTaxa(); + if (myTaxa != taxa) + prepareToStyle(taxa); + MesquiteNumber result = new MesquiteNumber(); + MesquiteString resultString = new MesquiteString(); + numberTask.calculateNumber(taxon, result, resultString); + return resultString.getValue(); + } + /*.................................................................................................................*/ + public String getName() { + return "Color Taxa By Number"; + } + /*.................................................................................................................*/ + /** returns an explanation of what the module does.*/ + public String getExplanation() { + return "Supplies the color for a taxon name according to a number calculated for the taxa." ; + } +} diff --git a/Source/mesquite/molec/LocalBlaster/LocalBlaster.java b/Source/mesquite/molec/LocalBlaster/LocalBlaster.java index 042d9cd74..cc56a2abc 100644 --- a/Source/mesquite/molec/LocalBlaster/LocalBlaster.java +++ b/Source/mesquite/molec/LocalBlaster/LocalBlaster.java @@ -207,7 +207,7 @@ public void blastForMatches(String database, String blastType, String sequenceNa String outFilePath = rootDir + outFileName; StringBuffer shellScript = new StringBuffer(1000); - shellScript.append(ShellScriptUtil.getChangeDirectoryCommand(rootDir)); + shellScript.append(ShellScriptUtil.getChangeDirectoryCommand(MesquiteTrunk.isWindows(), rootDir)); String blastCommand = blastType + " -query " + fileName; blastCommand+= " -db "+database; blastCommand+=" -task blastn"; // TODO: does this need to change if the blastType differs? @@ -283,7 +283,7 @@ public String getFastaFromIDs(String[] idList, boolean isNucleotides, StringBuff String outFilePath = rootDir + outFileName; StringBuffer shellScript = new StringBuffer(1000); - shellScript.append(ShellScriptUtil.getChangeDirectoryCommand(rootDir)); + shellScript.append(ShellScriptUtil.getChangeDirectoryCommand(MesquiteTrunk.isWindows(), rootDir)); String blastCommand = "blastdbcmd -entry "+queryString + " -outfmt %f"; blastCommand+= " -db "+databaseArray[databaseNumber]; diff --git a/Source/mesquite/molec/SequenceLength/SequenceLength.java b/Source/mesquite/molec/SequenceLength/SequenceLength.java index 4e736c892..0486b1bab 100644 --- a/Source/mesquite/molec/SequenceLength/SequenceLength.java +++ b/Source/mesquite/molec/SequenceLength/SequenceLength.java @@ -126,8 +126,8 @@ public void calculateNumber(Taxon taxon, MesquiteNumber result, MesquiteString } /*.................................................................................................................*/ public String getName() { - if (currentTaxa != null && observedStates == null) - observedStates = matrixSourceTask.getCurrentMatrix(currentTaxa); + //if (currentTaxa != null && observedStates == null) + // observedStates = matrixSourceTask.getCurrentMatrix(currentTaxa); if (observedStates != null && getProject().getNumberCharMatricesVisible()>1){ CharacterData d = observedStates.getParentData(); if (d != null && d.getName()!= null) { diff --git a/Source/mesquite/molec/TopBlastMatches/TopBlastMatches.java b/Source/mesquite/molec/TopBlastMatches/TopBlastMatches.java index 178533a7f..89b3cd65c 100644 --- a/Source/mesquite/molec/TopBlastMatches/TopBlastMatches.java +++ b/Source/mesquite/molec/TopBlastMatches/TopBlastMatches.java @@ -238,7 +238,8 @@ public boolean prepareReportDirectory() { public void saveBLASTReport(String name, String contents) { if (StringUtil.blank(reportDirectoryPath)) return; - + if (name==null || name.length()>30) + name = "BLAST databases"; String blastReportPath = reportDirectoryPath + name; // directory into which processed files go blastReportPath = MesquiteFile.getUniqueNumberedPath(blastReportPath); if (!StringUtil.blank(blastReportPath)) { diff --git a/Source/mesquite/opentree/CopyNewickForOpenTree/CopyNewickForOpenTree.java b/Source/mesquite/opentree/CopyNewickForOpenTree/CopyNewickForOpenTree.java index 4ae41a8c6..61887d361 100644 --- a/Source/mesquite/opentree/CopyNewickForOpenTree/CopyNewickForOpenTree.java +++ b/Source/mesquite/opentree/CopyNewickForOpenTree/CopyNewickForOpenTree.java @@ -38,13 +38,13 @@ public boolean startJob(String arguments, Object condition, boolean hiredByName) /*.................................................................................................................*/ public boolean loadModule(){ - return false; + return true; } public boolean isSubstantive(){ return true; } public boolean isPrerelease(){ - return true; + return false; } /*.................................................................................................................*/ public boolean queryOptions(Tree tree){ diff --git a/Source/mesquite/opentree/ExportTreeForOpenTree/ExportTreeForOpenTree.java b/Source/mesquite/opentree/ExportTreeForOpenTree/ExportTreeForOpenTree.java index 627b67c76..c498b01b3 100644 --- a/Source/mesquite/opentree/ExportTreeForOpenTree/ExportTreeForOpenTree.java +++ b/Source/mesquite/opentree/ExportTreeForOpenTree/ExportTreeForOpenTree.java @@ -33,7 +33,7 @@ public class ExportTreeForOpenTree extends FileInterpreterI { /*.................................................................................................................*/ public boolean loadModule(){ - return false; + return true; } /*.................................................................................................................*/ @@ -42,7 +42,7 @@ public boolean startJob(String arguments, Object condition, boolean hiredByName) } public boolean isPrerelease(){ - return true; + return false; } public boolean isSubstantive(){ return true; @@ -73,13 +73,6 @@ public boolean canImport() { /*.................................................................................................................*/ public void readFile(MesquiteProject mf, MesquiteFile file, String arguments) { } - /*.................................................................................................................*/ - /** returns the version number at which this module was first released. If 0, then no version number is claimed. If a POSITIVE integer - * then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite. - * If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/ - public int getVersionOfFirstRelease(){ - return NEXTRELEASE; - } /* ============================ exporting ============================*/ @@ -333,8 +326,14 @@ public String getExplanation() { String s = "Exports NEXUS file with a taxa and tree block for OpenTree based upon a source of trees. "; return s; } - /*.................................................................................................................*/ + /*.................................................................................................................*/ + /** returns the version number at which this module was first released. If 0, then no version number is claimed. If a POSITIVE integer + * then the number refers to the Mesquite version. This should be used only by modules part of the core release of Mesquite. + * If a NEGATIVE integer, then the number refers to the local version of the package, e.g. a third party package*/ + public int getVersionOfFirstRelease(){ + return 360; + } } diff --git a/Source/mesquite/pairwise/PairsNoChars/PairsNoChars.java b/Source/mesquite/pairwise/PairsNoChars/PairsNoChars.java index 618260b95..e19c67f11 100644 --- a/Source/mesquite/pairwise/PairsNoChars/PairsNoChars.java +++ b/Source/mesquite/pairwise/PairsNoChars/PairsNoChars.java @@ -354,6 +354,7 @@ private void goUpWithPath(Tree tree, int left, int right, TaxaPath pathLeft, Tax /*.................................................................................................................*/ /* Go up tree, choosing pairing in clade by taking first choices wherever a choice is available*/ private void firstPairingInClade(int node, Tree tree) { + try { currentChoice[node]=0; numChoices[node]= 1; @@ -397,6 +398,12 @@ private void firstPairingInClade(int node, Tree tree) { } } } + } + catch (StackOverflowError t){ + MesquiteMessage.notifyUser("Could you please send your data file to info@mesquiteproject.org to help us diagnose an error that has just happened in Pairwise Comparison (PairsNoChar)? We haven't been able to reproduce this error, and yet users keep encountering it." + + " If you can send us the file, we may be able to solve the problem. Thanks! (More dialog boxes may follow)."); + throw t; + } } /*.................................................................................................................*/ diff --git a/Source/mesquite/pairwise/PairsOneChar/PairsOneChar.java b/Source/mesquite/pairwise/PairsOneChar/PairsOneChar.java index 8db3969b8..3e0eba4aa 100644 --- a/Source/mesquite/pairwise/PairsOneChar/PairsOneChar.java +++ b/Source/mesquite/pairwise/PairsOneChar/PairsOneChar.java @@ -308,6 +308,7 @@ private void legalityCheck(Tree tree) { /* This traversal from tips to roots, does parsimony "downpass" and also accumulates allStates for each clade. allStates records, for each clade, whether 0 or 1 or both are observed among the terminal taxa of the clade*/ private void downPass(int node, Tree tree) { + try { if (tree.nodeIsTerminal(node)) { long observed = ((CategoricalDistribution)observedStates).getState(tree.taxonNumberOfNode(node)); // get observed state for taxon @@ -341,6 +342,13 @@ else if (CategoricalState.isUnassigned(sLeft)) { allStatesInClade.setState(node, allStatesInClade.getState(left) | allStatesInClade.getState(right)); // take union for states in clade } } + } + catch (StackOverflowError t){ + MesquiteMessage.notifyUser("Could you please send your data file to info@mesquiteproject.org to help us diagnose an error that has just happened in Pairwise Comparison (PairsOneChar)? We haven't been able to reproduce this error, and yet users keep encountering it." + + " If you can send us the file, we may be able to solve the problem. Thanks! (More dialog boxes may follow)."); + throw t; + } + } /*.................................................................................................................*/ /* The following six methods do the second traversal upward through the tree, choosing pairs by diff --git a/Source/mesquite/search/lib/TreeSearch.java b/Source/mesquite/search/lib/TreeSearch.java index 02aa18534..3caaa6890 100644 --- a/Source/mesquite/search/lib/TreeSearch.java +++ b/Source/mesquite/search/lib/TreeSearch.java @@ -62,7 +62,7 @@ public boolean startJob(String arguments, Object condition, boolean hiredByName) if (arguments !=null) { searchTask = (TreeSearcher)hireNamedEmployee(TreeSearcher.class,arguments); if (searchTask==null) { - return sorry(getName() + " couldn't start because the requested tree searching module not obtained"); + return sorry(getName() + " couldn't start because the requested tree searching module not obtained: "+arguments); } } else { @@ -98,9 +98,9 @@ public Reconnectable getReconnectable(){ return null; } - public String getExtraTreeWindowCommands (boolean finalTree){ + public String getExtraTreeWindowCommands (boolean finalTree, long treeBlockID){ if (searchTask!=null) - return searchTask.getExtraTreeWindowCommands(finalTree); + return searchTask.getExtraTreeWindowCommands(finalTree, treeBlockID); else return ""; } diff --git a/Source/mesquite/trees/AlterTrees/AlterTrees.java b/Source/mesquite/trees/AlterTrees/AlterTrees.java index 4448e6c6d..c2e49dc3b 100644 --- a/Source/mesquite/trees/AlterTrees/AlterTrees.java +++ b/Source/mesquite/trees/AlterTrees/AlterTrees.java @@ -87,7 +87,7 @@ else if (numTrees>500) CommandRecord.tick("Altering tree " + j + " of " + numTrees); if (j % dotFreq == 0) log("."); - boolean success = alterTask.transformTree((MesquiteTree)tree, null, false); + boolean success = alterTask.transformTree((MesquiteTree)tree, null, true); //WAYNECHECK: why was notify set to false here? This caused a lack of updating in the tree list window. } } } diff --git a/Source/mesquite/trees/BasicDrawTaxonNames/BasicDrawTaxonNames.java b/Source/mesquite/trees/BasicDrawTaxonNames/BasicDrawTaxonNames.java index 460eb07be..27e54672c 100644 --- a/Source/mesquite/trees/BasicDrawTaxonNames/BasicDrawTaxonNames.java +++ b/Source/mesquite/trees/BasicDrawTaxonNames/BasicDrawTaxonNames.java @@ -44,6 +44,10 @@ public String getExplanation() { protected Graphics gL; protected int separation = 10; protected Font currentFont = null; + protected Font currentFontBOLD = null; + protected Font currentFontBIG = null; + protected Font currentFontBIGBOLD = null; + protected int bigFontChoice = TreeDisplay.sTHM_BIGNAME; protected String myFont = null; protected int myFontSize = -1; protected FontMetrics fm; @@ -51,7 +55,7 @@ public String getExplanation() { protected int descent; protected int oldNumTaxa=0; protected MesquiteString fontSizeName, fontName; - protected MesquiteBoolean colorPartition, colorAssigned, shadePartition, showFootnotes; + protected MesquiteBoolean shadePartition, showFootnotes; /*New code added Feb.15.07 centerNodeLabels oliver*/ //TODO: delete new code comments protected MesquiteBoolean showNodeLabels, showTaxonNames, centerNodeLabels; /*deleted centerNodeLables declaration Feb.26.07 oliver*/ /*end new code added Feb.15.07 oliver*/ @@ -59,6 +63,7 @@ public String getExplanation() { protected Color fontColor=Color.black; protected Color fontColorLight = Color.gray; protected NumberForTaxon shader = null; + protected TaxonNameStyler colorerTask = null; protected int longestString = 0; protected MesquiteMenuItemSpec offShadeMI = null; /* New code added Feb.26.07 oliver*/ //TODO: delete new code comments @@ -67,17 +72,23 @@ public String getExplanation() { protected double[] shades = null; protected double minValue, maxValue; double namesAngle = MesquiteDouble.unassigned; + MesquiteCommand tNC; + MesquiteString colorerName = null; + /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName) { currentFont = MesquiteWindow.defaultFont; + currentFontBOLD = new Font(currentFont.getName(), Font.BOLD, currentFont.getSize()); + currentFontBIG = new Font(currentFont.getName(), Font.PLAIN, (int)(currentFont.getSize()*highlightMultiplier())); + currentFontBIGBOLD = new Font(currentFont.getName(), Font.BOLD, (int)(currentFont.getSize()*highlightMultiplier())); fontName = new MesquiteString(MesquiteWindow.defaultFont.getName()); fontSizeName = new MesquiteString(Integer.toString(MesquiteWindow.defaultFont.getSize())); MesquiteSubmenuSpec namesMenu = addSubmenu(null, "Names"); addItemToSubmenu(null, namesMenu, "Taxon Name Angle...", makeCommand("namesAngle", this)); - + MesquiteSubmenuSpec msf = FontUtil.getFontSubmenuSpec(this,this); msf.setSelected(fontName); - + MesquiteSubmenuSpec mss = addSubmenu(null, "Font Size", makeCommand("setFontSize", this), MesquiteSubmenu.getFontSizeList()); mss.setList(MesquiteSubmenu.getFontSizeList()); mss.setDocumentItems(false); @@ -86,12 +97,15 @@ public boolean startJob(String arguments, Object condition, boolean hiredByName) MesquiteSubmenuSpec mmis = addSubmenu(null, "Default Font Color", makeCommand("setColor", this)); mmis.setList(ColorDistribution.standardColorNames); mmis.setSelected(fontColorName); + colorerTask = (TaxonNameStyler)hireNamedEmployee(TaxonNameStyler.class, "#NoColorForTaxon"); + tNC = makeCommand("setTaxonNameStyler", this); + colorerTask.setHiringCommand(tNC); + + MesquiteSubmenuSpec mmTNC = addSubmenu(null, "Color And Style Of Taxon Names", tNC); + mmTNC.setList(TaxonNameStyler.class); + colorerName = new MesquiteString(colorerTask.getName()); + mmTNC.setSelected(colorerName); - //MesquiteSubmenuSpec mssNames = addSubmenu(null, "Names"); - colorPartition = new MesquiteBoolean(false); - colorAssigned = new MesquiteBoolean(true); - addCheckMenuItemToSubmenu(null, namesMenu, "Color by Taxon Group", makeCommand("toggleColorPartition", this), colorPartition); - addCheckMenuItemToSubmenu(null, namesMenu, "Color by Assigned Color", makeCommand("toggleColorAssigned", this), colorAssigned); addItemToSubmenu(null, namesMenu, "Shade by Value...", makeCommand("shadeByNumber", this)); offShadeMI = addItemToSubmenu(null, namesMenu, "Turn off Shading", makeCommand("offShading", this)); offShadeMI.setEnabled(false); @@ -121,6 +135,10 @@ public void endJob(){ super.endJob(); } /*.................................................................................................................*/ + double highlightMultiplier(){ + return (bigFontChoice+3)/4.0; + } + /*.................................................................................................................*/ /** A method called immediately after the file has been read in or completely set up (if a new file).*/ public void fileReadIn(MesquiteFile f) { if (treeDisplay != null) @@ -139,8 +157,7 @@ public Snapshot getSnapshot(MesquiteFile file) { if (myFontSize>0) temp.addLine("setFontSize " + myFontSize); //TODO: this causes problem since charts come before tree window temp.addLine("setColor " + ParseUtil.tokenize(fontColorName.toString())); //TODO: this causes problem since charts come before tree window - temp.addLine("toggleColorPartition " + colorPartition.toOffOnString()); - temp.addLine("toggleColorAssigned " + colorAssigned.toOffOnString()); + temp.addLine("setTaxonNameStyler " , colorerTask); if (shader != null) temp.addLine("shadeByNumber ", shader); temp.addLine("toggleShadePartition " + shadePartition.toOffOnString()); @@ -199,23 +216,54 @@ else if (checker.compare(this.getClass(), "Turns of shading by number", null, co MesquiteTrunk.resetMenuItemEnabling(); parametersChanged(); } - else if (checker.compare(this.getClass(), "Toggles whether taxon names are colored according to their group in the current taxa partition", "[on or off]", commandName, "toggleColorPartition")) { - boolean current = colorPartition.getValue(); + else if (checker.compare(this.getClass(), "Toggles whether to show taxon names colored by partition", "[on or off]", commandName, "toggleColorPartition")) { //for backwards compatibility + String s = parser.getFirstToken(arguments); + if (s != null){ + String replacement = null; + if (s.equalsIgnoreCase("on")){ + replacement = "#ColorTaxonByPartition"; - colorPartition.toggleValue(parser.getFirstToken(arguments)); - if (colorAssigned.getValue() && colorPartition.getValue()) - colorAssigned.setValue(false); - if (current!=colorPartition.getValue()) - parametersChanged(); + TaxonNameStyler temp = (TaxonNameStyler)replaceEmployee(TaxonNameStyler.class, replacement, "How to color taxon names?", colorerTask); + if (temp!=null) { + colorerTask = temp; + colorerName.setValue(colorerTask.getName()); + if (tree != null) + colorerTask.initialize(tree.getTaxa()); + parametersChanged(); + return colorerTask; + } + } + } } - else if (checker.compare(this.getClass(), "Toggles whether taxon names are colored according to their current assigned color", "[on or off]", commandName, "toggleColorAssigned")) { - boolean current = colorAssigned.getValue(); + else if (checker.compare(this.getClass(), "Toggles whether to show taxon names colored by assigned", "[on or off]", commandName, "toggleColorAssigned")) { //for backwards compatibility + String s = parser.getFirstToken(arguments); + if (s != null){ + String replacement = null; + if (s.equalsIgnoreCase("on")){ + replacement = "#ColorTaxonByAssigned"; - colorAssigned.toggleValue(parser.getFirstToken(arguments)); - if (colorAssigned.getValue() && colorPartition.getValue()) - colorPartition.setValue(false); - if (current!=colorAssigned.getValue()) + TaxonNameStyler temp = (TaxonNameStyler)replaceEmployee(TaxonNameStyler.class, replacement, "How to color taxon names?", colorerTask); + if (temp!=null) { + colorerTask = temp; + colorerName.setValue(colorerTask.getName()); + if (tree != null) + colorerTask.initialize(tree.getTaxa()); + parametersChanged(); + return colorerTask; + } + } + } + } + else if (checker.compare(this.getClass(), "Sets the module to be used to choose taxon name colors and styles", "[name of taxon color-style module]", commandName, "setTaxonNameStyler")) { + TaxonNameStyler temp = (TaxonNameStyler)replaceEmployee(TaxonNameStyler.class, arguments, "How to color taxon names?", colorerTask); + if (temp!=null) { + colorerTask = temp; + colorerName.setValue(colorerTask.getName()); + if (tree != null) + colorerTask.initialize(tree.getTaxa()); parametersChanged(); + return colorerTask; + } } else if (checker.compare(this.getClass(), "Toggles whether taxon names are given a background color according to their group in the current taxa partition", "[on or off]", commandName, "toggleShadePartition")) { boolean current = shadePartition.getValue(); @@ -273,6 +321,9 @@ else if (checker.compare(this.getClass(), "Sets the font used for the taxon name myFont = t; fontName.setValue(t); currentFont = fontToSet; + currentFontBOLD = new Font(currentFont.getName(), Font.BOLD, currentFont.getSize()); + currentFontBIG = new Font(currentFont.getName(), Font.PLAIN, (int)(currentFont.getSize()*highlightMultiplier())); + currentFontBIGBOLD = new Font(currentFont.getName(), Font.BOLD, (int)(currentFont.getSize()*highlightMultiplier())); parametersChanged(); } } @@ -291,6 +342,10 @@ else if (checker.compare(this.getClass(), "Sets the font used for the taxon name myFont = t; fontName.setValue(t); currentFont = fontToSet; + currentFontBOLD = new Font(currentFont.getName(), Font.BOLD, currentFont.getSize()); + currentFontBIG = new Font(currentFont.getName(), Font.PLAIN, (int)(currentFont.getSize()*highlightMultiplier())); + currentFontBIGBOLD = new Font(currentFont.getName(), Font.BOLD, (int)(currentFont.getSize()*highlightMultiplier())); + parametersChanged(); } } @@ -314,6 +369,9 @@ else if (checker.compare(this.getClass(), "Sets the font size used for the taxon Font fontToSet = new Font (currentFont.getName(), currentFont.getStyle(), fontSize); if (fontToSet!= null) { currentFont = fontToSet; + currentFontBOLD = new Font(currentFont.getName(), Font.BOLD, currentFont.getSize()); + currentFontBIG = new Font(currentFont.getName(), Font.PLAIN, (int)(currentFont.getSize()*highlightMultiplier())); + currentFontBIGBOLD = new Font(currentFont.getName(), Font.BOLD, (int)(currentFont.getSize()*highlightMultiplier())); fontSizeName.setValue(Integer.toString(fontSize)); parametersChanged(new Notification(TreeDisplay.FONTSIZECHANGED)); } @@ -351,15 +409,25 @@ public void setTree(Tree tree) { if (shader != null ){ calcShades(tree); } + if (colorerTask !=null && tree != null) + colorerTask.initialize(tree.getTaxa()); + } + public String getObjectComment(Object obj){ + if (colorerTask !=null && obj != null) + return colorerTask.getObjectComment(obj); + return null; } /*.................................................................................................................*/ public void employeeParametersChanged(MesquiteModule employee, MesquiteModule source, Notification notification) { - calcShades(tree); + if (shader != null) + calcShades(tree); + if (colorerTask !=null && tree != null) + colorerTask.prepareToStyle(tree.getTaxa()); parametersChanged(notification); } private void calcShades(Tree tree){ - if (tree == null) + if (tree == null || shader == null) return; minValue = MesquiteDouble.unassigned; maxValue = MesquiteDouble.unassigned; @@ -454,6 +522,7 @@ else if (taxonNumber>=taxa.getNumTaxa()) { MesquiteMessage.warnProgrammer("error: taxon null"); return; } + //@@@@ preparing for the specifics of the taxon name @@@@@@ boolean selected = taxa.getSelected(taxonNumber); //check all extras to see if they want to add anything boolean underlined = false; @@ -463,22 +532,39 @@ else if (taxonNumber>=taxa.getNumTaxa()) { else taxonColor = fontColorLight; - if (partitions!=null && (colorPartition.getValue() || shadePartition.getValue())){ + Color tempColor = colorerTask.getTaxonNameColor(taxa, taxonNumber); + if (tempColor != null){ + taxonColor = tempColor; + } + boolean useBold = colorerTask.getTaxonNameBoldness(taxa, taxonNumber); + Font previousFont = gL.getFont(); + if (treeDisplay.selectedTaxonHighlightMode > TreeDisplay.sTHM_GREYBOX){ + if (bigFontChoice!= treeDisplay.selectedTaxonHighlightMode){ //there's been a shift + bigFontChoice = treeDisplay.selectedTaxonHighlightMode; + currentFontBIG = new Font(currentFont.getName(), Font.PLAIN, (int)(currentFont.getSize()*highlightMultiplier())); + currentFontBIGBOLD = new Font(currentFont.getName(), Font.BOLD, (int)(currentFont.getSize()*highlightMultiplier())); + } + } + if (useBold){ + if (selected && treeDisplay.selectedTaxonHighlightMode >TreeDisplay.sTHM_GREYBOX) + gL.setFont(currentFontBIGBOLD); + else + gL.setFont(currentFontBOLD); + } + else if (selected && treeDisplay.selectedTaxonHighlightMode > TreeDisplay.sTHM_GREYBOX){ + gL.setFont(currentFontBIG); + } + else + gL.setFont(currentFont); + if (partitions!=null && shadePartition.getValue()){ TaxaGroup mi = (TaxaGroup)partitions.getProperty(taxonNumber); if (mi!=null) { - if (colorPartition.getValue() && mi.getColor() != null) - taxonColor = mi.getColor(); if (shadePartition.getValue()){ bgColor =mi.getColor(); textRotator.assignBackground(bgColor); } } } - if (colorAssigned.getValue()){ - long c = taxa.getAssociatedLong(colorNameRef, taxonNumber); - if (MesquiteLong.isCombinable(c)) - taxonColor= ColorDistribution.getStandardColor((int)c); - } if (showFootnotes.getValue()){ ListableVector extras = treeDisplay.getExtras(); if (extras!=null){ @@ -514,7 +600,7 @@ else if (taxonNumber>=taxa.getNumTaxa()) { if (treeDrawing.namesFollowLines ){ double slope = (treeDrawing.lineBaseY[N]*1.0-treeDrawing.lineTipY[N])*1.0/(treeDrawing.lineBaseX[N]*1.0-treeDrawing.lineTipX[N]); double radians = Math.atan(slope); - + boolean right = treeDrawing.lineTipX[N]>treeDrawing.lineBaseX[N]; Font font = gL.getFont(); FontMetrics fontMet = gL.getFontMetrics(font); @@ -574,7 +660,7 @@ else if ((treeDrawing.labelOrientation[N]==90) || treeDisplay.getOrientation()== if (!nameExposedOnTree(tree, taxonNumber, triangleBase)) setBounds(namePolys[taxonNumber], 0, 0, 0, 0); else - setBounds(namePolys[taxonNumber], (int)horiz-rise/2, (int)vert+separation, rise+descent, lengthString); //integer nodeloc approximation + setBounds(namePolys[taxonNumber], (int)horiz-rise/2, (int)vert+separation, rise+descent, lengthString); //integer nodeloc approximation if (nameIsVisible(treeDisplay, taxonNumber)) textRotator.drawRotatedText(s, taxonNumber, gL, treeDisplay, (int)horiz-rise/2, (int)vert+separation, false); //integer nodeloc approximation if (underlined){ @@ -594,7 +680,7 @@ else if ((treeDrawing.labelOrientation[N]==0) || treeDisplay.getOrientation()==T if (!nameExposedOnTree(tree, taxonNumber, triangleBase)) setBounds(namePolys[taxonNumber], 0, 0, 0, 0); else - setBounds(namePolys[taxonNumber], (int)horiz+separation, (int)vert-rise/2, lengthString, rise+descent); //integer nodeloc approximation + setBounds(namePolys[taxonNumber], (int)horiz+separation, (int)vert-rise/2, lengthString, rise+descent); //integer nodeloc approximation if (nameIsVisible(treeDisplay, taxonNumber)){ if (bgColor!=null) { @@ -621,7 +707,7 @@ else if ((treeDrawing.labelOrientation[N]==180) || treeDisplay.getOrientation()= if (!nameExposedOnTree(tree, taxonNumber, triangleBase)) setBounds(namePolys[taxonNumber], 0, 0, 0, 0); else - setBounds(namePolys[taxonNumber], (int)horiz - separation - lengthString, (int)vert-rise/2, lengthString, rise+descent); //integer nodeloc approximation + setBounds(namePolys[taxonNumber], (int)horiz - separation - lengthString, (int)vert-rise/2, lengthString, rise+descent); //integer nodeloc approximation if (nameIsVisible(treeDisplay, taxonNumber)){ if (bgColor!=null) { gL.setColor(bgColor); @@ -641,7 +727,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.FREEFORM) { if (!nameExposedOnTree(tree, taxonNumber, triangleBase)) setBounds(namePolys[taxonNumber], 0, 0, 0, 0); else - setBounds(namePolys[taxonNumber], (int)horiz+separation, (int)vert-rise/2, lengthString, rise+descent); //integer nodeloc approximation + setBounds(namePolys[taxonNumber], (int)horiz+separation, (int)vert-rise/2, lengthString, rise+descent); //integer nodeloc approximation if (nameIsVisible(treeDisplay, taxonNumber)){ if (bgColor!=null) { gL.setColor(bgColor); @@ -663,7 +749,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.FREEFORM) { if (!nameExposedOnTree(tree, taxonNumber, triangleBase)) setBounds(namePolys[taxonNumber], 0, 0, 0, 0); else - setBounds(namePolys[taxonNumber], (int)horiz+separation, (int)vert, lengthString, rise+descent); //integer nodeloc approximation + setBounds(namePolys[taxonNumber], (int)horiz+separation, (int)vert, lengthString, rise+descent); //integer nodeloc approximation if (nameIsVisible(treeDisplay, taxonNumber)){ if (bgColor!=null) { gL.setColor(bgColor); @@ -682,7 +768,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.FREEFORM) { if (!nameExposedOnTree(tree, taxonNumber, triangleBase)) setBounds(namePolys[taxonNumber], 0, 0, 0, 0); else - setBounds(namePolys[taxonNumber], (int)horiz - separation - lengthString, (int)vert, lengthString, rise+descent); //integer nodeloc approximation + setBounds(namePolys[taxonNumber], (int)horiz - separation - lengthString, (int)vert, lengthString, rise+descent); //integer nodeloc approximation if (nameIsVisible(treeDisplay, taxonNumber)){ if (bgColor!=null) { gL.setColor(bgColor); @@ -703,7 +789,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.FREEFORM) { if (!nameExposedOnTree(tree, taxonNumber, triangleBase)) setBounds(namePolys[taxonNumber], 0, 0, 0, 0); else - setBounds(namePolys[taxonNumber], (int)horiz, (int)vert+separation, rise+descent, lengthString); //integer nodeloc approximation + setBounds(namePolys[taxonNumber], (int)horiz, (int)vert+separation, rise+descent, lengthString); //integer nodeloc approximation if (nameIsVisible(treeDisplay, taxonNumber)){ textRotator.drawRotatedText(s, taxonNumber, gL, treeDisplay, (int)horiz, (int)vert+separation, false); //integer nodeloc approximation if (underlined){ @@ -717,7 +803,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.FREEFORM) { if (!nameExposedOnTree(tree, taxonNumber, triangleBase)) setBounds(namePolys[taxonNumber], 0, 0, 0, 0); else - setBounds(namePolys[taxonNumber], (int)horiz, (int)vert-separation-lengthString, rise+descent, lengthString); //integer nodeloc approximation + setBounds(namePolys[taxonNumber], (int)horiz, (int)vert-separation-lengthString, rise+descent, lengthString); //integer nodeloc approximation if (nameIsVisible(treeDisplay, taxonNumber)){ textRotator.drawRotatedText(s, taxonNumber, gL, treeDisplay, (int)horiz, (int)vert-separation); //integer nodeloc approximation if (underlined){ @@ -732,14 +818,12 @@ else if (treeDisplay.getOrientation()==TreeDisplay.FREEFORM) { textRotator.assignBackground(null); gL.setColor(Color.black); ColorDistribution.setComposite(gL,composite); - if (selected && !namePolys[taxonNumber].isHidden()){ //&& GraphicsUtil.useXORMode(gL, false) - //gL.setXORMode(Color.white); - //gL.fillPolygon(namePolys[taxonNumber]); + if (selected && !namePolys[taxonNumber].isHidden() && treeDisplay.selectedTaxonHighlightMode == TreeDisplay.sTHM_GREYBOX){ //&& GraphicsUtil.useXORMode(gL, false) GraphicsUtil.fillTransparentBorderedSelectionPolygon(gL, namePolys[taxonNumber]); - - // gL.setPaintMode(); } + if (useBold) + gL.setFont(previousFont); } else { for (int d = tree.firstDaughterOfNode(N); tree.nodeExists(d); d = tree.nextSisterOfNode(d)) @@ -911,6 +995,7 @@ else if (oldNumTaxa0) if (w != null){ w.windowResized(); //this is a hack to force them to update sizes return; + } } - } - + if (treeDisplay != null) { ((BasicTreeDisplay)treeDisplay).pleaseUpdate(true); } @@ -868,22 +915,22 @@ void printComponentsPDF(Graphics g){ private void drawSpot(TreeDisplay treeDisplay, Tree tree, Graphics g, int N) { if (tree.nodeExists(N)) { if (treeDisplay.getVisRect() == null || treeDisplay.getVisRect().contains(treeDisplay.getTreeDrawing().x[N], treeDisplay.getTreeDrawing().y[N])){ - if (tree.nodeIsInternal(N) || true){ //replace true by show terminal - //int i=0; - //int j=2; - String s = Integer.toString(N); - FontMetrics fm = g.getFontMetrics(g.getFont()); - int width = fm.stringWidth(s) + 6; - int height = fm.getAscent()+fm.getDescent() + 6; - if (spotsize>width) - width = spotsize; - if (spotsize>height) - height = spotsize; - g.setColor(Color.white); - double x = treeDisplay.getTreeDrawing().x[N] - width/2; - double y = treeDisplay.getTreeDrawing().y[N] - height/2; - GraphicsUtil.fillOval(g,x , y, width, height); - /* g.setColor(Color.red); + if (tree.nodeIsInternal(N) || true){ //replace true by show terminal + //int i=0; + //int j=2; + String s = Integer.toString(N); + FontMetrics fm = g.getFontMetrics(g.getFont()); + int width = fm.stringWidth(s) + 6; + int height = fm.getAscent()+fm.getDescent() + 6; + if (spotsize>width) + width = spotsize; + if (spotsize>height) + height = spotsize; + g.setColor(Color.white); + double x = treeDisplay.getTreeDrawing().x[N] - width/2; + double y = treeDisplay.getTreeDrawing().y[N] - height/2; + GraphicsUtil.fillOval(g,x , y, width, height); + /* g.setColor(Color.red); Graphics2D g2 = (Graphics2D)g; GraphicsConfiguration gc; java.awt.geom.AffineTransform at, at0, nt; @@ -899,24 +946,24 @@ private void drawSpot(TreeDisplay treeDisplay, Tree tree, Graphics g, int N) { at = gc.getDefaultTransform(); nt = gc.getNormalizingTransform(); ss += " " + at0.getTranslateX() + " " + at.getTranslateX() + " " + nt.getTranslateX() + "/ "; - */ - g.setColor(Color.black); - GraphicsUtil.drawString(g,Integer.toString(N), x+2, y-4+ height); - /*g.drawRect(x , y, width, height); + */ + g.setColor(Color.black); + GraphicsUtil.drawString(g,Integer.toString(N), x+2, y-4+ height); + /*g.drawRect(x , y, width, height); gc = g2.getDeviceConfiguration(); at0 = g2.getTransform(); at = gc.getDefaultTransform(); nt = gc.getNormalizingTransform(); ss += " " + at0.getTranslateX() + " " + at.getTranslateX() + " " + nt.getTranslateX() + "/ "; - */ - GraphicsUtil.drawOval(g,x , y, width, height); - /*gc = g2.getDeviceConfiguration(); + */ + GraphicsUtil.drawOval(g,x , y, width, height); + /*gc = g2.getDeviceConfiguration(); at0 = g2.getTransform(); at = gc.getDefaultTransform(); nt = gc.getNormalizingTransform(); ss += " " + at0.getTranslateX() + " " + at.getTranslateX() + " " + nt.getTranslateX() + "/ "; - */ - } + */ + } } for (int d = tree.firstDaughterOfNode(N); tree.nodeExists(d); d = tree.nextSisterOfNode(d)) drawSpot(treeDisplay, tree, g, d); @@ -1000,8 +1047,8 @@ public void fillTaxon(Graphics g, int M) { } /*_________________________________________________*/ public void redrawTaxa(Graphics g, int M) { - ((DrawTreeCoordinator)ownerModule).getNamesTask().drawNames(this, tree, getTreeDrawing().getDrawnRoot(), g); - + ((DrawTreeCoordinator)ownerModule).getNamesTask().drawNames(this, tree, getTreeDrawing().getDrawnRoot(), g); + } /*_________________________________________________*/ private boolean responseOK(){ diff --git a/Source/mesquite/trees/BasicTreeWindowMaker/BasicTreeWindowMaker.java b/Source/mesquite/trees/BasicTreeWindowMaker/BasicTreeWindowMaker.java index 8f66f17ae..3143e988d 100644 --- a/Source/mesquite/trees/BasicTreeWindowMaker/BasicTreeWindowMaker.java +++ b/Source/mesquite/trees/BasicTreeWindowMaker/BasicTreeWindowMaker.java @@ -221,7 +221,7 @@ void disconnectFromTreeBlock(boolean fireCurrentTask) { if (basicTreeWindow == null) return; handlingQuitTreeSource = true; - + String d = basicTreeWindow.getTreeDescription(); String n = "Tree recovered from: " + basicTreeWindow.getTreeNameAndDetails(); if (fireCurrentTask) @@ -858,7 +858,7 @@ class BasicTreeWindow extends MesquiteWindow implements Fittable, MesquiteListen // MesquiteScrollbar hScroll, vScroll; TreeScrollPane treePane; Adjustable hScroll, vScroll; - + int scanLineThickness = 3; boolean usingPane = false; TreeSource treeSourceTask; @@ -3375,6 +3375,14 @@ public void unfit(Object o) { sizeDisplay(); } + /* _________________________________________________ */ + private String getTaxonExplanation(Taxa taxa, int it){ + String comment = windowModule.getObjectComment(taxa.getTaxon(it)); + if (StringUtil.blank(comment)) + return " Taxon: " + taxa.getTaxonName(it); + else + return " Taxon: " + taxa.getTaxonName(it) + "\n" + comment; + } /* _________________________________________________ */ public void InvertTaxon(Graphics g, int M) { @@ -3411,7 +3419,7 @@ public void InvertTaxon(Graphics g, int M) { if (t.getTaxa().getAnnotation(M) != null) setAnnotation(t.getTaxa().getAnnotation(M), "Footnote above refers to taxon \"" + t.getTaxa().getTaxonName(M) + "\""); else { - setExplanation("Taxon: " + t.getTaxa().getTaxonName(M)); + setExplanation(getTaxonExplanation(t.getTaxa(),M)); //TaxonExplanation setAnnotation("", null); } treeAnnotationShown = false; // so that the base Explanation can know whether to refer to the annotation @@ -3527,7 +3535,7 @@ private void showBranchExplanation(int node) { if (tree.nodeIsTerminal(node)) { Taxon t = tree.getTaxa().getTaxon(tree.taxonNumberOfNode(node)); if (t != null) - setExplanation("Taxon: " + t.getName() + s); + setExplanation(getTaxonExplanation(tree.getTaxa(), tree.taxonNumberOfNode(node)) + "\n" + s);//TaxonExplanation else setExplanation("Unknown taxon (the tree description may have been malformed or with undefined taxa)" + s); } @@ -3620,7 +3628,7 @@ else if (branchFound != 0) { // we weren't in a branch, but now we found one if (tree.nodeIsTerminal(branchFound)) { Taxon t = tree.getTaxa().getTaxon(tree.taxonNumberOfNode(branchFound)); if (t != null) - setExplanation("Taxon: " + t.getName()); + setExplanation(getTaxonExplanation(tree.getTaxa(), tree.taxonNumberOfNode(branchFound)));//TaxonExplanation else setExplanation("Unknown taxon (the tree description may have been malformed or with undefined taxa)"); } @@ -3640,27 +3648,27 @@ else if (branchFound != 0) { // we weren't in a branch, but now we found one } } else { - int nameFound = findTaxon(x, y); + int taxonFound = findTaxon(x, y); if (highlightedTaxon >= 0) { - if (nameFound == -1) { + if (taxonFound == -1) { int wasHighlighted = highlightedTaxon; RevertTaxon(g, highlightedTaxon); notifyExtrasOfTaxonExit(g, wasHighlighted); setExplanation(baseExplanation, false); } - else if (nameFound != highlightedTaxon) { + else if (taxonFound != highlightedTaxon) { int wasHighlighted = highlightedTaxon; RevertTaxon(g, highlightedTaxon); - InvertTaxon(g, nameFound); + InvertTaxon(g, taxonFound); notifyExtrasOfTaxonExit(g, wasHighlighted); - notifyExtrasOfTaxonEnter(g, nameFound); - setExplanation(" Taxon: " + taxa.getTaxonName(nameFound)); + notifyExtrasOfTaxonEnter(g, taxonFound); + setExplanation(getTaxonExplanation(taxa, taxonFound)); //TaxonExplanation } } - else if (nameFound != -1) { - InvertTaxon(g, nameFound); - notifyExtrasOfTaxonEnter(g, nameFound); - setExplanation(" Taxon: " + taxa.getTaxonName(nameFound)); + else if (taxonFound != -1) { + InvertTaxon(g, taxonFound); + notifyExtrasOfTaxonEnter(g, taxonFound); + setExplanation(getTaxonExplanation(taxa, taxonFound)); //TaxonExplanation } else { currentTreeTool.moved(x, y, tree, modifiers); @@ -4464,7 +4472,7 @@ else if (usingDefaultTree) } } messagePanel.setMessage(treename); - + if (treeInfoPanel != null) treeInfoPanel.setTreeAndSourceName(treename, treeSourceTask.getName()); @@ -4965,38 +4973,38 @@ public void mouseWheelMoved(MouseWheelEvent e) { public void keyTyped(KeyEvent e) { // TODO Auto-generated method stub - + } public void keyPressed(KeyEvent e) { - int keyCode = e.getKeyCode(); - int amount = 0; - int scale = 1; - if (e.isAltDown()) - scale=5; - - switch( keyCode ) { - case KeyEvent.VK_UP: - amount = vScroll.getBlockIncrement(); - vScroll.setValue(vScroll.getValue() - amount*scale); - window.sizeDisplay(); - break; - case KeyEvent.VK_DOWN: - amount = vScroll.getBlockIncrement(); - vScroll.setValue(vScroll.getValue() + amount*scale); - window.sizeDisplay(); - break; - case KeyEvent.VK_LEFT: - amount = hScroll.getBlockIncrement(); - hScroll.setValue(hScroll.getValue() - amount*scale); - window.sizeDisplay(); - break; - case KeyEvent.VK_RIGHT : - amount = hScroll.getBlockIncrement(); - hScroll.setValue(hScroll.getValue() + amount*scale); - window.sizeDisplay(); - break; - } + int keyCode = e.getKeyCode(); + int amount = 0; + int scale = 1; + if (e.isAltDown()) + scale=5; + + switch( keyCode ) { + case KeyEvent.VK_UP: + amount = vScroll.getBlockIncrement(); + vScroll.setValue(vScroll.getValue() - amount*scale); + window.sizeDisplay(); + break; + case KeyEvent.VK_DOWN: + amount = vScroll.getBlockIncrement(); + vScroll.setValue(vScroll.getValue() + amount*scale); + window.sizeDisplay(); + break; + case KeyEvent.VK_LEFT: + amount = hScroll.getBlockIncrement(); + hScroll.setValue(hScroll.getValue() - amount*scale); + window.sizeDisplay(); + break; + case KeyEvent.VK_RIGHT : + amount = hScroll.getBlockIncrement(); + hScroll.setValue(hScroll.getValue() + amount*scale); + window.sizeDisplay(); + break; + } } public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub @@ -5145,7 +5153,7 @@ void setHighlighted(boolean edited) { else ownerModule.magnifyExtra.name = null; if (ownerModule.treeSourceTask != null && !edited) { - + String s = ownerModule.treeSourceTask.getNameAndParameters(); if (!StringUtil.blank(s)) treeSourceAddendum = " [" + s + "]"; diff --git a/Source/mesquite/trees/ColorTaxonByAssigned/ColorTaxonByAssigned.java b/Source/mesquite/trees/ColorTaxonByAssigned/ColorTaxonByAssigned.java new file mode 100644 index 000000000..5e056c848 --- /dev/null +++ b/Source/mesquite/trees/ColorTaxonByAssigned/ColorTaxonByAssigned.java @@ -0,0 +1,65 @@ +/* Mesquite source code. Copyright 1997 and onward, W. Maddison and D. Maddison. + + +Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. +The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. +Perhaps with your help we can be more than a few, and make Mesquite better. + +Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. +Mesquite's web site is http://mesquiteproject.org + +This source code and its compiled class files are free and modifiable under the terms of +GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) +*/ +package mesquite.trees.ColorTaxonByAssigned; + +import java.util.*; +import java.awt.*; +import mesquite.lib.*; +import mesquite.lib.duties.*; + +/* ======================================================================== */ +public class ColorTaxonByAssigned extends TaxonNameStyler { + double resultNum; + /*.................................................................................................................*/ + public boolean startJob(String arguments, Object condition, boolean hiredByName) { + return true; + } + + /*.................................................................................................................*/ + /** returns whether this module is requesting to appear as a primary choice */ + public boolean requestPrimaryChoice(){ + return true; + } + /*.................................................................................................................*/ + public boolean isSubstantive(){ + return false; + } + /*.................................................................................................................*/ + public boolean isPrerelease(){ + return false; + } + /*.................................................................................................................*/ + public int getVersionOfFirstRelease(){ + return 360; + } + + /*.................................................................................................................*/ + NameReference colorNameRef = NameReference.getNameReference("color"); + + public Color getTaxonNameColor(Taxa taxa, int ic){ + long c = taxa.getAssociatedLong(colorNameRef, ic); + if (MesquiteLong.isCombinable(c)) + return ColorDistribution.getStandardColor((int)c); + return null; + } + /*.................................................................................................................*/ + public String getName() { + return "Color by Assigned Color"; + } + /*.................................................................................................................*/ + /** returns an explanation of what the module does.*/ + public String getExplanation() { + return "Supplies the colors assigned individually to the taxa." ; + } +} diff --git a/Source/mesquite/trees/ColorTaxonByPartition/ColorTaxonByPartition.java b/Source/mesquite/trees/ColorTaxonByPartition/ColorTaxonByPartition.java new file mode 100644 index 000000000..827843723 --- /dev/null +++ b/Source/mesquite/trees/ColorTaxonByPartition/ColorTaxonByPartition.java @@ -0,0 +1,71 @@ +/* Mesquite source code. Copyright 1997 and onward, W. Maddison and D. Maddison. + + +Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. +The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. +Perhaps with your help we can be more than a few, and make Mesquite better. + +Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. +Mesquite's web site is http://mesquiteproject.org + +This source code and its compiled class files are free and modifiable under the terms of +GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) +*/ +package mesquite.trees.ColorTaxonByPartition; + +import java.util.*; +import java.awt.*; +import mesquite.lib.*; +import mesquite.lib.duties.*; + +/* ======================================================================== */ +public class ColorTaxonByPartition extends TaxonNameStyler { + double resultNum; + /*.................................................................................................................*/ + public boolean startJob(String arguments, Object condition, boolean hiredByName) { + return true; + } + + /*.................................................................................................................*/ + /** returns whether this module is requesting to appear as a primary choice */ + public boolean requestPrimaryChoice(){ + return true; + } + /*.................................................................................................................*/ + public boolean isSubstantive(){ + return false; + } + /*.................................................................................................................*/ + public boolean isPrerelease(){ + return false; + } + /*.................................................................................................................*/ + public int getVersionOfFirstRelease(){ + return 360; + } + + /*.................................................................................................................*/ + NameReference colorNameRef = NameReference.getNameReference("color"); + + public Color getTaxonNameColor(Taxa taxa, int ic){ + TaxaPartition partitions = (TaxaPartition)taxa.getCurrentSpecsSet(TaxaPartition.class); + if (partitions == null) + return null; + TaxaGroup mi = (TaxaGroup)partitions.getProperty(ic); + if (mi!=null) { + if (mi.getColor() != null) + return mi.getColor(); + + } + return null; + } + /*.................................................................................................................*/ + public String getName() { + return "Color by Taxon Group"; + } + /*.................................................................................................................*/ + /** returns an explanation of what the module does.*/ + public String getExplanation() { + return "Supplies the colors assigned to the taxon's group (partition)." ; + } +} diff --git a/Source/mesquite/trees/ManageTrees/ManageTrees.java b/Source/mesquite/trees/ManageTrees/ManageTrees.java index 65e8fe311..18c7d9781 100644 --- a/Source/mesquite/trees/ManageTrees/ManageTrees.java +++ b/Source/mesquite/trees/ManageTrees/ManageTrees.java @@ -63,6 +63,7 @@ public class ManageTrees extends TreesManager implements ItemListener { Vector fillerThreads; // for the TreeBlockThread and TreeMonitorThreads, to be able to shut them off as needed /*.................................................................................................................*/ public boolean startJob(String arguments, Object condition, boolean hiredByName) { + checkTreesVector(); fillerThreads = new Vector(); blockListeners = new Vector(); setMenuToUse(MesquiteTrunk.treesMenu); @@ -73,6 +74,8 @@ public boolean startJob(String arguments, Object condition, boolean hiredByName) } /*.................................................................................................................*/ + //This dialog is queried from MesquiteTree when node labels are found that might be numerical + //see also "setDefaultNumericalLabelInterpetation" in doCommand, below RadioButtons interpretation, branchesOrNodes; TextField nameField; JLabel otherNameLabel, bOn; @@ -82,13 +85,13 @@ public boolean queryAboutNumericalLabelIntepretation(boolean[] interps, String c queryDialog.addLargeTextLabel("A tree being read includes numbers written as node labels (e.g., \"" + c + "\"). " + "Some programs write special information, e.g. bootstrap frequency or posterior probabilities, as node labels. " + " Please indicate how you want these numbers to be interpreted."); - + queryDialog.appendToHelpString("If you choose Bootstrap frequency, Posterior probability, or Consensus frequency, then Mesquite " + "will presume that the number is attached to a branch, as opposed to a node. " + "If you choose to treat it as text, then it will attach the number to the node, as a label. " + "If want to manually specify whether the number is attached to a branch or label, then choose Other and " + "then select among the Nodes or Branches options below it."); - + queryDialog.addLabel("Interpretation:", Label.LEFT); String[] names = new String[]{"Treat as text", "Bootstrap frequency", "Posterior probability", "Consensus frequency", "Other"}; interpretation = queryDialog.addRadioButtons(names, 0); @@ -110,7 +113,7 @@ public boolean queryAboutNumericalLabelIntepretation(boolean[] interps, String c if (ok) { int interp = interpretation.getValue(); interps[0] = interp >0; -/* NOTE: if you add a named value to this list, you MUST add it to the betweenDoubles list or other between list in MesquiteTree!!!*/ + /* NOTE: if you add a named value to this list, you MUST add it to the betweenDoubles list or other between list in MesquiteTree!!!*/ if (interp == 1) name = "bootstrapFrequency"; else if (interp == 2) @@ -126,11 +129,17 @@ else if (interp == 4){ } interps[2] = remember.getState(); n.setValue(name); - + } queryDialog.dispose(); return ok; } + void checkTreesVector(){ + if (treesVector == null && getProject() != null){ + treesVector = getProject().getTreeVectors(); + } + + } /*.................................................................................................................*/ public void itemStateChanged(ItemEvent arg0) { boolean en = interpretation.getValue()==4; @@ -148,13 +157,17 @@ public void elementsReordered(ListableVector v){ } public void addBlockListener(MesquiteListener ml){ blockListeners.addElement(ml); - for (int i= 0; i=0){ + if (treesVector!=null && treesVector.indexOf(e)>=0){ while(treesVector.indexOf(e)>=0) { treesVector.removeElement(e, true); } diff --git a/Source/mesquite/trees/NoColorForTaxon/NoColorForTaxon.java b/Source/mesquite/trees/NoColorForTaxon/NoColorForTaxon.java new file mode 100644 index 000000000..b8d326276 --- /dev/null +++ b/Source/mesquite/trees/NoColorForTaxon/NoColorForTaxon.java @@ -0,0 +1,61 @@ +/* Mesquite source code. Copyright 1997 and onward, W. Maddison and D. Maddison. + + +Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. +The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. +Perhaps with your help we can be more than a few, and make Mesquite better. + +Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. +Mesquite's web site is http://mesquiteproject.org + +This source code and its compiled class files are free and modifiable under the terms of +GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) +*/ +package mesquite.trees.NoColorForTaxon; + +import java.util.*; +import java.awt.*; +import mesquite.lib.*; +import mesquite.lib.duties.*; + +/* ======================================================================== */ +public class NoColorForTaxon extends TaxonNameStyler { + double resultNum; + /*.................................................................................................................*/ + public boolean startJob(String arguments, Object condition, boolean hiredByName) { + return true; + } + + /*.................................................................................................................*/ + /** returns whether this module is requesting to appear as a primary choice */ + public boolean requestPrimaryChoice(){ + return true; + } + /*.................................................................................................................*/ + public boolean isSubstantive(){ + return false; + } + /*.................................................................................................................*/ + public boolean isPrerelease(){ + return false; + } + /*.................................................................................................................*/ + public int getVersionOfFirstRelease(){ + return 360; + } + + /*.................................................................................................................*/ + NameReference colorNameRef = NameReference.getNameReference("color"); + public Color getTaxonNameColor(Taxa taxa, int ic){ + return null; + } + /*.................................................................................................................*/ + public String getName() { + return "No Color for Taxon"; + } + /*.................................................................................................................*/ + /** returns an explanation of what the module does.*/ + public String getExplanation() { + return "Supplies no color for the taxon." ; + } +} diff --git a/Source/mesquite/trees/NodeLocsStandard/NodeLocsStandard.java b/Source/mesquite/trees/NodeLocsStandard/NodeLocsStandard.java index 72e69a33c..0cde6cc4f 100644 --- a/Source/mesquite/trees/NodeLocsStandard/NodeLocsStandard.java +++ b/Source/mesquite/trees/NodeLocsStandard/NodeLocsStandard.java @@ -15,6 +15,8 @@ /*~~ */ import java.util.*; + + import java.awt.*; import mesquite.lib.*; @@ -752,19 +754,21 @@ private void AdjustForUnbranchedNodes(TreeDrawing treeDrawing, Tree tree, int N, } } /*....................................................................................................*/ - FontMetrics fm; - private int findMaxNameLength(Tree tree, int N) { + FontMetrics fm, fmBIG; + private int findMaxNameLength(TreeDisplay treeDisplay, Tree tree, int N) { if (tree.nodeIsTerminal(N)) { String s = tree.getTaxa().getName(tree.taxonNumberOfNode(N)); if (s==null) return 0; + else if (treeDisplay.selectedTaxonHighlightMode > TreeDisplay.sTHM_GREYBOX && tree.getTaxa().getSelected(tree.taxonNumberOfNode(N))) + return fmBIG.stringWidth(s); else return fm.stringWidth(s); } else { int max = 0; for (int d = tree.firstDaughterOfNode(N); tree.nodeExists(d); d = tree.nextSisterOfNode(d)) { - int cur = findMaxNameLength(tree, d); + int cur = findMaxNameLength(treeDisplay, tree, d); if (cur>max) max = cur; } @@ -772,18 +776,41 @@ private int findMaxNameLength(Tree tree, int N) { } } /*.................................................................................................................*/ - public int effectiveNumberOfTerminals(Tree tree, int node){ - if (tree.nodeIsTerminal(node)) - return 1; + double highlightMultiplier(TreeDisplay treeDisplay){ + return (treeDisplay.selectedTaxonHighlightMode+3)/4.0; + } + /*.................................................................................................................*/ + public double effectiveNumberOfTerminalsInClade(Tree tree, int node, TreeDisplay treeDisplay){ + if (tree.nodeIsTerminal(node)){ + if (treeDisplay.selectedTaxonHighlightMode > TreeDisplay.sTHM_GREYBOX && tree.getTaxa().getSelected(tree.taxonNumberOfNode(node))) + return highlightMultiplier(treeDisplay); + else + return 1; + } + double num=0; + for (int d = tree.firstDaughterOfNode(node); tree.nodeExists(d); d = tree.nextSisterOfNode(d)) { + num += effectiveNumberOfTerminalsInClade(tree, d, treeDisplay); + } + return num; + } + + /*.................................................................................................................*/ + public double effectiveNumberOfTerminals(Tree tree, int node, TreeDisplay treeDisplay){ + if (tree.nodeIsTerminal(node)){ + if (treeDisplay.selectedTaxonHighlightMode > TreeDisplay.sTHM_GREYBOX && tree.getTaxa().getSelected(tree.taxonNumberOfNode(node))) + return highlightMultiplier(treeDisplay); + else + return 1; + } else if (tree.getAssociatedBit(triangleNameRef, node)) { - if (tree.numberOfTerminalsInClade(node)>2) + if (effectiveNumberOfTerminalsInClade(tree, node, treeDisplay)>2) return 3; else return 2; } - int num=0; + double num=0; for (int d = tree.firstDaughterOfNode(node); tree.nodeExists(d); d = tree.nextSisterOfNode(d)) { - num += effectiveNumberOfTerminals(tree, d); + num += effectiveNumberOfTerminals(tree, d, treeDisplay); } return num; } @@ -801,13 +828,15 @@ void setZoom(TreeDisplay treeDisplay, int node, double factor){ zoomFactor = factor; parametersChanged(); } - int getSpacing(TreeDisplay treeDisplay, Tree tree, int node, boolean inTriangle){ + double getSpacing(TreeDisplay treeDisplay, Tree tree, int node, boolean inTriangle){ if (inTriangle && !treeDisplay.getSimpleTriangle()) { int ancestralNode = tree.ancestorWithNameReference(triangleNameRef, node); if (ancestralNode==0 || node != tree.leftmostTerminalOfNode(ancestralNode)) return 4; } - int baseSpacing =treeDisplay.getTaxonSpacing(); + double baseSpacing =treeDisplay.getTaxonSpacing(); + if (treeDisplay.selectedTaxonHighlightMode > TreeDisplay.sTHM_GREYBOX && tree.getTaxa().getSelected(tree.taxonNumberOfNode(node))) + baseSpacing = baseSpacing *highlightMultiplier(treeDisplay)*0.89; //0.89 is magical constant to prevent too big a space for highlighted taxa if (zoomNode > 0){ int inZoom = tree.numberOfTerminalsInClade(zoomNode); if (inZoom<2) @@ -828,6 +857,11 @@ int getSpacing(TreeDisplay treeDisplay, Tree tree, int node, boolean inTriangle) return baseSpacing; } + void prepareFontMetrics(Font f, Graphics g){ + Font big2 = new Font(f.getName(), Font.PLAIN, f.getSize()*2); + fmBIG = g.getFontMetrics(big2); + fm = g.getFontMetrics(f); + } /*.................................................................................................................*/ public void calculateNodeLocs(TreeDisplay treeDisplay, Tree tree, int drawnRoot, Rectangle rect) { //Graphics g removed as parameter May 02 if (MesquiteTree.OK(tree)) { @@ -871,9 +905,9 @@ public void calculateNodeLocs(TreeDisplay treeDisplay, Tree tree, int drawnRoot, if (f==null) f = g.getFont(); - fm=g.getFontMetrics(f); + prepareFontMetrics(f, g); if (fm!=null) - treeDisplay.setTipsMargin(findMaxNameLength(tree, root) + treeDisplay.getTaxonNameBuffer() + treeDisplay.getTaxonNameDistance()); + treeDisplay.setTipsMargin(findMaxNameLength(treeDisplay, tree, root) + treeDisplay.getTaxonNameBuffer() + treeDisplay.getTaxonNameDistance()); } else treeDisplay.setTipsMargin(treeDisplay.getTaxonNameBuffer()); @@ -911,7 +945,7 @@ public void calculateNodeLocs(TreeDisplay treeDisplay, Tree tree, int drawnRoot, setDefaultOrientation(treeDisplay); if (treeDisplay.getOrientation()==TreeDisplay.UP) { - int numTerms = effectiveNumberOfTerminals(tree, root); + int numTerms = (int)effectiveNumberOfTerminals(tree, root, treeDisplay); if (numTerms == 0) numTerms = 1; if (fixedTaxonDistance!=0 && MesquiteInteger.isCombinable(fixedTaxonDistance)) @@ -974,7 +1008,7 @@ public void calculateNodeLocs(TreeDisplay treeDisplay, Tree tree, int drawnRoot, } else if (treeDisplay.getOrientation()==TreeDisplay.DOWN) { - int numTerms = effectiveNumberOfTerminals(tree, root); + int numTerms = (int)effectiveNumberOfTerminals(tree, root, treeDisplay); if (numTerms == 0) numTerms = 1; if (fixedTaxonDistance!=0 && MesquiteInteger.isCombinable(fixedTaxonDistance)) @@ -1032,7 +1066,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.DOWN) { } } else if (treeDisplay.getOrientation()==TreeDisplay.RIGHT) { - int numTerms = effectiveNumberOfTerminals(tree, root); + int numTerms = (int)effectiveNumberOfTerminals(tree, root, treeDisplay); if (numTerms == 0) numTerms = 1; if (fixedTaxonDistance!=0 && MesquiteInteger.isCombinable(fixedTaxonDistance)) @@ -1089,7 +1123,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.RIGHT) { } } else if (treeDisplay.getOrientation()==TreeDisplay.LEFT) { - int numTerms = effectiveNumberOfTerminals(tree, root); + int numTerms = (int)effectiveNumberOfTerminals(tree, root, treeDisplay); if (numTerms == 0) numTerms = 1; if (fixedTaxonDistance!=0 && MesquiteInteger.isCombinable(fixedTaxonDistance)) @@ -1228,7 +1262,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.DOWN) { GraphicsUtil.drawLine(g,rightEdge, (int)(base), rightEdge, (int)(base+ (totalScaleHeight*scaling))); } else if (treeDisplay.getOrientation()==TreeDisplay.LEFT) { - fm=g.getFontMetrics(g.getFont()); + prepareFontMetrics(g.getFont(), g); int textHeight = fm.getHeight(); double leftEdge = treeDisplay.getTreeDrawing().y[tree.leftmostTerminalOfNode(drawnRoot)]; double rightEdge = treeDisplay.getTreeDrawing().y[tree.rightmostTerminalOfNode(drawnRoot)]+ scaleBuffer; @@ -1255,7 +1289,7 @@ else if (treeDisplay.getOrientation()==TreeDisplay.LEFT) { GraphicsUtil.drawLine(g,(int)(base), rightEdge, (int)(base- (totalScaleHeight*scaling)),rightEdge); } else if (treeDisplay.getOrientation()==TreeDisplay.RIGHT) { - fm=g.getFontMetrics(g.getFont()); + prepareFontMetrics(g.getFont(), g); int textHeight = fm.getHeight(); double leftEdge = treeDisplay.getTreeDrawing().y[tree.leftmostTerminalOfNode(drawnRoot)]; double rightEdge = treeDisplay.getTreeDrawing().y[tree.rightmostTerminalOfNode(drawnRoot)] + scaleBuffer; diff --git a/Source/mesquite/trees/StoredTrees/StoredTrees.java b/Source/mesquite/trees/StoredTrees/StoredTrees.java index ccbe9a774..3e70dad00 100644 --- a/Source/mesquite/trees/StoredTrees/StoredTrees.java +++ b/Source/mesquite/trees/StoredTrees/StoredTrees.java @@ -53,7 +53,8 @@ public boolean startJob(String arguments, Object condition, boolean hiredByName) return sorry("No stored trees are available."); } managerVectorOfTreeBlocks = manager.getTreeBlockVector(); - managerVectorOfTreeBlocks.addListener(this); + if (managerVectorOfTreeBlocks!=null) + managerVectorOfTreeBlocks.addListener(this); //can leave a hint in terms of an id of a treeblock to use String whichBlock = MesquiteThread.retrieveAndDeleteHint(this); diff --git a/Source/mesquite/trees/ValuesAtNodes/ValuesAtNodes.java b/Source/mesquite/trees/ValuesAtNodes/ValuesAtNodes.java index 7d814abef..c154280e8 100644 --- a/Source/mesquite/trees/ValuesAtNodes/ValuesAtNodes.java +++ b/Source/mesquite/trees/ValuesAtNodes/ValuesAtNodes.java @@ -327,8 +327,13 @@ public ValuesAtNodesOperator (ValuesAtNodes ownerModule, TreeDisplay treeDisplay } /*.................................................................................................................*/ public void setTree(Tree tree){ + myTree = tree; + + if (vModule.isInStartup() && MesquiteThread.isScripting()) //don't do the calculations if starting in script, because numForNodeTasks will be reset anyways + return; if ((vModule.numForNodesTask!=null) && (vModule.displayTask!=null)) { + doCalculations(); } } diff --git a/docs/Acknowledgements.html b/docs/Acknowledgements.html index 257a77981..197e50951 100644 --- a/docs/Acknowledgements.html +++ b/docs/Acknowledgements.html @@ -41,8 +41,8 @@ Mesquite
Acknowledgements
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Additional Mesquite Packages.html b/docs/Additional Mesquite Packages.html index cadc29fed..2b0c0c073 100644 --- a/docs/Additional Mesquite Packages.html +++ b/docs/Additional Mesquite Packages.html @@ -41,8 +41,8 @@ Mesquite
Additional Packages
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Align.html b/docs/Align.html index b63caad58..ddcf165ed 100644 --- a/docs/Align.html +++ b/docs/Align.html @@ -41,8 +41,8 @@ Mesquite
Sequence Alignment
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Analyzing Continuous Characters.html b/docs/Analyzing Continuous Characters.html index 115399d29..37c94bfbc 100644 --- a/docs/Analyzing Continuous Characters.html +++ b/docs/Analyzing Continuous Characters.html @@ -41,8 +41,8 @@ Mesquite
Continuous characters
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Analyzing Molecular Data.html b/docs/Analyzing Molecular Data.html index f1dfbb6b0..a55f21f3b 100644 --- a/docs/Analyzing Molecular Data.html +++ b/docs/Analyzing Molecular Data.html @@ -41,8 +41,8 @@ Mesquite
Molecular Data
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Ancestral States.html b/docs/Ancestral States.html index 85713bdc9..eeefb38ca 100644 --- a/docs/Ancestral States.html +++ b/docs/Ancestral States.html @@ -41,8 +41,8 @@ Mesquite
Ancestral States
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Are strepsipterans related to flies.html b/docs/Are strepsipterans related to flies.html index 9ebbdd5ce..9aec5607c 100644 --- a/docs/Are strepsipterans related to flies.html +++ b/docs/Are strepsipterans related to flies.html @@ -41,8 +41,8 @@ Mesquite
Hypothesis testing
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Beginning Mesquite.html b/docs/Beginning Mesquite.html index 31e4c6c16..8b9f8fa62 100644 --- a/docs/Beginning Mesquite.html +++ b/docs/Beginning Mesquite.html @@ -41,8 +41,8 @@ Mesquite
Beginning Mesquite
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Bugs and Troubleshooting.html b/docs/Bugs and Troubleshooting.html index 5adcae742..0fe24d905 100644 --- a/docs/Bugs and Troubleshooting.html +++ b/docs/Bugs and Troubleshooting.html @@ -41,8 +41,8 @@ Mesquite
Bugs and Troubleshooting
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
@@ -198,11 +199,16 @@

 

Bugs and Troubleshooting

- If you think you've found a bug in Mesquite, our would like to suggest a feature, please read this page. For help in using Mesquite, see the Learning Mesquite and Getting Help page.
-
-A list of the known bugs in the current release version of Mesquite is listed on the page about Features and Bugs.
-
-

Mesquite under MacOS X 10.12 (Sierra)

+

If you think you've found a bug in Mesquite, our would like to suggest a feature, please read this page. For help in using Mesquite, see the Learning Mesquite and Getting Help page.
+
+ A list of the known bugs in the current release version of Mesquite is listed on the page about Features and Bugs.
+

+

Small text in Mesquite on Windows

+ There is a bug in some versions of Java which causes applications like Mesquite to show text (including that for Windows) in font that is extremely small. If you have this problem, do the following: +

Right-click on the Mesquite.exe icon, and choose Properties. The following instructions are for Windows 10; you will need to find the equivalent for other Windows versions. In the Properties dialog box, go to the Compatibility tab. Touch the "Change high DPI settings" button. In the dialog box that appears, check "Override high DPI scaling behavior.", and in the popup menu under "Scaling performed by:" choose "System". Press OK on this dialog, and then OK on the other dialog box.
+
+

+

Mesquite under MacOS X 10.12 (Sierra)

Under MacOS X Sierra, starting up versions of Mesquite prior to 3.2 may result in nothing more than the icon bouncing in the Dock a few times, then disappearing. That is, it won't start up. If you see this behaviour, try downloading the latest version of Mesquite, which should work. If it does not, please contact us.


diff --git a/docs/Character Evolution.html b/docs/Character Evolution.html index bdf419582..fad422ca6 100644 --- a/docs/Character Evolution.html +++ b/docs/Character Evolution.html @@ -41,8 +41,8 @@ Mesquite
Character Evolution
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Characters & Matrices.html b/docs/Characters & Matrices.html index fa1dae347..21234c540 100644 --- a/docs/Characters & Matrices.html +++ b/docs/Characters & Matrices.html @@ -41,8 +41,8 @@ Mesquite
Characters & Matrices
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Charts.html b/docs/Charts.html index 7bb294629..48da9f023 100644 --- a/docs/Charts.html +++ b/docs/Charts.html @@ -41,8 +41,8 @@ Mesquite
Charts
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Contact Us.html b/docs/Contact Us.html index c16d08af9..81a081852 100644 --- a/docs/Contact Us.html +++ b/docs/Contact Us.html @@ -41,8 +41,8 @@ Mesquite
Contact Us
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Developers Documentation.html b/docs/Developers Documentation.html index 174f5c98a..a58016b70 100644 --- a/docs/Developers Documentation.html +++ b/docs/Developers Documentation.html @@ -41,8 +41,8 @@ Mesquite
Developer's Documentation
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Developers Reference.html b/docs/Developers Reference.html index 04bb49cf5..fbfbe1cfc 100644 --- a/docs/Developers Reference.html +++ b/docs/Developers Reference.html @@ -41,8 +41,8 @@ Mesquite
Developer's Reference
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Development Team.html b/docs/Development Team.html index 6ac259c07..ce66e3d12 100644 --- a/docs/Development Team.html +++ b/docs/Development Team.html @@ -41,8 +41,8 @@ Mesquite
Development Team
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Diversification.html b/docs/Diversification.html index 7fdaaebc8..a9d895e9e 100644 --- a/docs/Diversification.html +++ b/docs/Diversification.html @@ -41,8 +41,8 @@ Mesquite
Diversification
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Documenting Your Work.html b/docs/Documenting Your Work.html index ec4e76d1d..80fd64167 100644 --- a/docs/Documenting Your Work.html +++ b/docs/Documenting Your Work.html @@ -41,8 +41,8 @@ Mesquite
Documenting Your Work
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Example Files.html b/docs/Example Files.html index 78472e6ba..0b9c07332 100644 --- a/docs/Example Files.html +++ b/docs/Example Files.html @@ -41,8 +41,8 @@ Mesquite
Example Files
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/FAQ.html b/docs/FAQ.html index 134a292bd..af4ef6175 100644 --- a/docs/FAQ.html +++ b/docs/FAQ.html @@ -41,8 +41,8 @@ Mesquite
FAQ
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Files.html b/docs/Files.html index b75718dbe..33149dc7c 100644 --- a/docs/Files.html +++ b/docs/Files.html @@ -41,8 +41,8 @@ Mesquite
Files
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Gene Trees.html b/docs/Gene Trees.html index b66a61af3..a052de5f2 100644 --- a/docs/Gene Trees.html +++ b/docs/Gene Trees.html @@ -41,8 +41,8 @@ Mesquite
Gene Trees
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Getting Help.html b/docs/Getting Help.html index f60ce38d9..ddec24038 100644 --- a/docs/Getting Help.html +++ b/docs/Getting Help.html @@ -41,8 +41,8 @@ Mesquite
Getting Help
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Glossary.html b/docs/Glossary.html index f5e9d4dca..e435f49ae 100644 --- a/docs/Glossary.html +++ b/docs/Glossary.html @@ -41,8 +41,8 @@ Mesquite
Glossary
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/History of Mesquite.html b/docs/History of Mesquite.html index edd3a16b0..4777d4cee 100644 --- a/docs/History of Mesquite.html +++ b/docs/History of Mesquite.html @@ -41,8 +41,8 @@ Mesquite
History of Mesquite
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/History of New Features.html b/docs/History of New Features.html index 76a2c88af..8a65d6f08 100644 --- a/docs/History of New Features.html +++ b/docs/History of New Features.html @@ -41,8 +41,8 @@ Mesquite
History of New Features
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
@@ -206,6 +207,28 @@

Features to come in the next release version of Mesquite are listed on this web page. These new features and bug fixes are already contained in latest source code in the development branch of the MesquiteProject/MesquiteCore repository on GitHub.

 

+
+

Version 3.6

+

New Features

+
    +
  • Names of selected taxa in tree windows can be enlarged (for instance, so that ingroup can be shown in larger font than outgroups). See Display>Highlight for Selected Taxa.
  • +
  • There are new options for color and style of names of taxa in tree windows. In addition to the old options of coloring by assigned color or taxon group, the name of a taxon can be colored according to how many matrices it has data in, or to some value for the taxon. See Display>Color and Style of Taxon Names.
  • +
  • Compatibility with Chromaseq 1.5 (including the new tools for submission to GenBank).
  • +
  • There is now a search-and-replace function for the OTU ID code in the Taxa List Window.
  • +
  • Copy Newick Tree for Open Tree available under Tree>Utilities.
  • +
  • There is a new character selection tool built to search for diagnostic characters or synapomorphies of groups, e.g. for molecular data. In a character matrix editor, first select the taxa whose distinguishing features you are seeking, then choose Select>Characters>Select Characters>With State Distinguish Selected Taxa.
  • +
  • One can now ask to have missing data cells show in paler text using Display>Lighten>Lighten Missing
  • +
+
+ Bug Fixes and Workarounds
+

+
    +
  • Dropping FASTA and other files on a matrix always led to adjusting the imported sequences relative to a reference, even if that option was not chosen. Fixed in build 906.
  • +
  • FASTA file import failed if the first line of the file was blank. Fixed in build 910.
  • +
  • The dialog box for choosing colors was often not responsive. Fixed in build 906.
  • +
  • On Windows computers with high-resolution monitors, Mesquite's text is now normally sized, not overly small. This was a bug in Java on Windows, but an available workaround was added to build 917.
    +
  • +

Version 3.51


Bug Fixes and Workarounds
diff --git a/docs/How Mesquite Works.html b/docs/How Mesquite Works.html index 67f502e3d..313902458 100644 --- a/docs/How Mesquite Works.html +++ b/docs/How Mesquite Works.html @@ -41,8 +41,8 @@ Mesquite
How Mesquite Works
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/How to Cite Mesquite.html b/docs/How to Cite Mesquite.html index 270ee935b..5dac4e763 100644 --- a/docs/How to Cite Mesquite.html +++ b/docs/How to Cite Mesquite.html @@ -41,8 +41,8 @@ Mesquite
How to Cite Mesquite
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Installation on Linux.html b/docs/Installation on Linux.html index 5ea3bf1d5..f99644f4a 100644 --- a/docs/Installation on Linux.html +++ b/docs/Installation on Linux.html @@ -41,8 +41,8 @@ Mesquite
Installation on Linux
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Installation on MacOS X.html b/docs/Installation on MacOS X.html index 0ff79bc08..b63afb034 100644 --- a/docs/Installation on MacOS X.html +++ b/docs/Installation on MacOS X.html @@ -41,8 +41,8 @@ Mesquite
Installation on MacOS X
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
@@ -199,10 +200,13 @@

 

Mesquite installation for MacOS X


-System requirements: Mac OS X 10.6 or higher, with Java 1.6 or higher.
+System requirements: Mac OS X 10.6 or higher, with Java 1.6 or higher. (MacOS X 10.10 or higher with Java 1.8 recommended.)

Instructions:
-
  1. If you have an older version of Mesquite, you may want to delete it (by deleting Mesquite_Folder), so as to avoid getting confused as to what version of Mesquite is starting up. First, however, you may want to take from Mesquite_Folder/mesquite any third party packages (e.g., PDAP, TreeSetViz) before deleting the directory.
  2. Download the latest version of Mesquite from the Mesquite Github repository. For Mac OS X, use the files ending in .dmg. There are two alternatives, one for Java 1.6 (recommended for OS X 10.9, Mavericks, and lower), the other for Java 1.7 and above (recommended for OS X 10.10, Yosemite, and higher).
  3. If the downloaded file doesn't mount into a disk image automatically, double click it to mount. You will see a Mesquite_Folder. Drag this Mesquite_Folder to your hard drive (e.g., your Applications folder). Its contents should be approximately as follows:
    • Mesquite_Folder
      • com/
      • corejava
      • documentation.html
      • edu/
      • examples/
      • images/
      • jars/
      • lesser.txt
      • lib/
      • mesquite/
      • Mesquite.app
      • org/
      • OtherWaysToStartMesquite
      • settings/
      • README-Starting Mesquite on Mac OS X.txt
  4. Double click the Mesquite icon to start Mesquite. If you don't have Java installed, you will be asked to install it.
  5. There are other executables to start Mesquite, within the folder OtherWaysToStartMesquite. They give you different options, for example, for amount of memory used. See the file "README-Starting Mesquite on Mac OS X.txt" for instructions.
  6. On Mac OS X 10.9 or below, Mesquite runs best with Java 1.6. On Mac OS X 10.0 or higher, Mesquite runs best on Java 1.7 or higher. To install Java 1.7 or higher, get it from http://java.com.

+
  1. If you have an older version of Mesquite, you may want to delete it (by deleting Mesquite_Folder), so as to avoid getting confused as to what version of Mesquite is starting up. First, however, you may want to take from Mesquite_Folder/mesquite any third party packages (e.g., PDAP, TreeSetViz) before deleting the directory.
  2. +
  3. Download the latest version of Mesquite from the Mesquite Github repository. For Mac OS X, use the files ending in .dmg. There are two alternatives, one for Java 1.6 (recommended for OS X 10.9, Mavericks, and lower), the other for Java 1.7 and above (recommended for OS X 10.10, Yosemite, and higher).
  4. +
  5. For MacOS X 10.10 (Yosemite) and later versions of the MacOS, we recommend using Java 1.8 and the version of Mesquite for Java 1.7 and above.
  6. +
  7. If the downloaded file doesn't mount into a disk image automatically, double click it to mount. You will see a Mesquite_Folder. Drag this Mesquite_Folder to your hard drive (e.g., your Applications folder). Its contents should be approximately as follows:
    • Mesquite_Folder
      • com/
      • corejava
      • documentation.html
      • edu/
      • examples/
      • images/
      • jars/
      • lesser.txt
      • lib/
      • mesquite/
      • Mesquite.app
      • org/
      • OtherWaysToStartMesquite
      • settings/
      • README-Starting Mesquite on Mac OS X.txt
  8. Double click the Mesquite icon to start Mesquite. If you don't have Java installed, you will be asked to install it.
  9. There are other executables to start Mesquite, within the folder OtherWaysToStartMesquite. They give you different options, for example, for amount of memory used. See the file "README-Starting Mesquite on Mac OS X.txt" for instructions.
  10. On Mac OS X 10.9 or below, Mesquite runs best with Java 1.6. On Mac OS X 10.0 or higher, Mesquite runs best on Java 1.7 or higher. To install Java 1.7 or higher, get it from http://java.com.


More details of issues of using Mesquite under Mac OS X are described in the Support page.
(Please email us (info {at} mesquiteproject.org) with questions or comments about downloading Mesquite). diff --git a/docs/Installation on Windows.html b/docs/Installation on Windows.html index ab6cd901e..8fe872e41 100644 --- a/docs/Installation on Windows.html +++ b/docs/Installation on Windows.html @@ -41,8 +41,8 @@ Mesquite
Installation on Windows
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
@@ -202,9 +203,15 @@

Mesquite installat System Requirements: Java 1.6 or higher.

Instructions:
-
  1. If you have an older version of Mesquite, you may want to delete it (by deleting Mesquite_Folder), so as to avoid getting confused as to what version of Mesquite is starting up. First, however, you may want to take from Mesquite_Folder/mesquite any third party packages (e.g., PDAP, TreeSetViz) before deleting the directory.
  2. Mesquite requires Java to be installed. If you don't have it installed, Mesquite should ask you to install it the first time it runs. In case that doesn't happen, you can download Java from http://java.com/download.
  3. Download the latest version of Mesquite from the Mesquite Github repository. For Windows, use the file ending in .zip.
  4. Extract all of the files from the zip. You will see a Mesquite_Folder. Place this Mesquite_Folder where you want on your hard drive, though if it is in a folder that requires a password for you to modify, you may have problems updating in the future. The contents of Mesquite_Folder should be approximately as follows:

-
    • Mesquite_Folder
      • com/
      • corejava
      • documentation.html
      • edu/
      • examples/
      • images/
      • jars/
      • lesser.txt
      • lib/
      • mesquite/
      • Mesquite.exe
      • OtherWaysToStartMesquite/
      • settings/
      • README-Starting Mesquite on Windows.txt
  1. Double click Mesquite.exe to start Mesquite. If you don't have Java installed, you will be asked to install it.
  2. Within the folder OtherWaysToStartMesquite are other executable files to start Mesquite, giving you different options for memory used. For instructions, see the file README-Starting Mesquite on Windows.txt
  3. The executable icons use the latest version of Java you have.

- Requirements: Tested on Windows XP through Windows 7. Java 1.6 or later required.
+
  1. If you have an older version of Mesquite, you may want to delete it (by deleting Mesquite_Folder), so as to avoid getting confused as to what version of Mesquite is starting up. First, however, you may want to take from Mesquite_Folder/mesquite any third party packages (e.g., PDAP, TreeSetViz) before deleting the directory.
  2. Mesquite requires Java to be installed. If you don't have it installed, Mesquite should ask you to install it the first time it runs. In case that doesn't happen, you can download Java from http://java.com/download.
  3. Download the latest version of Mesquite from the Mesquite Github repository. For Windows, use the file ending in .zip.
  4. Extract all of the files from the zip. You will see a Mesquite_Folder. Place this Mesquite_Folder where you want on your hard drive, though if it is in a folder that requires a password for you to modify, you may have problems updating in the future. The contents of Mesquite_Folder should be approximately as follows:
    +
+
    +
    • Mesquite_Folder
      • com/
      • corejava
      • documentation.html
      • edu/
      • examples/
      • images/
      • jars/
      • lesser.txt
      • lib/
      • mesquite/
      • Mesquite.exe
      • OtherWaysToStartMesquite/
      • settings/
      • README-Starting Mesquite on Windows.txt
+
    +
  1. Right-click on the Mesquite.exe icon, and choose Properties. The following instructions are for Windows 10; you will need to find the equivalent for other Windows versions. In the Properties dialog box, go to the Compatibility tab. Touch the "Change high DPI settings" button. In the dialog box that appears, check "Override high DPI scaling behavior.", and in the popup menu under "Scaling performed by:" choose "System". Press OK on this dialog, and then OK on the other dialog box.
  2. +
  3. Double click Mesquite.exe to start Mesquite. If you don't have Java installed, you will be asked to install it.
  4. +
  5. Within the folder OtherWaysToStartMesquite are other executable files to start Mesquite, giving you different options for memory used. For instructions, see the file README-Starting Mesquite on Windows.txt
  6. The executable icons use the latest version of Java you have.

+ Requirements: Tested on Windows XP through Windows 10. Java 1.6 or later required.

More details of issues of using Mesquite under Windows are described in the Support page.
(Please email us (info {at} mesquiteproject.org) with questions or comments about downloading Mesquite). diff --git a/docs/Installation.html b/docs/Installation.html index 9d245246b..f071a53fc 100644 --- a/docs/Installation.html +++ b/docs/Installation.html @@ -41,8 +41,8 @@ Mesquite
Installation
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Installing Mesquite Packages.html b/docs/Installing Mesquite Packages.html index ba87e4f6d..31aec17cf 100644 --- a/docs/Installing Mesquite Packages.html +++ b/docs/Installing Mesquite Packages.html @@ -41,8 +41,8 @@ Mesquite
Installing Mesquite Packages
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Interactions with Other Programs.html b/docs/Interactions with Other Programs.html index 4f4875f84..9167a8f52 100644 --- a/docs/Interactions with Other Programs.html +++ b/docs/Interactions with Other Programs.html @@ -41,8 +41,8 @@ Mesquite
Interactions with Other Programs
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Learning how to use Mesquite.html b/docs/Learning how to use Mesquite.html index a19a810bf..f106a84d3 100644 --- a/docs/Learning how to use Mesquite.html +++ b/docs/Learning how to use Mesquite.html @@ -41,8 +41,8 @@ Mesquite
Learning Mesquite
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Managing Continuous Data.html b/docs/Managing Continuous Data.html index 31cd3600b..b0ec75d30 100644 --- a/docs/Managing Continuous Data.html +++ b/docs/Managing Continuous Data.html @@ -41,8 +41,8 @@ Mesquite
Managing Continuous Data
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Managing Molecular Data.html b/docs/Managing Molecular Data.html index 2dde7f5bf..9fc98d549 100644 --- a/docs/Managing Molecular Data.html +++ b/docs/Managing Molecular Data.html @@ -41,8 +41,8 @@ Mesquite
Managing Molecular Data
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Menus.html b/docs/Menus.html index 0b0a79803..2d099bd53 100644 --- a/docs/Menus.html +++ b/docs/Menus.html @@ -41,8 +41,8 @@ Mesquite
Menus
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/MesquiteLogSupport.html b/docs/MesquiteLogSupport.html new file mode 100644 index 000000000..4adcb4d2c --- /dev/null +++ b/docs/MesquiteLogSupport.html @@ -0,0 +1,284 @@ + + + + + + + +How Mesquite Works + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + +

Log & Support Files

+

As Mesquite is running, it saves a file containing the text that appears in its log window. This file is called "Mesquite_Log" and is saved in a directory called "Mesquite_Support_Files", which will be in your home directory in Mac OS X and Linux, and in "C:\Users\yourUserName\" or "Documents and Settings\yourUserName\" in Windows.

+

Several log files from previous openings of Mesquite will also be present in the Mesquite_Support_Files directory, and will be named similar to "Mesquite_Log_(Previous#1)".

+

In addition, there will be a Mesquite_Prefs folder within Mesquite_Support_Files. There will be occasions where the files in that folder will be valuable for you to explore and share.

+

 

+

 

+ + + + +
+
+ +
+ + + + diff --git a/docs/Mesquites Features.html b/docs/Mesquites Features.html index 9fc745cd4..1b496bbd6 100644 --- a/docs/Mesquites Features.html +++ b/docs/Mesquites Features.html @@ -41,8 +41,8 @@ Mesquite
Mesquite's Features
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Module Index.html b/docs/Module Index.html index 0455550f1..39c8c391a 100644 --- a/docs/Module Index.html +++ b/docs/Module Index.html @@ -41,8 +41,8 @@ Mesquite
Module Index
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Modules.html b/docs/Modules.html index c826cd687..8f2c2fc93 100644 --- a/docs/Modules.html +++ b/docs/Modules.html @@ -41,8 +41,8 @@ Mesquite
Modules
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Pagel Correlation Method.html b/docs/Pagel Correlation Method.html index 2c36247b6..4967fd047 100644 --- a/docs/Pagel Correlation Method.html +++ b/docs/Pagel Correlation Method.html @@ -41,8 +41,8 @@ Mesquite
Pagel Correlation Method
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Processes of Character Evolution.html b/docs/Processes of Character Evolution.html index 3254004d5..676777edf 100644 --- a/docs/Processes of Character Evolution.html +++ b/docs/Processes of Character Evolution.html @@ -41,8 +41,8 @@ Mesquite
Processes of Character Evolution
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
diff --git a/docs/Publication Quality Trees.html b/docs/Publication Quality Trees.html index 6b685ada3..6f38c46e3 100644 --- a/docs/Publication Quality Trees.html +++ b/docs/Publication Quality Trees.html @@ -41,8 +41,8 @@ Mesquite
Publication Quality Trees
  - Version 3.51
- 28 June 2018
+ Version 3.6
+ 27 December 2018
@@ -157,6 +157,7 @@
+ @@ -168,7 +169,7 @@
How Mesquite Works
Log & Support Files
Scripts & Macros
Source Code
Developer's Documentation
- +
History of Mesquite
Why Mesquite?
Why Mesquite?
New Features & Bug List
Release Dates
@@ -237,10 +238,12 @@

Step To color individual branches, you can use the Branch Coloring tool (external image color.gif) from the Tree Window tool palette on the left-hand side of the Tree Window. This tool can be used to add colors for cosmetic effect to a tree (these colors play no role in analyses, and are not dictated by character states per se. See "Character Reconstructions" under step 6 below for branch coloring that based on character reconstructions). To set the color, right/control-click on the Branch Coloring tool icon, select Branch Paint Color, and choose from the list of available colors. Clicking on a branch with this tool will color that branch, control-clicking on a branch will color that branch, and all the descendant branches.
You can remove colors from branches by right/control-clicking on the Branch Coloring tool icon, and selecting Remove Color. The Remove Color tool works the same way as the branch coloring tool on single branches (click) and entire clades (control-click). You can also remove all colors from a tree by selecting Remove All Color from the Branch Coloring Tool icon options. It is important to note that colors added with the Branch Coloring tool will always be on top - any color changes applied from the Display > Branch Colors will not be visible on branches that have been colored using the Branch Coloring tool.

-

Step 5: Taxon Name Colors

- To color taxon names, you can partition the taxa into groups (groups are not the same as associations. To set a group, first go to the Taxa window for the Taxon block that contains the Taxon names you'd like to color (this will be the taxon block that corresponds to the tree window you are looking at). There should be a "Group" column on the list. If not, you can show the column by selecting Columns > Group Membership (taxa). First, select all the taxa in your first group. Using the small black triangle at the top of the column, select New group... (clicking once on the black triangle will bring up the Group menu). In the New Taxon Group dialog, type a name for this Group, and select a color. From the Group menu (accessible from the top of the Group column), you can create additional new Groups, edit current Groups, and set Group membership. For the latter, select the taxa you wish to place in the group, and selectSet Group > from the Group menu (the list of groups is shown). Each taxon can only be assigned to a single Group. The taxon names in the Tree Window should be the same color as assigned to the Group. If they are not, you can color them so by selecting, in the Tree Window, Display > Names > Color by Taxon Group. Alternatively, you can color the background of the taxon text by taxon group by selecting Display > Names > Background Color by Taxon Group. Of course, you'll likely want to turn off Color by Taxon Group, or the names will be the same color as the background, and thus won't be visible! Because taxa can only be assigned membership to one Group, if you would like to draw more than one tree, which differ only in Taxon Name coloration (topology and branch lengths being the same), it would be easiest to draw the tree first with one set of Group memberships, then save the file under a different name, and in the new file, change the Group memberships. This will make it easier to assign different Group memberships without overwriting other desired memberships.
-
-

Step 6: Extras

+

Step 5: Taxon Name Colors and Size

+

To color taxon names, you can partition the taxa into groups (groups are not the same as associations. To set a group, first go to the Taxa window for the Taxon block that contains the Taxon names you'd like to color (this will be the taxon block that corresponds to the tree window you are looking at). There should be a "Group" column on the list. If not, you can show the column by selecting Columns > Group Membership (taxa). First, select all the taxa in your first group. Using the small black triangle at the top of the column, select New group... (clicking once on the black triangle will bring up the Group menu). In the New Taxon Group dialog, type a name for this Group, and select a color. From the Group menu (accessible from the top of the Group column), you can create additional new Groups, edit current Groups, and set Group membership. For the latter, select the taxa you wish to place in the group, and selectSet Group > from the Group menu (the list of groups is shown). Each taxon can only be assigned to a single Group. The taxon names in the Tree Window should be the same color as assigned to the Group. If they are not, you can color them so by selecting, in the Tree Window, Display > Color and Style of Taxon Names > Color by Taxon Group. Alternatively, you can color the background of the taxon text by taxon group by selecting Display > Names > Background Color by Taxon Group. Of course, you'll likely want to turn off Color by Taxon Group, or the names will be the same color as the background, and thus won't be visible! Because taxa can only be assigned membership to one Group, if you would like to draw more than one tree, which differ only in Taxon Name coloration (topology and branch lengths being the same), it would be easiest to draw the tree first with one set of Group memberships, then save the file under a different name, and in the new file, change the Group memberships. This will make it easier to assign different Group memberships without overwriting other desired memberships.

+

You can make some taxa have larger taxon names (e.g. for the ingroup) by choosing Display>Highlight of Selected Taxa, and selecting one of the enlarging options. Then, if you select taxa, their names will be larger than the unselected taxa.
+
+

+

Step 6: Extras

  • Support Values as Branch Labels - If you would like to add support values to your tree, there are different ways to do so, depending on how you initially got the trees. Some programs save values as branch labels, then this section applies (if they program saves values as branch lengths, then see the next section). Bayesian trees from MrBayes usually contain the posterior probabilities, so they should be visible when you load the trees into Mesquite. If they are not, and the posterior probabilities are in the tree in Newick format, you can turn them on by selecting Display > Names > Show Branch Names. If you're not sure if the support values are in the Newick format tree, click on the "Text" tab in the Tree Window. You will see the line "Tree Description", which shows the tree in Newick format. If the support values are present, they will be evident as a string of characters immediately following the right parenthesis of a clade.
    For example, this tree,
external image abcTree.GIF