}
} );
if ( getConfiguration().isUseTabbedDisplay() ) {
- AptxUtil.printAppletMessage( NAME, "using tabbed display" );
- AptxUtil.addPhylogeniesToTabs( phys,
- new File( phys_url.getFile() ).getName(),
- phys_url.toString(),
- getConfiguration(),
- getMainPanel() );
+ try {
+ AptxUtil.printAppletMessage( NAME, "using tabbed display" );
+ AptxUtil.addPhylogeniesToTabs( phys,
+ new File( phys_url.getFile() ).getName(),
+ phys_url.toString(),
+ getConfiguration(),
+ getMainPanel() );
+ }
+ catch ( final Exception e ) {
+ ForesterUtil.printErrorMessage( NAME, e.toString() );
+ e.printStackTrace();
+ }
}
else {
AptxUtil.printAppletMessage( NAME, "not using tabbed display" );
}
AptxUtil.addPhylogenyToPanel( phys, getConfiguration(), getMainPanel() );
}
- validate();
- setName( NAME );
- getMainPanel().getControlPanel().showWholeAll();
- getMainPanel().getControlPanel().showWhole();
- /* GUILHEM_BEG */
- getCurrentTreePanel().getControlPanel().getSequenceRelationTypeBox().removeAllItems();
- for( final SequenceRelation.SEQUENCE_RELATION_TYPE type : getMainPanel().getCurrentPhylogeny()
- .getRelevantSequenceRelationTypes() ) {
- getCurrentTreePanel().getControlPanel().getSequenceRelationTypeBox().addItem( type );
- }
- final String default_relation = getParameter( Constants.APPLET_PARAM_NAME_FOR_DEFAULT_SEQUENCE_RELATION_TYPE );
- if ( default_relation != null ) {
- getCurrentTreePanel().getControlPanel().getSequenceRelationTypeBox().setSelectedItem( default_relation );
- }
- final String default_sequence = getParameter( Constants.APPLET_PARAM_NAME_FOR_DEFAULT_QUERY_SEQUENCE );
- if ( default_sequence != null ) {
- getCurrentTreePanel().getControlPanel().getSequenceRelationBox().setSelectedItem( default_sequence );
- }
- /* GUILHEM_END */
- System.gc();
- AptxUtil.printAppletMessage( NAME, "successfully initialized" );
- setVisible( true );
+ try {
+ validate();
+ setName( NAME );
+ getMainPanel().getControlPanel().showWholeAll();
+ getMainPanel().getControlPanel().showWhole();
+ /* GUILHEM_BEG */
+ getCurrentTreePanel().getControlPanel().getSequenceRelationTypeBox().removeAllItems();
+ for( final SequenceRelation.SEQUENCE_RELATION_TYPE type : getMainPanel().getCurrentPhylogeny()
+ .getRelevantSequenceRelationTypes() ) {
+ getCurrentTreePanel().getControlPanel().getSequenceRelationTypeBox().addItem( type );
+ }
+ final String default_relation = getParameter( Constants.APPLET_PARAM_NAME_FOR_DEFAULT_SEQUENCE_RELATION_TYPE );
+ if ( default_relation != null ) {
+ getCurrentTreePanel().getControlPanel().getSequenceRelationTypeBox().setSelectedItem( default_relation );
+ }
+ final String default_sequence = getParameter( Constants.APPLET_PARAM_NAME_FOR_DEFAULT_QUERY_SEQUENCE );
+ if ( default_sequence != null ) {
+ getCurrentTreePanel().getControlPanel().getSequenceRelationBox().setSelectedItem( default_sequence );
+ }
+ /* GUILHEM_END */
+ System.gc();
+ AptxUtil.printAppletMessage( NAME, "successfully initialized" );
+ setVisible( true );
+ }
+ catch ( final Exception e ) {
+ ForesterUtil.printErrorMessage( NAME, e.toString() );
+ e.printStackTrace();
+ }
}
public void showTextFrame( final String s, final String title ) {
}
private final void nodeDataAsSB( final PhylogenyNode node, final StringBuilder sb ) {
- if ( getControlPanel().isShowNodeNames() && ( node.getName().length() > 0 ) ) {
- if ( sb.length() > 0 ) {
- sb.append( " " );
- }
- sb.append( node.getName() );
- }
- if ( node.getNodeData().isHasSequence() ) {
- if ( getControlPanel().isShowSeqSymbols() && ( node.getNodeData().getSequence().getSymbol().length() > 0 ) ) {
+ if ( node != null ) {
+ if ( getControlPanel().isShowNodeNames() && ( !ForesterUtil.isEmpty( node.getName() ) ) ) {
if ( sb.length() > 0 ) {
sb.append( " " );
}
- sb.append( node.getNodeData().getSequence().getSymbol() );
+ sb.append( node.getName() );
}
- if ( getControlPanel().isShowGeneNames() && ( node.getNodeData().getSequence().getGeneName().length() > 0 ) ) {
- if ( sb.length() > 0 ) {
- sb.append( " " );
+ if ( node.getNodeData().isHasSequence() ) {
+ if ( getControlPanel().isShowSeqSymbols()
+ && ( node.getNodeData().getSequence().getSymbol().length() > 0 ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ sb.append( node.getNodeData().getSequence().getSymbol() );
}
- sb.append( node.getNodeData().getSequence().getGeneName() );
- }
- if ( getControlPanel().isShowSeqNames() && ( node.getNodeData().getSequence().getName().length() > 0 ) ) {
- if ( sb.length() > 0 ) {
- sb.append( " " );
+ if ( getControlPanel().isShowGeneNames()
+ && ( node.getNodeData().getSequence().getGeneName().length() > 0 ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ sb.append( node.getNodeData().getSequence().getGeneName() );
+ }
+ if ( getControlPanel().isShowSeqNames() && ( node.getNodeData().getSequence().getName().length() > 0 ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ sb.append( node.getNodeData().getSequence().getName() );
+ }
+ if ( getControlPanel().isShowSequenceAcc()
+ && ( node.getNodeData().getSequence().getAccession() != null ) ) {
+ if ( sb.length() > 0 ) {
+ sb.append( " " );
+ }
+ if ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getAccession().getSource() ) ) {
+ sb.append( node.getNodeData().getSequence().getAccession().getSource() );
+ sb.append( ":" );
+ }
+ sb.append( node.getNodeData().getSequence().getAccession().getValue() );
}
- sb.append( node.getNodeData().getSequence().getName() );
}
- if ( getControlPanel().isShowSequenceAcc() && ( node.getNodeData().getSequence().getAccession() != null ) ) {
+ if ( getControlPanel().isShowProperties() && node.getNodeData().isHasProperties() ) {
if ( sb.length() > 0 ) {
sb.append( " " );
}
- if ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getAccession().getSource() ) ) {
- sb.append( node.getNodeData().getSequence().getAccession().getSource() );
- sb.append( ":" );
- }
- sb.append( node.getNodeData().getSequence().getAccession().getValue() );
- }
- }
- if ( getControlPanel().isShowProperties() && node.getNodeData().isHasProperties() ) {
- if ( sb.length() > 0 ) {
- sb.append( " " );
+ sb.append( propertiesToString( node ) );
}
- sb.append( propertiesToString( node ) );
}
}