X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FMainFrameApplet.java;h=d74222975e94ea9c224a31726292bf82cb1a46d1;hb=8d6e81da091d432309f2f7034cf93dbc5ba5e82a;hp=2c0398b0e86607837709cfb5c3084d7f2d5cc355;hpb=09028c5abedb9492d6fc76b4274f6dd46bcf6cd6;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java index 2c0398b..d742229 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java @@ -87,6 +87,7 @@ public final class MainFrameApplet extends MainFrame { if ( getSpeciesTree() != null ) { buildAnalysisMenu(); } + buildFileMenu(); buildToolsMenu(); buildViewMenu(); buildFontSizeMenu(); @@ -125,41 +126,6 @@ public final class MainFrameApplet extends MainFrame { System.gc(); } - private void readSpeciesTree( final Configuration configuration, final String species_tree_url_str ) - throws MalformedURLException, FileNotFoundException, IOException { - final URL species_tree_url = new URL( species_tree_url_str ); - final Phylogeny[] species_trees = AptxUtil.readPhylogeniesFromUrl( species_tree_url, - configuration - .isValidatePhyloXmlAgainstSchema(), - configuration - .isReplaceUnderscoresInNhParsing(), - false, - TAXONOMY_EXTRACTION.NO, - false ); - if ( ( species_trees != null ) && ( species_trees.length > 0 ) ) { - AptxUtil.printAppletMessage( ArchaeopteryxA.NAME, "successfully read species tree" ); - if ( species_trees[ 0 ].isEmpty() ) { - ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "species tree is empty" ); - } - else if ( !species_trees[ 0 ].isRooted() ) { - ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "species tree is not rooted" ); - } - else { - setSpeciesTree( species_trees[ 0 ] ); - AptxUtil.printAppletMessage( ArchaeopteryxA.NAME, "species tree OK" ); - } - } - else { - ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "failed to read species tree from " - + species_tree_url_str ); - } - } - - @Override - public MainPanel getMainPanel() { - return _mainpanel; - } - void buildAnalysisMenu() { _analysis_menu = MainFrame.createMenu( "Analysis", getConfiguration() ); _analysis_menu.add( _gsdi_item = new JMenuItem( "GSDI (Generalized Speciation Duplication Inference)" ) ); @@ -185,10 +151,11 @@ public final class MainFrameApplet extends MainFrame { .setTextMinSupportMenuItem( _choose_minimal_confidence_mi, getOptions(), getCurrentTreePanel() ); MainFrame.setTextForFontChooserMenuItem( _choose_font_mi, createCurrentFontDesc( getMainPanel() .getTreeFontSet() ) ); + setTextForGraphicsSizeChooserMenuItem( _print_size_mi, getOptions() ); + setTextForPdfLineWidthChooserMenuItem( _choose_pdf_width_mi, getOptions() ); MainFrame.setCycleNodeFillMenuItem( _cycle_node_fill_mi, getOptions() ); MainFrame.setCycleNodeShapeMenuItem( _cycle_node_shape_mi, getOptions() ); MainFrame.setTextNodeSizeMenuItem( _choose_node_size_mi, getOptions() ); - try { getMainPanel().getControlPanel().setVisibilityOfDomainStrucureCB(); getMainPanel().getControlPanel().setVisibilityOfX(); @@ -249,6 +216,30 @@ public final class MainFrameApplet extends MainFrame { _options_jmenu.add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) ); _search_with_regex_cbmi.setToolTipText( MainFrame.SEARCH_WITH_REGEX_TIP ); _options_jmenu.add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( INVERSE_SEARCH_RESULT_LABEL ) ); + // + _options_jmenu.addSeparator(); + _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Graphics Export & Printing:" ), + getConfiguration() ) ); + _options_jmenu.add( _antialias_print_cbmi = new JCheckBoxMenuItem( "Antialias" ) ); + _options_jmenu.add( _print_black_and_white_cbmi = new JCheckBoxMenuItem( "Export in Black and White" ) ); + _options_jmenu + .add( _print_using_actual_size_cbmi = new JCheckBoxMenuItem( "Use Current Image Size for PDF export and Printing" ) ); + _options_jmenu + .add( _graphics_export_using_actual_size_cbmi = new JCheckBoxMenuItem( "Use Current Image Size for PNG, JPG, and GIF export" ) ); + _options_jmenu + .add( _graphics_export_visible_only_cbmi = new JCheckBoxMenuItem( "Limit to Visible ('Screenshot') for PNG, JPG, and GIF export" ) ); + _options_jmenu.add( _print_size_mi = new JMenuItem( "" ) ); + _options_jmenu.add( _choose_pdf_width_mi = new JMenuItem( "" ) ); + // + customizeCheckBoxMenuItem( _antialias_print_cbmi, getOptions().isAntialiasPrint() ); + customizeCheckBoxMenuItem( _print_black_and_white_cbmi, getOptions().isPrintBlackAndWhite() ); + customizeCheckBoxMenuItem( _graphics_export_visible_only_cbmi, getOptions().isGraphicsExportVisibleOnly() ); + customizeCheckBoxMenuItem( _print_using_actual_size_cbmi, getOptions().isPrintUsingActualSize() ); + customizeCheckBoxMenuItem( _graphics_export_using_actual_size_cbmi, getOptions() + .isGraphicsExportUsingActualSize() ); + customizeJMenuItem( _print_size_mi ); + customizeJMenuItem( _choose_pdf_width_mi ); + // customizeJMenuItem( _choose_font_mi ); customizeJMenuItem( _switch_colors_mi ); customizeJMenuItem( _choose_minimal_confidence_mi ); @@ -315,4 +306,39 @@ public final class MainFrameApplet extends MainFrame { JApplet getApplet() { return _applet; } + + @Override + public MainPanel getMainPanel() { + return _mainpanel; + } + + private void readSpeciesTree( final Configuration configuration, final String species_tree_url_str ) + throws MalformedURLException, FileNotFoundException, IOException { + final URL species_tree_url = new URL( species_tree_url_str ); + final Phylogeny[] species_trees = AptxUtil.readPhylogeniesFromUrl( species_tree_url, + configuration + .isValidatePhyloXmlAgainstSchema(), + configuration + .isReplaceUnderscoresInNhParsing(), + false, + TAXONOMY_EXTRACTION.NO, + false ); + if ( ( species_trees != null ) && ( species_trees.length > 0 ) ) { + AptxUtil.printAppletMessage( ArchaeopteryxA.NAME, "successfully read species tree" ); + if ( species_trees[ 0 ].isEmpty() ) { + ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "species tree is empty" ); + } + else if ( !species_trees[ 0 ].isRooted() ) { + ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "species tree is not rooted" ); + } + else { + setSpeciesTree( species_trees[ 0 ] ); + AptxUtil.printAppletMessage( ArchaeopteryxA.NAME, "species tree OK" ); + } + } + else { + ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "failed to read species tree from " + + species_tree_url_str ); + } + } }