import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import org.apache.commons.codec.binary.Base64;
+import org.forester.archaeopteryx.AptxUtil.GraphicsExportType;
import org.forester.archaeopteryx.Options.CLADOGRAM_TYPE;
import org.forester.archaeopteryx.Options.NODE_LABEL_DIRECTION;
import org.forester.archaeopteryx.Options.PHYLOGENY_GRAPHICS_TYPE;
-import org.forester.archaeopteryx.Util.GraphicsExportType;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.data.SequenceRelation;
import org.forester.util.ForesterConstants;
import org.forester.util.ForesterUtil;
-import org.apache.commons.codec.binary.Base64;
// Use like this:
// <applet archive="forester.jar"
private JMenuItem _cycle_node_fill_mi;
private JMenuItem _choose_node_size_mi;
private JCheckBoxMenuItem _taxonomy_colorize_node_shapes_cbmi;
+ private JCheckBoxMenuItem _show_confidence_stddev_cbmi;
@Override
public void actionPerformed( final ActionEvent e ) {
else if ( o == _show_branch_length_values_cbmi ) {
updateOptions( getOptions() );
}
+ else if ( o == _show_confidence_stddev_cbmi ) {
+ updateOptions( getOptions() );
+ }
else if ( o == _label_direction_cbmi ) {
updateOptions( getOptions() );
}
}
else if ( o == _website_item ) {
try {
- Util.openWebsite( Constants.APTX_WEB_SITE, true, this );
+ AptxUtil.openWebsite( Constants.APTX_WEB_SITE, true, this );
}
catch ( final IOException e1 ) {
ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );
}
else if ( o == _phyloxml_website_item ) {
try {
- Util.openWebsite( Constants.PHYLOXML_WEB_SITE, true, this );
+ AptxUtil.openWebsite( Constants.PHYLOXML_WEB_SITE, true, this );
}
catch ( final IOException e1 ) {
ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );
}
else if ( o == _aptx_ref_item ) {
try {
- Util.openWebsite( Constants.APTX_REFERENCE_URL, true, this );
+ AptxUtil.openWebsite( Constants.APTX_REFERENCE_URL, true, this );
}
catch ( final IOException e1 ) {
ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );
}
else if ( o == _phyloxml_ref_item ) {
try {
- Util.openWebsite( Constants.PHYLOXML_REFERENCE_URL, true, this );
+ AptxUtil.openWebsite( Constants.PHYLOXML_REFERENCE_URL, true, this );
}
catch ( final IOException e1 ) {
ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );
* @author Herve Menager
*/
public String getCurrentPhylogenyGraphicsAsBase64EncodedString( final String format ) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try{
- Util.writePhylogenyToGraphicsByteArrayOutputStream( baos,
- _main_panel.getWidth(),
- _main_panel.getHeight(),
- this.getCurrentTreePanel(),
- getCurrentTreePanel().getControlPanel(),
- GraphicsExportType.valueOf(format),
- getOptions());
- }catch(IOException ioe){
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try {
+ AptxUtil.writePhylogenyToGraphicsByteArrayOutputStream( baos,
+ _main_panel.getWidth(),
+ _main_panel.getHeight(),
+ getCurrentTreePanel(),
+ getCurrentTreePanel().getControlPanel(),
+ GraphicsExportType.valueOf( format ),
+ getOptions() );
+ }
+ catch ( final IOException ioe ) {
ForesterUtil.printErrorMessage( NAME, ioe.toString() );
ioe.printStackTrace();
JOptionPane.showMessageDialog( this,
JOptionPane.ERROR_MESSAGE );
return null;
}
- byte[] bytes = baos.toByteArray();
- String dataImg = Base64.encodeBase64String(bytes);
+ final byte[] bytes = baos.toByteArray();
+ final String dataImg = Base64.encodeBase64String( bytes );
return dataImg;
}
-
+
void buildFontSizeMenu() {
_font_size_menu = MainFrame.createMenu( MainFrame.FONT_SIZE_MENU_LABEL, getConfiguration() );
_font_size_menu.add( _super_tiny_fonts_mi = new JMenuItem( "Super tiny fonts" ) );
_radio_group_1.add( _ext_node_dependent_cladogram_rbmi );
_radio_group_1.add( _uniform_cladograms_rbmi );
_radio_group_1.add( _non_lined_up_cladograms_rbmi );
- //
+ _options_jmenu.add( _show_overview_cbmi = new JCheckBoxMenuItem( MainFrame.SHOW_OVERVIEW_LABEL ) );
+ _options_jmenu.add( _show_scale_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_SCALE_LABEL ) );
+ _options_jmenu
+ .add( _show_branch_length_values_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_BRANCH_LENGTH_VALUES_LABEL ) );
+ _options_jmenu.add( _show_confidence_stddev_cbmi = new JCheckBoxMenuItem( MainFrame.SHOW_CONF_STDDEV_LABEL ) );
_options_jmenu
.add( _show_default_node_shapes_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_NODE_BOXES_LABEL ) );
_options_jmenu
_options_jmenu.add( _cycle_node_shape_mi = new JMenuItem( MainFrame.CYCLE_NODE_SHAPE_LABEL ) );
_options_jmenu.add( _cycle_node_fill_mi = new JMenuItem( MainFrame.CYCLE_NODE_FILL_LABEL ) );
_options_jmenu.add( _choose_node_size_mi = new JMenuItem( MainFrame.CHOOSE_NODE_SIZE_LABEL ) );
- //
- _options_jmenu.add( _show_scale_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_SCALE_LABEL ) );
- _options_jmenu
- .add( _show_branch_length_values_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_BRANCH_LENGTH_VALUES_LABEL ) );
- _options_jmenu.add( _show_overview_cbmi = new JCheckBoxMenuItem( MainFrame.SHOW_OVERVIEW_LABEL ) );
_options_jmenu.add( _label_direction_cbmi = new JCheckBoxMenuItem( MainFrame.LABEL_DIRECTION_LABEL ) );
_options_jmenu
.add( _color_labels_same_as_parent_branch = new JCheckBoxMenuItem( MainFrame.COLOR_LABELS_LABEL ) );
customizeCheckBoxMenuItem( _show_overview_cbmi, getOptions().isShowOverview() );
customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );
customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );
+ customizeCheckBoxMenuItem( _show_confidence_stddev_cbmi, getOptions().isShowConfidenceStddev() );
_jmenubar.add( _options_jmenu );
}
@Override
public void destroy() {
- Util.printAppletMessage( NAME, "going to be destroyed " );
+ AptxUtil.printAppletMessage( NAME, "going to be destroyed " );
removeTextFrame();
if ( getMainPanel() != null ) {
getMainPanel().terminate();
@Override
public void init() {
final String config_filename = getParameter( Constants.APPLET_PARAM_NAME_FOR_CONFIG_FILE_URL );
- Util.printAppletMessage( NAME, "URL for configuration file is: " + config_filename );
- final Configuration configuration = new Configuration( config_filename, true, true );
+ AptxUtil.printAppletMessage( NAME, "URL for configuration file is: " + config_filename );
+ final Configuration configuration = new Configuration( config_filename, true, true, true );
setConfiguration( configuration );
setOptions( Options.createInstance( configuration ) );
setupUI();
URL phys_url = null;
Phylogeny[] phys = null;
final String phys_url_string = getParameter( Constants.APPLET_PARAM_NAME_FOR_URL_OF_TREE_TO_LOAD );
- Util.printAppletMessage( NAME, "URL for phylogenies is " + phys_url_string );
+ AptxUtil.printAppletMessage( NAME, "URL for phylogenies is " + phys_url_string );
// Get URL to tree file
if ( phys_url_string != null ) {
try {
// Load the tree from URL
if ( phys_url != null ) {
try {
- phys = Util.readPhylogeniesFromUrl( phys_url, getConfiguration().isValidatePhyloXmlAgainstSchema() );
+ phys = AptxUtil.readPhylogeniesFromUrl( phys_url, getConfiguration().isValidatePhyloXmlAgainstSchema() );
}
catch ( final Exception e ) {
ForesterUtil.printErrorMessage( NAME, e.toString() );
return;
}
else {
- Util.printAppletMessage( NAME, "loaded " + phys.length + " phylogenies from: " + phys_url );
+ AptxUtil.printAppletMessage( NAME, "loaded " + phys.length + " phylogenies from: " + phys_url );
}
setVisible( false );
setMainPanel( new MainPanelApplets( getConfiguration(), this ) );
}
} );
if ( getConfiguration().isUseTabbedDisplay() ) {
- Util.printAppletMessage( NAME, "using tabbed display" );
- Util.addPhylogeniesToTabs( phys,
- new File( phys_url.getFile() ).getName(),
- phys_url.toString(),
- getConfiguration(),
- getMainPanel() );
+ AptxUtil.printAppletMessage( NAME, "using tabbed display" );
+ AptxUtil.addPhylogeniesToTabs( phys,
+ new File( phys_url.getFile() ).getName(),
+ phys_url.toString(),
+ getConfiguration(),
+ getMainPanel() );
}
else {
- Util.printAppletMessage( NAME, "not using tabbed display" );
- Util.addPhylogenyToPanel( phys, getConfiguration(), getMainPanel() );
+ AptxUtil.printAppletMessage( NAME, "not using tabbed display" );
+ AptxUtil.addPhylogenyToPanel( phys, getConfiguration(), getMainPanel() );
}
validate();
setName( NAME );
getMainPanel().getControlPanel().showWholeAll();
getMainPanel().getControlPanel().showWhole();
System.gc();
- Util.printAppletMessage( NAME, "successfully initialized" );
+ AptxUtil.printAppletMessage( NAME, "successfully initialized" );
/* GUILHEM_BEG */
getCurrentTreePanel().getControlPanel().getSequenceRelationTypeBox().removeAllItems();
for( final SequenceRelation.SEQUENCE_RELATION_TYPE type : getMainPanel().getCurrentPhylogeny()
private void removeBranchColors() {
if ( getMainPanel().getCurrentPhylogeny() != null ) {
- Util.removeBranchColors( getMainPanel().getCurrentPhylogeny() );
+ AptxUtil.removeBranchColors( getMainPanel().getCurrentPhylogeny() );
}
}
}
}
catch ( final UnsupportedLookAndFeelException e ) {
- Util.dieWithSystemError( "UnsupportedLookAndFeelException: " + e.toString() );
+ AptxUtil.dieWithSystemError( "UnsupportedLookAndFeelException: " + e.toString() );
}
catch ( final ClassNotFoundException e ) {
- Util.dieWithSystemError( "ClassNotFoundException: " + e.toString() );
+ AptxUtil.dieWithSystemError( "ClassNotFoundException: " + e.toString() );
}
catch ( final InstantiationException e ) {
- Util.dieWithSystemError( "InstantiationException: " + e.toString() );
+ AptxUtil.dieWithSystemError( "InstantiationException: " + e.toString() );
}
catch ( final IllegalAccessException e ) {
- Util.dieWithSystemError( "IllegalAccessException: " + e.toString() );
+ AptxUtil.dieWithSystemError( "IllegalAccessException: " + e.toString() );
}
catch ( final Exception e ) {
- Util.dieWithSystemError( e.toString() );
+ AptxUtil.dieWithSystemError( e.toString() );
}
}
requestFocus();
requestFocusInWindow();
requestFocus();
- Util.printAppletMessage( NAME, "started" );
+ AptxUtil.printAppletMessage( NAME, "started" );
}
void switchColors() {
}
}
options.setShowOverview( ( _show_overview_cbmi != null ) && _show_overview_cbmi.isSelected() );
+ options.setShowConfidenceStddev( ( _show_confidence_stddev_cbmi != null )
+ && _show_confidence_stddev_cbmi.isSelected() );
if ( ( _show_branch_length_values_cbmi != null ) && _show_branch_length_values_cbmi.isEnabled() ) {
options.setShowBranchLengthValues( _show_branch_length_values_cbmi.isSelected() );
}
|| ( getMainPanel().getCurrentPhylogeny().getNumberOfExternalNodes() > 10000 ) ) {
return;
}
- _textframe = TextFrame.instantiate( getMainPanel().getCurrentPhylogeny().toNewHampshire( false ) );
+ _textframe = TextFrame.instantiate( getMainPanel().getCurrentPhylogeny().toNewHampshire() );
}
void viewAsNHX() {