git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
35f6448
)
subtree deletion changed
author
cmzmasek
<cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Jun 2012 05:06:20 +0000
(
05:06
+0000)
committer
cmzmasek
<cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Jun 2012 05:06:20 +0000
(
05:06
+0000)
forester/java/src/org/forester/phylogeny/Phylogeny.java
patch
|
blob
|
history
forester/java/src/org/forester/phylogeny/PhylogenyNode.java
patch
|
blob
|
history
forester/java/src/org/forester/util/ForesterConstants.java
patch
|
blob
|
history
diff --git
a/forester/java/src/org/forester/phylogeny/Phylogeny.java
b/forester/java/src/org/forester/phylogeny/Phylogeny.java
index
f3b6c5f
..
44851b2
100644
(file)
--- a/
forester/java/src/org/forester/phylogeny/Phylogeny.java
+++ b/
forester/java/src/org/forester/phylogeny/Phylogeny.java
@@
-221,14
+221,13
@@
public class Phylogeny {
* @param remove_us the parent node of the subtree to be deleted
*/
public void deleteSubtree( final PhylogenyNode remove_us, final boolean collapse_resulting_node_with_one_desc ) {
* @param remove_us the parent node of the subtree to be deleted
*/
public void deleteSubtree( final PhylogenyNode remove_us, final boolean collapse_resulting_node_with_one_desc ) {
- if ( isEmpty() ) {
+ if ( isEmpty() || ( remove_us.isRoot() && getNumberOfExternalNodes() != 1 ) ) {
return;
}
return;
}
- if ( remove_us.isRoot() ) {
+ if ( remove_us.isRoot() && getNumberOfExternalNodes() == 1 ) {
init();
init();
- return;
}
}
- if ( !collapse_resulting_node_with_one_desc ) {
+ else if ( !collapse_resulting_node_with_one_desc ) {
remove_us.getParent().removeChildNode( remove_us );
}
else {
remove_us.getParent().removeChildNode( remove_us );
}
else {
@@
-269,7
+268,7
@@
public class Phylogeny {
}
}
}
}
}
}
- remove_us.setParent( null );
+ remove_us.reset();
setIdHash( null );
externalNodesHaveChanged();
}
setIdHash( null );
externalNodesHaveChanged();
}
diff --git
a/forester/java/src/org/forester/phylogeny/PhylogenyNode.java
b/forester/java/src/org/forester/phylogeny/PhylogenyNode.java
index
4045537
..
8dedcd2
100644
(file)
--- a/
forester/java/src/org/forester/phylogeny/PhylogenyNode.java
+++ b/
forester/java/src/org/forester/phylogeny/PhylogenyNode.java
@@
-70,6
+70,14
@@
public final class PhylogenyNode implements PhylogenyNodeI, Comparable<Phylogeny
setSumExtNodes( 1 ); // For ext node, this number is 1 (not 0!!)
}
setSumExtNodes( 1 ); // For ext node, this number is 1 (not 0!!)
}
+ public void reset() {
+ _parent = null;
+ _link = null;
+ _descendants = null;
+ _node_data = null;
+ _branch_data = null;
+ }
+
/**
* Adds PhylogenyNode n to the list of child nodes and sets the _parent of n
* to this.
/**
* Adds PhylogenyNode n to the list of child nodes and sets the _parent of n
* to this.
diff --git
a/forester/java/src/org/forester/util/ForesterConstants.java
b/forester/java/src/org/forester/util/ForesterConstants.java
index
ccb270a
..
39dd287
100644
(file)
--- a/
forester/java/src/org/forester/util/ForesterConstants.java
+++ b/
forester/java/src/org/forester/util/ForesterConstants.java
@@
-27,8
+27,8
@@
package org.forester.util;
public final class ForesterConstants {
public final class ForesterConstants {
- public final static String FORESTER_VERSION = "1.003";
- public final static String FORESTER_DATE = "120608";
+ public final static String FORESTER_VERSION = "1.004";
+ public final static String FORESTER_DATE = "120619";
public final static String PHYLO_XML_VERSION = "1.10";
public final static String PHYLO_XML_LOCATION = "http://www.phyloxml.org";
public final static String PHYLO_XML_VERSION = "1.10";
public final static String PHYLO_XML_LOCATION = "http://www.phyloxml.org";