public final class Constants {
- final static boolean __ALLOW_PHYLOGENETIC_INFERENCE = true;
- public final static boolean __RELEASE = false; // TODO remove me
- public final static boolean __SNAPSHOT_RELEASE = false; // TODO remove me
+ final static boolean __ALLOW_PHYLOGENETIC_INFERENCE = false;
+ public final static boolean __RELEASE = true; // TODO remove me
+ public final static boolean __SNAPSHOT_RELEASE = true; // TODO remove me
public final static boolean __SYNTH_LF = false; // TODO remove me
public final static boolean ALLOW_DDBJ_BLAST = false;
public final static String PRG_NAME = "Archaeopteryx";
final static String VERSION = "0.971 9M";
- final static String PRG_DATE = "2012.04.09";
+ final static String PRG_DATE = "2012.04.16";
final static String DEFAULT_CONFIGURATION_FILE_NAME = "_aptx_configuration_file";
final static String[] DEFAULT_FONT_CHOICES = { "Verdana", "Tahoma",
"Arial", "Helvetica", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans" };
final static float WHEEL_ZOOM_IN_X_CORRECTION_FACTOR = 1.085f;
final static float WHEEL_ZOOM_OUT_X_CORRECTION_FACTOR = 1 / Constants.WHEEL_ZOOM_IN_X_CORRECTION_FACTOR;
static final boolean SPECIAL_CUSTOM = false; //TODO remove me
- static final int EXT_NODE_INFO_LENGTH_MAX = 300;
+ static final double EXT_NODE_INFO_LENGTH_MAX_RATIO = 0.95;
static final Dimension NODE_PANEL_SPLIT_MINIMUM_SIZE = new Dimension( 100, 50 );
static final Dimension NODE_PANEL_SIZE = new Dimension( 500, 600 );
static final Dimension NODE_FRAME_SIZE = new Dimension( 520, 640 );
if ( ( _phylogeny == null ) || _phylogeny.isEmpty() ) {
return;
}
- int longest = 20;
+ int max_length = ForesterUtil.roundToInt( ( getSize().getWidth() - MOVE )
+ * Constants.EXT_NODE_INFO_LENGTH_MAX_RATIO );
+ if ( max_length < 40 ) {
+ max_length = 40;
+ }
+ int longest = 30;
for( final PhylogenyNode node : _phylogeny.getExternalNodes() ) {
int sum = 0;
if ( node.isCollapse() ) {
.asSimpleText()
+ " " );
}
+ if ( getControlPanel().isShowDomainArchitectures()
+ && ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {
+ sum += ( ( RenderableDomainArchitecture ) node.getNodeData().getSequence().getDomainArchitecture() )
+ .getRenderingSize().getWidth();
+ }
}
if ( node.getNodeData().isHasTaxonomy() ) {
final Taxonomy tax = node.getNodeData().getTaxonomy();
sum += getTreeFontSet()._fm_large.stringWidth( node.getNodeData().getBinaryCharacters()
.getGainedCharactersAsStringBuffer().toString() );
}
- if ( getControlPanel().isShowDomainArchitectures() && node.getNodeData().isHasSequence()
- && ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {
- sum += ( ( RenderableDomainArchitecture ) node.getNodeData().getSequence().getDomainArchitecture() )
- .getRenderingSize().getWidth();
- }
- if ( sum >= Constants.EXT_NODE_INFO_LENGTH_MAX ) {
- setLongestExtNodeInfo( Constants.EXT_NODE_INFO_LENGTH_MAX );
+ if ( sum >= max_length ) {
+ setLongestExtNodeInfo( max_length );
return;
}
if ( sum > longest ) {
longest = sum;
}
}
- if ( longest >= Constants.EXT_NODE_INFO_LENGTH_MAX ) {
- setLongestExtNodeInfo( Constants.EXT_NODE_INFO_LENGTH_MAX );
+ if ( longest >= max_length ) {
+ setLongestExtNodeInfo( max_length );
}
else {
setLongestExtNodeInfo( longest );
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.Writer;
+import java.math.BigDecimal;
import java.util.Map;
import java.util.SortedMap;
}
@Override
- public SortedMap<Double, ProteinDomain> getDomains() {
+ public SortedMap<BigDecimal, ProteinDomain> getDomains() {
return _domain_structure.getDomains();
}
@Override
public Dimension getRenderingSize() {
- return new Dimension( ForesterUtil.roundToInt( _domain_structure.getTotalLength() * _rendering_factor_width ),
+ return new Dimension( ForesterUtil.roundToInt( _domain_structure.getTotalLength() * getRenderingFactorWidth() ),
ForesterUtil.roundToInt( _rendering_height ) );
}
import java.io.IOException;
import java.io.Writer;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedMap;
public class DomainArchitecture implements PhylogenyData {
- public final static String NHX_SEPARATOR = ">";
- private static final double INCREASE_KEY = 0.0001;
- private SortedMap<Double, ProteinDomain> _domains;
- private int _total_length;
+ public final static String NHX_SEPARATOR = ">";
+ private static final BigDecimal INCREASE_KEY = new BigDecimal( "0.00001" );
+ private SortedMap<BigDecimal, ProteinDomain> _domains;
+ private int _total_length;
public DomainArchitecture() {
init();
}
}
catch ( final Exception e ) {
- throw new IllegalArgumentException( "Malformed format for domain structure \"" + da_str + "\": "
+ throw new IllegalArgumentException( "malformed format for domain structure \"" + da_str + "\": "
+ e.getMessage() );
}
if ( to > total_length ) {
}
public void addDomain( final ProteinDomain pd ) {
- Double key = new Double( pd.getFrom() );
+ BigDecimal key = new BigDecimal( "" + pd.getFrom() );
while ( _domains.containsKey( key ) ) {
- key = new Double( key.doubleValue() + DomainArchitecture.INCREASE_KEY );
+ key = new BigDecimal( "" + ( key.doubleValue() + DomainArchitecture.INCREASE_KEY.doubleValue() ) );
}
_domains.put( key, pd );
}
return ( ProteinDomain ) _domains.values().toArray()[ i ];
}
- public SortedMap<Double, ProteinDomain> getDomains() {
+ public SortedMap<BigDecimal, ProteinDomain> getDomains() {
return _domains;
}
}
private void init() {
- _domains = new TreeMap<Double, ProteinDomain>();
+ _domains = new TreeMap<BigDecimal, ProteinDomain>();
_total_length = 0;
}