X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FMainFrameApplication.java;h=dc9306377ab70c810cb7b1474806eed767d0c93f;hb=5642da5f473ab9ae57fee86c0cb3b33525a2e916;hp=3baabd1da0857ed4c2a5fc5d4e63290c2e9bdc71;hpb=4a71774e563925de62c37378a6c32c3275f2e287;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index 3baabd1..dc93063 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -57,6 +57,8 @@ import javax.swing.UnsupportedLookAndFeelException; import javax.swing.WindowConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.event.InternalFrameAdapter; +import javax.swing.event.InternalFrameEvent; import org.forester.analysis.TaxonomyDataManager; import org.forester.archaeopteryx.Options.CLADOGRAM_TYPE; @@ -77,7 +79,6 @@ import org.forester.io.parsers.nhx.NHXParser; import org.forester.io.parsers.nhx.NHXParser.TAXONOMY_EXTRACTION; import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException; import org.forester.io.parsers.phyloxml.PhyloXmlParser; -import org.forester.io.parsers.phyloxml.PhyloXmlUtil; import org.forester.io.parsers.tol.TolParser; import org.forester.io.parsers.util.ParserUtils; import org.forester.io.writers.SequenceWriter; @@ -103,8 +104,8 @@ import org.forester.util.ForesterUtil; public final class MainFrameApplication extends MainFrame { - private final static int FRAME_X_SIZE = 800; - private final static int FRAME_Y_SIZE = 800; + private final static int FRAME_X_SIZE = 900; + private final static int FRAME_Y_SIZE = 900; // Filters for the file-open dialog (classes defined in this file) private static final long serialVersionUID = -799735726778865234L; private static final boolean PREPROCESS_TREES = false; @@ -162,10 +163,10 @@ public final class MainFrameApplication extends MainFrame { setSize( MainFrameApplication.FRAME_X_SIZE, MainFrameApplication.FRAME_Y_SIZE ); // The window listener setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE ); - addWindowListener( new WindowAdapter() { + addInternalFrameListener( new InternalFrameAdapter() { @Override - public void windowClosing( final WindowEvent e ) { + public void internalFrameClosing (final InternalFrameEvent e ) { exit(); } } ); @@ -303,14 +304,16 @@ public final class MainFrameApplication extends MainFrame { // } ); // The window listener setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE ); - addWindowListener( new WindowAdapter() { + + addInternalFrameListener( new InternalFrameAdapter() { @Override - public void windowClosing( final WindowEvent e ) { + public void internalFrameClosing( final InternalFrameEvent e ) { + if (MainFrameApplication.this.getParent() == null) { if ( isUnsavedDataPresent() ) { - final int r = JOptionPane.showConfirmDialog( null, - "Exit despite potentially unsaved changes?", - "Exit?", + final int r = JOptionPane.showConfirmDialog( _mainpanel, + "Close Archaeopteryx despite potentially unsaved changes?", + "Close viewer?", JOptionPane.YES_NO_OPTION ); if ( r != JOptionPane.YES_OPTION ) { return; @@ -322,10 +325,10 @@ public final class MainFrameApplication extends MainFrame { if ( r != JOptionPane.YES_OPTION ) { return; } - } + }} exit(); - } - } ); + + } }); // The component listener addComponentListener( new ComponentAdapter() { @@ -516,7 +519,7 @@ public final class MainFrameApplication extends MainFrame { msa = FastaParser.parseMsa( is ); } else { - msa = GeneralMsaParser.parse( is ); + msa = GeneralMsaParser.parseMsa( is ); } } catch ( final MsaFormatException e ) { @@ -761,10 +764,7 @@ public final class MainFrameApplication extends MainFrame { l.add( d ); } if ( !l.isEmpty() ) { - if ( node.getNodeData().getProperties() != null ) { - node.getNodeData().getProperties() - .removePropertiesWithGivenReferencePrefix( PhyloXmlUtil.VECTOR_PROPERTY_REF ); - } + node.getNodeData().setVector( l ); } } @@ -1353,14 +1353,9 @@ public final class MainFrameApplication extends MainFrame { _mainpanel.getControlPanel().showWhole(); _mainpanel.getCurrentTreePanel().setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ); _mainpanel.getOptions().setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ); - if ( getMainPanel().getMainFrame() == null ) { - // Must be "E" applet version. - ( ( ArchaeopteryxE ) ( ( MainPanelApplets ) getMainPanel() ).getApplet() ) - .setSelectedTypeInTypeMenu( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ); - } - else { - getMainPanel().getMainFrame().setSelectedTypeInTypeMenu( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ); - } + + getMainPanel().getMainFrame().setSelectedTypeInTypeMenu( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ); + activateSaveAllIfNeeded(); System.gc(); } @@ -1751,6 +1746,7 @@ public final class MainFrameApplication extends MainFrame { if ( AptxUtil.canWriteFormat( "bmp" ) ) { _file_jmenu.add( _write_to_bmp_item = new JMenuItem( "Export to BMP file..." ) ); } + _file_jmenu.add( _write_to_eps_item = new JMenuItem("Export to EPS file...") ); _file_jmenu.addSeparator(); _file_jmenu.add( _print_item = new JMenuItem( "Print..." ) ); _file_jmenu.addSeparator(); @@ -1779,6 +1775,7 @@ public final class MainFrameApplication extends MainFrame { customizeJMenuItem( _write_to_gif_item ); customizeJMenuItem( _write_to_tif_item ); customizeJMenuItem( _write_to_bmp_item ); + customizeJMenuItem( _write_to_eps_item ); customizeJMenuItem( _print_item ); customizeJMenuItem( _exit_item ); _jmenubar.add( _file_jmenu ); @@ -1834,6 +1831,11 @@ public final class MainFrameApplication extends MainFrame { _options_jmenu + .add( _show_abbreviated_labels_for_collapsed_nodes_cbmi = new JCheckBoxMenuItem( "Add Abbreviated Labels to Collapsed Subtrees" ) ); + + + + _options_jmenu .add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) ); @@ -1941,6 +1943,8 @@ public final class MainFrameApplication extends MainFrame { customizeCheckBoxMenuItem( _search_case_senstive_cbmi, getOptions().isSearchCaseSensitive() ); customizeCheckBoxMenuItem( _show_scale_cbmi, getOptions().isShowScale() ); customizeCheckBoxMenuItem( _collapsed_with_average_height_cbmi, getOptions().isCollapsedWithAverageHeigh() ); + customizeCheckBoxMenuItem( _show_abbreviated_labels_for_collapsed_nodes_cbmi, getOptions().isShowAbbreviatedLabelsForCollapsedNodes() ); + customizeRadioButtonMenuItem( _non_lined_up_cladograms_rbmi, getOptions().getCladogramType() == CLADOGRAM_TYPE.NON_LINED_UP ); customizeRadioButtonMenuItem( _ext_node_dependent_cladogram_rbmi,