git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2797 added constructor including embedded/standalone boolean
[jalview.git]
/
forester
/
java
/
src
/
org
/
forester
/
archaeopteryx
/
MainFrameApplication.java
diff --git
a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java
b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java
index
780dcc3
..
9a9c233
100644
(file)
--- 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.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;
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.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;
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 {
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;
// 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,11
@@
public final class MainFrameApplication extends MainFrame {
setSize( MainFrameApplication.FRAME_X_SIZE, MainFrameApplication.FRAME_Y_SIZE );
// The window listener
setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
setSize( MainFrameApplication.FRAME_X_SIZE, MainFrameApplication.FRAME_Y_SIZE );
// The window listener
setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
- addWindowListener( new WindowAdapter() {
+ addFrameListener( new FrameAdapter() {
@Override
@Override
- public void windowClosing( final WindowEvent e ) {
+ public void FrameClosing () {
+
exit();
}
} );
exit();
}
} );
@@
-181,15
+183,18
@@
public final class MainFrameApplication extends MainFrame {
_contentpane.repaint();
}
_contentpane.repaint();
}
+
+
private MainFrameApplication( final Phylogeny[] phys, final Configuration config, final String title ) {
this( phys, config, title, null );
}
private MainFrameApplication( final Phylogeny[] phys, final Configuration config, final String title ) {
this( phys, config, title, null );
}
-
- private MainFrameApplication( final Phylogeny[] phys,
+
+ private MainFrameApplication(final Phylogeny[] phys,
final Configuration config,
final String title,
final Configuration config,
final String title,
- final File current_dir ) {
- super();
+ final File current_dir,
+ final boolean isEmbedded) {
+ super(isEmbedded);
_configuration = config;
if ( _configuration == null ) {
throw new IllegalArgumentException( "configuration is null" );
_configuration = config;
if ( _configuration == null ) {
throw new IllegalArgumentException( "configuration is null" );
@@
-303,14
+308,16
@@
public final class MainFrameApplication extends MainFrame {
// } );
// The window listener
setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
// } );
// The window listener
setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
- addWindowListener( new WindowAdapter() {
+
+ addFrameListener( new FrameAdapter() {
@Override
@Override
- public void windowClosing( final WindowEvent e ) {
+ public void FrameClosing( ) {
+ if (MainFrameApplication.this.getParent() == null) {
if ( isUnsavedDataPresent() ) {
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;
JOptionPane.YES_NO_OPTION );
if ( r != JOptionPane.YES_OPTION ) {
return;
@@
-322,10
+329,10
@@
public final class MainFrameApplication extends MainFrame {
if ( r != JOptionPane.YES_OPTION ) {
return;
}
if ( r != JOptionPane.YES_OPTION ) {
return;
}
- }
+ }}
exit();
exit();
- }
- } );
+
+ } });
// The component listener
addComponentListener( new ComponentAdapter() {
// The component listener
addComponentListener( new ComponentAdapter() {
@@
-351,6
+358,14
@@
public final class MainFrameApplication extends MainFrame {
// ...and its children
_contentpane.repaint();
System.gc();
// ...and its children
_contentpane.repaint();
System.gc();
+
+ }
+
+ private MainFrameApplication( final Phylogeny[] phys,
+ final Configuration config,
+ final String title,
+ final File current_dir ) {
+ this(phys,config,title,current_dir,false);
}
private MainFrameApplication( final Phylogeny[] phys, final String config_file, final String title ) {
}
private MainFrameApplication( final Phylogeny[] phys, final String config_file, final String title ) {
@@
-516,12
+531,12
@@
public final class MainFrameApplication extends MainFrame {
msa = FastaParser.parseMsa( is );
}
else {
msa = FastaParser.parseMsa( is );
}
else {
- msa = GeneralMsaParser.parse( is );
+ msa = GeneralMsaParser.parseMsa( is );
}
}
catch ( final MsaFormatException e ) {
setArrowCursor();
}
}
catch ( final MsaFormatException e ) {
setArrowCursor();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Multiple sequence alignment format error",
JOptionPane.ERROR_MESSAGE );
e.getLocalizedMessage(),
"Multiple sequence alignment format error",
JOptionPane.ERROR_MESSAGE );
@@
-529,7
+544,7
@@
public final class MainFrameApplication extends MainFrame {
}
catch ( final IOException e ) {
setArrowCursor();
}
catch ( final IOException e ) {
setArrowCursor();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Failed to read multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
e.getLocalizedMessage(),
"Failed to read multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
@@
-537,7
+552,7
@@
public final class MainFrameApplication extends MainFrame {
}
catch ( final IllegalArgumentException e ) {
setArrowCursor();
}
catch ( final IllegalArgumentException e ) {
setArrowCursor();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
@@
-546,28
+561,28
@@
public final class MainFrameApplication extends MainFrame {
catch ( final Exception e ) {
setArrowCursor();
e.printStackTrace();
catch ( final Exception e ) {
setArrowCursor();
e.printStackTrace();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( ( msa == null ) || ( msa.getNumberOfSequences() < 1 ) ) {
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( ( msa == null ) || ( msa.getNumberOfSequences() < 1 ) ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Multiple sequence alignment is empty",
"Illegal Multiple Sequence Alignment",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( msa.getNumberOfSequences() < 4 ) {
"Multiple sequence alignment is empty",
"Illegal Multiple Sequence Alignment",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( msa.getNumberOfSequences() < 4 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Multiple sequence alignment needs to contain at least 3 sequences",
"Illegal multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( msa.getLength() < 2 ) {
"Multiple sequence alignment needs to contain at least 3 sequences",
"Illegal multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( msa.getLength() < 2 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Multiple sequence alignment needs to contain at least 2 residues",
"Illegal multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
"Multiple sequence alignment needs to contain at least 2 residues",
"Illegal multiple sequence alignment",
JOptionPane.ERROR_MESSAGE );
@@
-608,7
+623,7
@@
public final class MainFrameApplication extends MainFrame {
}
catch ( final MsaFormatException e ) {
setArrowCursor();
}
catch ( final MsaFormatException e ) {
setArrowCursor();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Multiple sequence file format error",
JOptionPane.ERROR_MESSAGE );
e.getLocalizedMessage(),
"Multiple sequence file format error",
JOptionPane.ERROR_MESSAGE );
@@
-616,7
+631,7
@@
public final class MainFrameApplication extends MainFrame {
}
catch ( final IOException e ) {
setArrowCursor();
}
catch ( final IOException e ) {
setArrowCursor();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Failed to read multiple sequence file",
JOptionPane.ERROR_MESSAGE );
e.getLocalizedMessage(),
"Failed to read multiple sequence file",
JOptionPane.ERROR_MESSAGE );
@@
-624,7
+639,7
@@
public final class MainFrameApplication extends MainFrame {
}
catch ( final IllegalArgumentException e ) {
setArrowCursor();
}
catch ( final IllegalArgumentException e ) {
setArrowCursor();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence file",
JOptionPane.ERROR_MESSAGE );
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence file",
JOptionPane.ERROR_MESSAGE );
@@
-633,21
+648,21
@@
public final class MainFrameApplication extends MainFrame {
catch ( final Exception e ) {
setArrowCursor();
e.printStackTrace();
catch ( final Exception e ) {
setArrowCursor();
e.printStackTrace();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence file",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( ( seqs == null ) || ( seqs.size() < 1 ) ) {
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence file",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( ( seqs == null ) || ( seqs.size() < 1 ) ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Multiple sequence file is empty",
"Illegal multiple sequence file",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( seqs.size() < 4 ) {
"Multiple sequence file is empty",
"Illegal multiple sequence file",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( seqs.size() < 4 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Multiple sequence file needs to contain at least 3 sequences",
"Illegal multiple sequence file",
JOptionPane.ERROR_MESSAGE );
"Multiple sequence file needs to contain at least 3 sequences",
"Illegal multiple sequence file",
JOptionPane.ERROR_MESSAGE );
@@
-668,7
+683,7
@@
public final class MainFrameApplication extends MainFrame {
private void addExpressionValuesFromFile() {
if ( ( getCurrentTreePanel() == null ) || ( getCurrentTreePanel().getPhylogeny() == null ) ) {
private void addExpressionValuesFromFile() {
if ( ( getCurrentTreePanel() == null ) || ( getCurrentTreePanel().getPhylogeny() == null ) ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Need to load evolutionary tree first",
"Can Not Read Expression Values",
JOptionPane.WARNING_MESSAGE );
"Need to load evolutionary tree first",
"Can Not Read Expression Values",
JOptionPane.WARNING_MESSAGE );
@@
-692,21
+707,21
@@
public final class MainFrameApplication extends MainFrame {
}
}
catch ( final IOException e ) {
}
}
catch ( final IOException e ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getMessage(),
"Could Not Read Expression Value Table",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( t.getNumberOfColumns() < 2 ) {
e.getMessage(),
"Could Not Read Expression Value Table",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( t.getNumberOfColumns() < 2 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Table contains " + t.getNumberOfColumns() + " column(s)",
"Problem with Expression Value Table",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( t.getNumberOfRows() < 1 ) {
"Table contains " + t.getNumberOfColumns() + " column(s)",
"Problem with Expression Value Table",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( t.getNumberOfRows() < 1 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Table contains zero rows",
"Problem with Expression Value Table",
JOptionPane.ERROR_MESSAGE );
"Table contains zero rows",
"Problem with Expression Value Table",
JOptionPane.ERROR_MESSAGE );
@@
-714,7
+729,7
@@
public final class MainFrameApplication extends MainFrame {
}
final Phylogeny phy = getCurrentTreePanel().getPhylogeny();
if ( t.getNumberOfRows() != phy.getNumberOfExternalNodes() ) {
}
final Phylogeny phy = getCurrentTreePanel().getPhylogeny();
if ( t.getNumberOfRows() != phy.getNumberOfExternalNodes() ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Table contains " + t.getNumberOfRows() + " rows, but tree contains "
+ phy.getNumberOfExternalNodes() + " external nodes",
"Warning",
"Table contains " + t.getNumberOfRows() + " rows, but tree contains "
+ phy.getNumberOfExternalNodes() + " external nodes",
"Warning",
@@
-731,7
+746,7
@@
public final class MainFrameApplication extends MainFrame {
row = t.findRow( node_name );
}
catch ( final IllegalArgumentException e ) {
row = t.findRow( node_name );
}
catch ( final IllegalArgumentException e ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getMessage(),
"Error Mapping Node Identifiers to Expression Value Identifiers",
JOptionPane.ERROR_MESSAGE );
e.getMessage(),
"Error Mapping Node Identifiers to Expression Value Identifiers",
JOptionPane.ERROR_MESSAGE );
@@
-750,7
+765,7
@@
public final class MainFrameApplication extends MainFrame {
d = Double.parseDouble( t.getValueAsString( col, row ) );
}
catch ( final NumberFormatException e ) {
d = Double.parseDouble( t.getValueAsString( col, row ) );
}
catch ( final NumberFormatException e ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Could not parse \"" + t.getValueAsString( col, row )
+ "\" into a decimal value",
"Issue with Expression Value Table",
"Could not parse \"" + t.getValueAsString( col, row )
+ "\" into a decimal value",
"Issue with Expression Value Table",
@@
-768,7
+783,7
@@
public final class MainFrameApplication extends MainFrame {
}
if ( not_found > 0 ) {
JOptionPane
}
if ( not_found > 0 ) {
JOptionPane
- .showMessageDialog( this,
+ .showMessageDialog( getThisFrame(),
"Could not fine expression values for " + not_found + " external node(s)",
"Warning",
JOptionPane.WARNING_MESSAGE );
"Could not fine expression values for " + not_found + " external node(s)",
"Warning",
JOptionPane.WARNING_MESSAGE );
@@
-779,7
+794,7
@@
public final class MainFrameApplication extends MainFrame {
private void addSequencesFromFile() {
if ( ( getCurrentTreePanel() == null ) || ( getCurrentTreePanel().getPhylogeny() == null ) ) {
private void addSequencesFromFile() {
if ( ( getCurrentTreePanel() == null ) || ( getCurrentTreePanel().getPhylogeny() == null ) ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Need to load evolutionary tree first",
"Can Not Read Sequences",
JOptionPane.WARNING_MESSAGE );
"Need to load evolutionary tree first",
"Can Not Read Sequences",
JOptionPane.WARNING_MESSAGE );
@@
-806,7
+821,7
@@
public final class MainFrameApplication extends MainFrame {
}
}
else {
}
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Format does not appear to be Fasta",
"Multiple sequence file format error",
JOptionPane.ERROR_MESSAGE );
"Format does not appear to be Fasta",
"Multiple sequence file format error",
JOptionPane.ERROR_MESSAGE );
@@
-821,7
+836,7
@@
public final class MainFrameApplication extends MainFrame {
}
catch ( final MsaFormatException e ) {
setArrowCursor();
}
catch ( final MsaFormatException e ) {
setArrowCursor();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Multiple sequence file format error",
JOptionPane.ERROR_MESSAGE );
e.getLocalizedMessage(),
"Multiple sequence file format error",
JOptionPane.ERROR_MESSAGE );
@@
-829,7
+844,7
@@
public final class MainFrameApplication extends MainFrame {
}
catch ( final IOException e ) {
setArrowCursor();
}
catch ( final IOException e ) {
setArrowCursor();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Failed to read multiple sequence file",
JOptionPane.ERROR_MESSAGE );
e.getLocalizedMessage(),
"Failed to read multiple sequence file",
JOptionPane.ERROR_MESSAGE );
@@
-838,14
+853,14
@@
public final class MainFrameApplication extends MainFrame {
catch ( final Exception e ) {
setArrowCursor();
e.printStackTrace();
catch ( final Exception e ) {
setArrowCursor();
e.printStackTrace();
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence file",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( ( seqs == null ) || ( seqs.size() < 1 ) ) {
e.getLocalizedMessage(),
"Unexpected error during reading of multiple sequence file",
JOptionPane.ERROR_MESSAGE );
return;
}
if ( ( seqs == null ) || ( seqs.size() < 1 ) ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Multiple sequence file is empty",
"Empty multiple sequence file",
JOptionPane.ERROR_MESSAGE );
"Multiple sequence file is empty",
"Empty multiple sequence file",
JOptionPane.ERROR_MESSAGE );
@@
-875,7
+890,7
@@
public final class MainFrameApplication extends MainFrame {
nodes = phy.getNodes( seq_name );
}
if ( nodes.size() > 1 ) {
nodes = phy.getNodes( seq_name );
}
if ( nodes.size() > 1 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Sequence name \"" + seq_name + "\" is not unique",
"Sequence name not unique",
JOptionPane.ERROR_MESSAGE );
"Sequence name \"" + seq_name + "\" is not unique",
"Sequence name not unique",
JOptionPane.ERROR_MESSAGE );
@@
-893,7
+908,7
@@
public final class MainFrameApplication extends MainFrame {
nodes = phy.getNodes( seq_name_split );
}
if ( nodes.size() > 1 ) {
nodes = phy.getNodes( seq_name_split );
}
if ( nodes.size() > 1 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Split sequence name \"" + seq_name_split
+ "\" is not unique",
"Sequence name not unique",
"Split sequence name \"" + seq_name_split
+ "\" is not unique",
"Sequence name not unique",
@@
-935,13
+950,13
@@
public final class MainFrameApplication extends MainFrame {
+ " external nodes now have a molecular sequence attached to them.";
}
if ( ( attached_counter == total_counter ) && ( ext_nodes == ext_nodes_with_seq ) ) {
+ " external nodes now have a molecular sequence attached to them.";
}
if ( ( attached_counter == total_counter ) && ( ext_nodes == ext_nodes_with_seq ) ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Attached all " + total_counter + " sequences to tree nodes.\n" + s,
"All sequences attached",
JOptionPane.INFORMATION_MESSAGE );
}
else {
"Attached all " + total_counter + " sequences to tree nodes.\n" + s,
"All sequences attached",
JOptionPane.INFORMATION_MESSAGE );
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Attached " + attached_counter + " sequences out of a total of "
+ total_counter + " sequences.\n" + s,
attached_counter + " sequences attached",
"Attached " + attached_counter + " sequences out of a total of "
+ total_counter + " sequences.\n" + s,
attached_counter + " sequences attached",
@@
-949,7
+964,7
@@
public final class MainFrameApplication extends MainFrame {
}
}
else {
}
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"No maching tree node for any of the " + total_counter + " sequences",
"Could not attach any sequences",
JOptionPane.ERROR_MESSAGE );
"No maching tree node for any of the " + total_counter + " sequences",
"Could not attach any sequences",
JOptionPane.ERROR_MESSAGE );
@@
-960,7
+975,7
@@
public final class MainFrameApplication extends MainFrame {
private void closeCurrentPane() {
if ( getMainPanel().getCurrentTreePanel() != null ) {
if ( getMainPanel().getCurrentTreePanel().isEdited() ) {
private void closeCurrentPane() {
if ( getMainPanel().getCurrentTreePanel() != null ) {
if ( getMainPanel().getCurrentTreePanel().isEdited() ) {
- final int r = JOptionPane.showConfirmDialog( this,
+ final int r = JOptionPane.showConfirmDialog( getThisFrame(),
"Close tab despite potentially unsaved changes?",
"Close Tab?",
JOptionPane.YES_NO_OPTION );
"Close tab despite potentially unsaved changes?",
"Close Tab?",
JOptionPane.YES_NO_OPTION );
@@
-1018,7
+1033,7
@@
public final class MainFrameApplication extends MainFrame {
repaint();
}
if ( to_be_removed.size() > 0 ) {
repaint();
}
if ( to_be_removed.size() > 0 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Collapsed " + to_be_removed.size()
+ " branches with\nconfidence values below "
+ getMinNotCollapseConfidenceValue(),
"Collapsed " + to_be_removed.size()
+ " branches with\nconfidence values below "
+ getMinNotCollapseConfidenceValue(),
@@
-1026,7
+1041,7
@@
public final class MainFrameApplication extends MainFrame {
JOptionPane.INFORMATION_MESSAGE );
}
else {
JOptionPane.INFORMATION_MESSAGE );
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"No branch collapsed,\nminimum confidence value per branch is "
+ min_support,
"No branch collapsed",
"No branch collapsed,\nminimum confidence value per branch is "
+ min_support,
"No branch collapsed",
@@
-1034,7
+1049,7
@@
public final class MainFrameApplication extends MainFrame {
}
}
else {
}
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"No branch collapsed because no confidence values present",
"No confidence values present",
JOptionPane.INFORMATION_MESSAGE );
"No branch collapsed because no confidence values present",
"No confidence values present",
JOptionPane.INFORMATION_MESSAGE );
@@
-1045,7
+1060,7
@@
public final class MainFrameApplication extends MainFrame {
if ( getCurrentTreePanel() != null ) {
final Phylogeny phy = getCurrentTreePanel().getPhylogeny();
if ( ( phy != null ) && !phy.isEmpty() ) {
if ( getCurrentTreePanel() != null ) {
final Phylogeny phy = getCurrentTreePanel().getPhylogeny();
if ( ( phy != null ) && !phy.isEmpty() ) {
- final String s = ( String ) JOptionPane.showInputDialog( this,
+ final String s = ( String ) JOptionPane.showInputDialog( getThisFrame(),
"Please enter the minimum branch length value\n",
"Minimal Branch Length Value",
JOptionPane.QUESTION_MESSAGE,
"Please enter the minimum branch length value\n",
"Minimal Branch Length Value",
JOptionPane.QUESTION_MESSAGE,
@@
-1080,7
+1095,7
@@
public final class MainFrameApplication extends MainFrame {
if ( getCurrentTreePanel() != null ) {
final Phylogeny phy = getCurrentTreePanel().getPhylogeny();
if ( ( phy != null ) && !phy.isEmpty() ) {
if ( getCurrentTreePanel() != null ) {
final Phylogeny phy = getCurrentTreePanel().getPhylogeny();
if ( ( phy != null ) && !phy.isEmpty() ) {
- final String s = ( String ) JOptionPane.showInputDialog( this,
+ final String s = ( String ) JOptionPane.showInputDialog( getThisFrame(),
"Please enter the minimum confidence value\n",
"Minimal Confidence Value",
JOptionPane.QUESTION_MESSAGE,
"Please enter the minimum confidence value\n",
"Minimal Confidence Value",
JOptionPane.QUESTION_MESSAGE,
@@
-1150,7
+1165,7
@@
public final class MainFrameApplication extends MainFrame {
repaint();
}
if ( to_be_removed.size() > 0 ) {
repaint();
}
if ( to_be_removed.size() > 0 ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Collapsed " + to_be_removed.size()
+ " branches with\nbranch length values below "
+ getMinNotCollapseBlValue(),
"Collapsed " + to_be_removed.size()
+ " branches with\nbranch length values below "
+ getMinNotCollapseBlValue(),
@@
-1158,14
+1173,14
@@
public final class MainFrameApplication extends MainFrame {
JOptionPane.INFORMATION_MESSAGE );
}
else {
JOptionPane.INFORMATION_MESSAGE );
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"No branch collapsed,\nminimum branch length is " + min_bl,
"No branch collapsed",
JOptionPane.INFORMATION_MESSAGE );
}
}
else {
"No branch collapsed,\nminimum branch length is " + min_bl,
"No branch collapsed",
JOptionPane.INFORMATION_MESSAGE );
}
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"No branch collapsed because no branch length values present",
"No branch length values present",
JOptionPane.INFORMATION_MESSAGE );
"No branch collapsed because no branch length values present",
"No branch length values present",
JOptionPane.INFORMATION_MESSAGE );
@@
-1179,7
+1194,7
@@
public final class MainFrameApplication extends MainFrame {
xml_parser = PhyloXmlParser.createPhyloXmlParserXsdValidating();
}
catch ( final Exception e ) {
xml_parser = PhyloXmlParser.createPhyloXmlParserXsdValidating();
}
catch ( final Exception e ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
e.getLocalizedMessage(),
"failed to create validating XML parser",
JOptionPane.WARNING_MESSAGE );
e.getLocalizedMessage(),
"failed to create validating XML parser",
JOptionPane.WARNING_MESSAGE );
@@
-1206,7
+1221,7
@@
public final class MainFrameApplication extends MainFrame {
new Thread( inferrer ).start();
}
else {
new Thread( inferrer ).start();
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"No multiple sequence alignment selected",
"Phylogenetic Inference Not Launched",
JOptionPane.WARNING_MESSAGE );
"No multiple sequence alignment selected",
"Phylogenetic Inference Not Launched",
JOptionPane.WARNING_MESSAGE );
@@
-1221,7
+1236,7
@@
public final class MainFrameApplication extends MainFrame {
new Thread( inferrer ).start();
}
else {
new Thread( inferrer ).start();
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"No input sequences selected",
"Phylogenetic Inference Not Launched",
JOptionPane.WARNING_MESSAGE );
"No input sequences selected",
"Phylogenetic Inference Not Launched",
JOptionPane.WARNING_MESSAGE );
@@
-1273,7
+1288,7
@@
public final class MainFrameApplication extends MainFrame {
failed = "\nCould not extract taxonomic data for " + counter_failed + " named external nodes:\n"
+ sb_failed;
}
failed = "\nCould not extract taxonomic data for " + counter_failed + " named external nodes:\n"
+ sb_failed;
}
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Extracted taxonomic data from " + all + counter
+ " named external nodes:\n" + sb.toString() + failed,
"Taxonomic Data Extraction Completed",
"Extracted taxonomic data from " + all + counter
+ " named external nodes:\n" + sb.toString() + failed,
"Taxonomic Data Extraction Completed",
@@
-1281,7
+1296,7
@@
public final class MainFrameApplication extends MainFrame {
: JOptionPane.INFORMATION_MESSAGE );
}
else {
: JOptionPane.INFORMATION_MESSAGE );
}
else {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Could not extract any taxonomic data.\nMaybe node names are empty\n"
+ "or not in the forms \"XYZ_CAEEL\", \"XYZ_6239\", or \"XYZ_Caenorhabditis_elegans\"\n"
+ "or nodes already have taxonomic data?\n",
"Could not extract any taxonomic data.\nMaybe node names are empty\n"
+ "or not in the forms \"XYZ_CAEEL\", \"XYZ_6239\", or \"XYZ_Caenorhabditis_elegans\"\n"
+ "or nodes already have taxonomic data?\n",
@@
-1545,7
+1560,7
@@
public final class MainFrameApplication extends MainFrame {
getMainPanel() );
_mainpanel.getControlPanel().showWhole();
if ( nhx_or_nexus && one_desc ) {
getMainPanel() );
_mainpanel.getControlPanel().showWhole();
if ( nhx_or_nexus && one_desc ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"One or more trees contain (a) node(s) with one descendant, "
+ ForesterUtil.LINE_SEPARATOR
+ "possibly indicating illegal parentheses within node names.",
"One or more trees contain (a) node(s) with one descendant, "
+ ForesterUtil.LINE_SEPARATOR
+ "possibly indicating illegal parentheses within node names.",
@@
-1607,7
+1622,7
@@
public final class MainFrameApplication extends MainFrame {
if ( !exception && ( t != null ) && !t.isRooted() ) {
exception = true;
t = null;
if ( !exception && ( t != null ) && !t.isRooted() ) {
exception = true;
t = null;
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Species tree is not rooted",
"Species tree not loaded",
JOptionPane.ERROR_MESSAGE );
"Species tree is not rooted",
"Species tree not loaded",
JOptionPane.ERROR_MESSAGE );
@@
-1619,7
+1634,7
@@
public final class MainFrameApplication extends MainFrame {
if ( !node.getNodeData().isHasTaxonomy() ) {
exception = true;
t = null;
if ( !node.getNodeData().isHasTaxonomy() ) {
exception = true;
t = null;
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Species tree contains external node(s) without taxonomy information",
"Species tree not loaded",
JOptionPane.ERROR_MESSAGE );
"Species tree contains external node(s) without taxonomy information",
"Species tree not loaded",
JOptionPane.ERROR_MESSAGE );
@@
-1630,7
+1645,7
@@
public final class MainFrameApplication extends MainFrame {
exception = true;
t = null;
JOptionPane
exception = true;
t = null;
JOptionPane
- .showMessageDialog( this,
+ .showMessageDialog( getThisFrame(),
"Taxonomy [" + node.getNodeData().getTaxonomy().asSimpleText()
+ "] is not unique in species tree",
"Species tree not loaded",
"Taxonomy [" + node.getNodeData().getTaxonomy().asSimpleText()
+ "] is not unique in species tree",
"Species tree not loaded",
@@
-1645,7
+1660,7
@@
public final class MainFrameApplication extends MainFrame {
}
if ( !exception && ( t != null ) ) {
setSpeciesTree( t );
}
if ( !exception && ( t != null ) ) {
setSpeciesTree( t );
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Species tree successfully loaded",
"Species tree loaded",
JOptionPane.INFORMATION_MESSAGE );
"Species tree successfully loaded",
"Species tree loaded",
JOptionPane.INFORMATION_MESSAGE );
@@
-2091,7
+2106,7
@@
public final class MainFrameApplication extends MainFrame {
@Override
void close() {
if ( isUnsavedDataPresent() ) {
@Override
void close() {
if ( isUnsavedDataPresent() ) {
- final int r = JOptionPane.showConfirmDialog( this,
+ final int r = JOptionPane.showConfirmDialog( getThisFrame(),
"Exit despite potentially unsaved changes?",
"Exit?",
JOptionPane.YES_NO_OPTION );
"Exit despite potentially unsaved changes?",
"Exit?",
JOptionPane.YES_NO_OPTION );
@@
-2116,7
+2131,7
@@
public final class MainFrameApplication extends MainFrame {
Phylogeny[] phys = null;
final String message = "Please enter a complete URL, for example \"http://purl.org/phylo/treebase/phylows/study/TB2:S15480?format=nexus\"";
final String url_string = JOptionPane
Phylogeny[] phys = null;
final String message = "Please enter a complete URL, for example \"http://purl.org/phylo/treebase/phylows/study/TB2:S15480?format=nexus\"";
final String url_string = JOptionPane
- .showInputDialog( this,
+ .showInputDialog( getThisFrame(),
message,
"Use URL/webservice to obtain a phylogeny",
JOptionPane.QUESTION_MESSAGE );
message,
"Use URL/webservice to obtain a phylogeny",
JOptionPane.QUESTION_MESSAGE );
@@
-2149,20
+2164,20
@@
public final class MainFrameApplication extends MainFrame {
phys = factory.create( url.openStream(), parser );
}
catch ( final MalformedURLException e ) {
phys = factory.create( url.openStream(), parser );
}
catch ( final MalformedURLException e ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Malformed URL: " + url + "\n" + e.getLocalizedMessage(),
"Malformed URL",
JOptionPane.ERROR_MESSAGE );
}
catch ( final IOException e ) {
"Malformed URL: " + url + "\n" + e.getLocalizedMessage(),
"Malformed URL",
JOptionPane.ERROR_MESSAGE );
}
catch ( final IOException e ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
"Could not read from " + url + "\n"
+ ForesterUtil.wordWrap( e.getLocalizedMessage(), 80 ),
"Failed to read URL",
JOptionPane.ERROR_MESSAGE );
}
catch ( final Exception e ) {
"Could not read from " + url + "\n"
+ ForesterUtil.wordWrap( e.getLocalizedMessage(), 80 ),
"Failed to read URL",
JOptionPane.ERROR_MESSAGE );
}
catch ( final Exception e ) {
- JOptionPane.showMessageDialog( this,
+ JOptionPane.showMessageDialog( getThisFrame(),
ForesterUtil.wordWrap( e.getLocalizedMessage(), 80 ),
"Unexpected Exception",
JOptionPane.ERROR_MESSAGE );
ForesterUtil.wordWrap( e.getLocalizedMessage(), 80 ),
"Unexpected Exception",
JOptionPane.ERROR_MESSAGE );