From: cmzmasek@gmail.com Date: Wed, 20 Apr 2011 22:27:40 +0000 (+0000) Subject: refactored X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0f295917c869b17a9322af3e738e3527ba9b31d4;p=jalview.git refactored --- diff --git a/forester/java/src/org/forester/archaeopteryx/Configuration.java b/forester/java/src/org/forester/archaeopteryx/Configuration.java index 12e108f..0e6b05f 100644 --- a/forester/java/src/org/forester/archaeopteryx/Configuration.java +++ b/forester/java/src/org/forester/archaeopteryx/Configuration.java @@ -464,7 +464,7 @@ public final class Configuration { return _graphics_export_y; } - int getDefaultBootstrapSamples() { + public int getDefaultBootstrapSamples() { return _default_bootstrap_samples; } diff --git a/forester/java/src/org/forester/archaeopteryx/Constants.java b/forester/java/src/org/forester/archaeopteryx/Constants.java index e388a7a..05ae5ac 100644 --- a/forester/java/src/org/forester/archaeopteryx/Constants.java +++ b/forester/java/src/org/forester/archaeopteryx/Constants.java @@ -37,9 +37,9 @@ import org.forester.util.ForesterConstants; public final class Constants { final static boolean __ALLOW_PHYLOGENETIC_INFERENCE = true; - final static boolean __RELEASE = false; // TODO remove me - final static boolean __SNAPSHOT_RELEASE = false; // TODO remove me - final static String PRG_NAME = "Archaeopteryx"; + public final static boolean __RELEASE = false; // TODO remove me + public final static boolean __SNAPSHOT_RELEASE = false; // TODO remove me + public final static String PRG_NAME = "Archaeopteryx"; final static String VERSION = "0.960 beta A48"; final static String PRG_DATE = "2011.03.09"; final static String DEFAULT_CONFIGURATION_FILE_NAME = "_aptx_configuration_file"; diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrame.java b/forester/java/src/org/forester/archaeopteryx/MainFrame.java index 6cb8d5b..13426a3 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrame.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrame.java @@ -659,7 +659,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { } } - Configuration getConfiguration() { + public Configuration getConfiguration() { return _configuration; } @@ -794,7 +794,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { _circular_type_cbmi.setSelected( false ); } - void showWhole() { + public void showWhole() { _mainpanel.getControlPanel().showWhole(); } diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index e5195c4..eea852c 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -62,6 +62,13 @@ 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.archaeopteryx.tools.AncestralTaxonomyInferrer; +import org.forester.archaeopteryx.tools.GoAnnotation; +import org.forester.archaeopteryx.tools.PhyloInferenceDialog; +import org.forester.archaeopteryx.tools.PhylogeneticInferenceOptions; +import org.forester.archaeopteryx.tools.PhylogeneticInferrer; +import org.forester.archaeopteryx.tools.TaxonomyDataObtainer; +import org.forester.archaeopteryx.tools.UniProtSequenceObtainer; import org.forester.archaeopteryx.webservices.PhylogeniesWebserviceClient; import org.forester.archaeopteryx.webservices.WebservicesManager; import org.forester.io.parsers.FastaParser; @@ -1106,9 +1113,9 @@ public final class MainFrameApplication extends MainFrame { if ( ( _mainpanel.getCurrentPhylogeny() == null ) || ( _mainpanel.getCurrentPhylogeny().isEmpty() ) ) { return; } - final MainPanelEdit a = new MainPanelEdit( this, - _mainpanel.getCurrentTreePanel(), - _mainpanel.getCurrentPhylogeny() ); + final GoAnnotation a = new GoAnnotation( this, + _mainpanel.getCurrentTreePanel(), + _mainpanel.getCurrentPhylogeny() ); new Thread( a ).start(); } @@ -1289,7 +1296,7 @@ public final class MainFrameApplication extends MainFrame { } @Override - MainPanel getMainPanel() { + public MainPanel getMainPanel() { return _mainpanel; } @@ -1731,7 +1738,7 @@ public final class MainFrameApplication extends MainFrame { System.gc(); } - void readSeqsFromFile() { + public void readSeqsFromFile() { // Set an initial directory if none set yet final File my_dir = getCurrentDir(); _seqs_filechooser.setMultiSelectionEnabled( false ); @@ -1838,7 +1845,7 @@ public final class MainFrameApplication extends MainFrame { } } - void readMsaFromFile() { + public void readMsaFromFile() { // Set an initial directory if none set yet final File my_dir = getCurrentDir(); _msa_filechooser.setMultiSelectionEnabled( false ); @@ -2501,7 +2508,7 @@ public final class MainFrameApplication extends MainFrame { return _phylogenetic_inference_options; } - Msa getMsa() { + public Msa getMsa() { return _msa; } @@ -2513,11 +2520,11 @@ public final class MainFrameApplication extends MainFrame { _msa_file = msa_file; } - File getMsaFile() { + public File getMsaFile() { return _msa_file; } - List getSeqs() { + public List getSeqs() { return _seqs; } @@ -2529,7 +2536,7 @@ public final class MainFrameApplication extends MainFrame { _seqs_file = seqs_file; } - File getSeqsFile() { + public File getSeqsFile() { return _seqs_file; } } // MainFrameApplication. diff --git a/forester/java/src/org/forester/archaeopteryx/MainPanel.java b/forester/java/src/org/forester/archaeopteryx/MainPanel.java index 17335bd..6044baf 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainPanel.java +++ b/forester/java/src/org/forester/archaeopteryx/MainPanel.java @@ -85,10 +85,10 @@ public class MainPanel extends JPanel implements ComponentListener { getControlPanel().showWhole(); } - void addPhylogenyInNewTab( final Phylogeny phy, - final Configuration config, - final String default_name, - final String full_path ) { + public void addPhylogenyInNewTab( final Phylogeny phy, + final Configuration config, + final String default_name, + final String full_path ) { final TreePanel treepanel = new TreePanel( phy, config, this ); getControlPanel().phylogenyAdded( config ); treepanel.setControlPanel( getControlPanel() ); @@ -261,7 +261,7 @@ public class MainPanel extends JPanel implements ComponentListener { } } - TreePanel getCurrentTreePanel() { + public TreePanel getCurrentTreePanel() { final int selected = getTabbedPane().getSelectedIndex(); if ( selected >= 0 ) { return _treepanels.get( selected ); diff --git a/forester/java/src/org/forester/archaeopteryx/NodeEditPanel.java b/forester/java/src/org/forester/archaeopteryx/NodeEditPanel.java index 9780d25..81e869d 100644 --- a/forester/java/src/org/forester/archaeopteryx/NodeEditPanel.java +++ b/forester/java/src/org/forester/archaeopteryx/NodeEditPanel.java @@ -48,6 +48,7 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath; import javax.swing.tree.TreeSelectionModel; +import org.forester.archaeopteryx.tools.ImageLoader; import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException; import org.forester.phylogeny.PhylogenyNode; import org.forester.phylogeny.data.Accession; diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index e1bcfb7..00620cc 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -95,6 +95,8 @@ import org.forester.archaeopteryx.Options.NODE_LABEL_DIRECTION; import org.forester.archaeopteryx.Options.PHYLOGENY_GRAPHICS_TYPE; import org.forester.archaeopteryx.phylogeny.data.RenderableDomainArchitecture; import org.forester.archaeopteryx.phylogeny.data.RenderableVector; +import org.forester.archaeopteryx.tools.Blast; +import org.forester.archaeopteryx.tools.ImageLoader; import org.forester.io.parsers.phyloxml.PhyloXmlUtil; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyMethods; @@ -1097,7 +1099,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee * * @return a pointer to the phylogeny */ - final Phylogeny getPhylogeny() { + public final Phylogeny getPhylogeny() { return _phylogeny; } @@ -4108,7 +4110,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee setPreferredSize( new Dimension( x, y ) ); } - final void setArrowCursor() { + public final void setArrowCursor() { setCursor( ARROW_CURSOR ); repaint(); } @@ -4125,7 +4127,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee getMainPanel().setCutOrCopiedTree( cut_or_copied_tree ); } - final void setEdited( final boolean edited ) { + public final void setEdited( final boolean edited ) { _edited = edited; } @@ -4323,7 +4325,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee * @param t * an instance of a Phylogeny */ - final void setTree( final Phylogeny t ) { + public final void setTree( final Phylogeny t ) { _nodes_in_preorder = null; _phylogeny = t; } @@ -4358,7 +4360,7 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee _urt_factor_ov = urt_factor_ov; } - final void setWaitCursor() { + public final void setWaitCursor() { setCursor( WAIT_CURSOR ); repaint(); } @@ -4877,11 +4879,11 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee } } - synchronized void setImageMap( final Hashtable image_map ) { + public synchronized void setImageMap( final Hashtable image_map ) { getMainPanel().setImageMap( image_map ); } - synchronized Hashtable getImageMap() { + public synchronized Hashtable getImageMap() { return getMainPanel().getImageMap(); } } diff --git a/forester/java/src/org/forester/archaeopteryx/Util.java b/forester/java/src/org/forester/archaeopteryx/Util.java index 91e36b1..408a3d7 100644 --- a/forester/java/src/org/forester/archaeopteryx/Util.java +++ b/forester/java/src/org/forester/archaeopteryx/Util.java @@ -70,7 +70,7 @@ import org.forester.phylogeny.iterators.PreorderTreeIterator; import org.forester.util.DescriptiveStatistics; import org.forester.util.ForesterUtil; -final class Util { +public final class Util { private final static String[] AVAILABLE_FONT_FAMILIES_SORTED = GraphicsEnvironment.getLocalGraphicsEnvironment() .getAvailableFontFamilyNames(); @@ -614,7 +614,7 @@ final class Util { System.out.println( "[" + applet_name + "] > " + message ); } - final static void printWarningMessage( final String name, final String message ) { + public final static void printWarningMessage( final String name, final String message ) { System.out.println( "[" + name + "] > " + message ); } diff --git a/forester/java/src/org/forester/archaeopteryx/AncestralTaxonomyInferrer.java b/forester/java/src/org/forester/archaeopteryx/tools/AncestralTaxonomyInferrer.java similarity index 95% rename from forester/java/src/org/forester/archaeopteryx/AncestralTaxonomyInferrer.java rename to forester/java/src/org/forester/archaeopteryx/tools/AncestralTaxonomyInferrer.java index c7388c4..fbcc0bf 100644 --- a/forester/java/src/org/forester/archaeopteryx/AncestralTaxonomyInferrer.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/AncestralTaxonomyInferrer.java @@ -23,7 +23,7 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.net.UnknownHostException; import java.util.SortedSet; @@ -31,6 +31,8 @@ import java.util.SortedSet; import javax.swing.JOptionPane; import org.forester.analysis.AncestralTaxonomyInference; +import org.forester.archaeopteryx.MainFrameApplication; +import org.forester.archaeopteryx.TreePanel; import org.forester.phylogeny.Phylogeny; import org.forester.ws.uniprot.UniProtWsTools; @@ -40,7 +42,7 @@ public class AncestralTaxonomyInferrer implements Runnable { private final MainFrameApplication _mf; private final TreePanel _treepanel; - AncestralTaxonomyInferrer( final MainFrameApplication mf, final TreePanel treepanel, final Phylogeny phy ) { + public AncestralTaxonomyInferrer( final MainFrameApplication mf, final TreePanel treepanel, final Phylogeny phy ) { _phy = phy; _mf = mf; _treepanel = treepanel; diff --git a/forester/java/src/org/forester/archaeopteryx/Blast.java b/forester/java/src/org/forester/archaeopteryx/tools/Blast.java similarity index 98% rename from forester/java/src/org/forester/archaeopteryx/Blast.java rename to forester/java/src/org/forester/archaeopteryx/tools/Blast.java index 600eb04..5bfc31e 100644 --- a/forester/java/src/org/forester/archaeopteryx/Blast.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/Blast.java @@ -23,7 +23,7 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.io.IOException; import java.util.Arrays; @@ -38,7 +38,7 @@ public class Blast { public Blast() { } - void go( final String geneName ) { + public void go( final String geneName ) { // Retrieve accession number list which has specified gene name from searchByXMLPath of ARSA. Please click here for details of ARSA. /*target: Sequence length is between 300bp and 1000bp. Feature key is CDS. diff --git a/forester/java/src/org/forester/archaeopteryx/MainPanelEdit.java b/forester/java/src/org/forester/archaeopteryx/tools/GoAnnotation.java similarity index 95% rename from forester/java/src/org/forester/archaeopteryx/MainPanelEdit.java rename to forester/java/src/org/forester/archaeopteryx/tools/GoAnnotation.java index 0728da1..6ca6a2f 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainPanelEdit.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/GoAnnotation.java @@ -23,7 +23,7 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.io.BufferedReader; import java.io.IOException; @@ -33,6 +33,8 @@ import java.net.URL; import java.util.Arrays; import java.util.List; +import org.forester.archaeopteryx.MainFrameApplication; +import org.forester.archaeopteryx.TreePanel; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyNode; import org.forester.phylogeny.data.Accession; @@ -41,7 +43,7 @@ import org.forester.phylogeny.data.Sequence; import org.forester.phylogeny.iterators.PhylogenyNodeIterator; import org.forester.util.ForesterUtil; -public class MainPanelEdit implements Runnable { +public class GoAnnotation implements Runnable { private static final String SYMBOL = "Symbol"; private static final String ASPECT = "Aspect"; @@ -53,7 +55,7 @@ public class MainPanelEdit implements Runnable { private final MainFrameApplication _mf; private final TreePanel _treepanel; - MainPanelEdit( final MainFrameApplication mf, final TreePanel treepanel, final Phylogeny phy ) { + public GoAnnotation( final MainFrameApplication mf, final TreePanel treepanel, final Phylogeny phy ) { _phy = phy; _mf = mf; _treepanel = treepanel; diff --git a/forester/java/src/org/forester/archaeopteryx/ImageLoader.java b/forester/java/src/org/forester/archaeopteryx/tools/ImageLoader.java similarity index 96% rename from forester/java/src/org/forester/archaeopteryx/ImageLoader.java rename to forester/java/src/org/forester/archaeopteryx/tools/ImageLoader.java index 2618943..f3e9aa9 100644 --- a/forester/java/src/org/forester/archaeopteryx/ImageLoader.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/ImageLoader.java @@ -23,7 +23,7 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.awt.image.BufferedImage; import java.io.IOException; @@ -34,6 +34,9 @@ import java.util.List; import javax.imageio.ImageIO; +import org.forester.archaeopteryx.Constants; +import org.forester.archaeopteryx.TreePanel; +import org.forester.archaeopteryx.Util; import org.forester.phylogeny.PhylogenyNode; import org.forester.phylogeny.data.Taxonomy; import org.forester.phylogeny.data.Uri; diff --git a/forester/java/src/org/forester/archaeopteryx/PhyloInferenceDialog.java b/forester/java/src/org/forester/archaeopteryx/tools/PhyloInferenceDialog.java similarity index 99% rename from forester/java/src/org/forester/archaeopteryx/PhyloInferenceDialog.java rename to forester/java/src/org/forester/archaeopteryx/tools/PhyloInferenceDialog.java index 0b99bf8..767a417 100644 --- a/forester/java/src/org/forester/archaeopteryx/PhyloInferenceDialog.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/PhyloInferenceDialog.java @@ -23,7 +23,7 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.awt.Color; import java.awt.FlowLayout; @@ -45,6 +45,8 @@ import javax.swing.JTextField; import javax.swing.border.Border; import javax.swing.border.LineBorder; +import org.forester.archaeopteryx.MainFrameApplication; +import org.forester.archaeopteryx.Util; import org.forester.evoinference.distance.PairwiseDistanceCalculator.PWD_DISTANCE_METHOD; import org.forester.sequence.Sequence; import org.forester.util.BasicDescriptiveStatistics; diff --git a/forester/java/src/org/forester/archaeopteryx/PhylogeneticInferenceOptions.java b/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferenceOptions.java similarity index 99% rename from forester/java/src/org/forester/archaeopteryx/PhylogeneticInferenceOptions.java rename to forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferenceOptions.java index caf26f1..b1ea597 100644 --- a/forester/java/src/org/forester/archaeopteryx/PhylogeneticInferenceOptions.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferenceOptions.java @@ -24,10 +24,11 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.io.File; +import org.forester.archaeopteryx.Configuration; import org.forester.evoinference.distance.PairwiseDistanceCalculator.PWD_DISTANCE_METHOD; import org.forester.msa.Mafft; diff --git a/forester/java/src/org/forester/archaeopteryx/PhylogeneticInferrer.java b/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java similarity index 99% rename from forester/java/src/org/forester/archaeopteryx/PhylogeneticInferrer.java rename to forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java index 613d883..c5fa04d 100644 --- a/forester/java/src/org/forester/archaeopteryx/PhylogeneticInferrer.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/PhylogeneticInferrer.java @@ -23,7 +23,7 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.io.BufferedWriter; import java.io.File; @@ -34,6 +34,7 @@ import java.util.List; import javax.swing.JOptionPane; +import org.forester.archaeopteryx.MainFrameApplication; import org.forester.evoinference.distance.NeighborJoining; import org.forester.evoinference.distance.PairwiseDistanceCalculator; import org.forester.evoinference.matrix.distance.BasicSymmetricalDistanceMatrix; diff --git a/forester/java/src/org/forester/archaeopteryx/TaxonomyDataObtainer.java b/forester/java/src/org/forester/archaeopteryx/tools/TaxonomyDataObtainer.java similarity index 95% rename from forester/java/src/org/forester/archaeopteryx/TaxonomyDataObtainer.java rename to forester/java/src/org/forester/archaeopteryx/tools/TaxonomyDataObtainer.java index cab948a..17d871b 100644 --- a/forester/java/src/org/forester/archaeopteryx/TaxonomyDataObtainer.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/TaxonomyDataObtainer.java @@ -24,7 +24,7 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.io.IOException; import java.net.UnknownHostException; @@ -33,6 +33,8 @@ import java.util.SortedSet; import javax.swing.JOptionPane; import org.forester.analysis.AncestralTaxonomyInference; +import org.forester.archaeopteryx.MainFrameApplication; +import org.forester.archaeopteryx.TreePanel; import org.forester.phylogeny.Phylogeny; import org.forester.ws.uniprot.UniProtWsTools; @@ -42,7 +44,7 @@ public class TaxonomyDataObtainer implements Runnable { private final MainFrameApplication _mf; private final TreePanel _treepanel; - TaxonomyDataObtainer( final MainFrameApplication mf, final TreePanel treepanel, final Phylogeny phy ) { + public TaxonomyDataObtainer( final MainFrameApplication mf, final TreePanel treepanel, final Phylogeny phy ) { _phy = phy; _mf = mf; _treepanel = treepanel; diff --git a/forester/java/src/org/forester/archaeopteryx/UniProtSequenceObtainer.java b/forester/java/src/org/forester/archaeopteryx/tools/UniProtSequenceObtainer.java similarity index 96% rename from forester/java/src/org/forester/archaeopteryx/UniProtSequenceObtainer.java rename to forester/java/src/org/forester/archaeopteryx/tools/UniProtSequenceObtainer.java index fa5ae63..8bea209 100644 --- a/forester/java/src/org/forester/archaeopteryx/UniProtSequenceObtainer.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/UniProtSequenceObtainer.java @@ -23,7 +23,7 @@ // Contact: phylosoft @ gmail . com // WWW: www.phylosoft.org/forester -package org.forester.archaeopteryx; +package org.forester.archaeopteryx.tools; import java.io.IOException; import java.net.UnknownHostException; @@ -33,6 +33,8 @@ import java.util.TreeSet; import javax.swing.JOptionPane; +import org.forester.archaeopteryx.MainFrameApplication; +import org.forester.archaeopteryx.TreePanel; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyNode; import org.forester.phylogeny.data.Accession; @@ -50,7 +52,7 @@ public class UniProtSequenceObtainer implements Runnable { private final MainFrameApplication _mf; private final TreePanel _treepanel; - UniProtSequenceObtainer( final MainFrameApplication mf, final TreePanel treepanel, final Phylogeny phy ) { + public UniProtSequenceObtainer( final MainFrameApplication mf, final TreePanel treepanel, final Phylogeny phy ) { _phy = phy; _mf = mf; _treepanel = treepanel;