in progress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / MainPanel.java
index 17335bd..59fda58 100644 (file)
@@ -36,8 +36,10 @@ import java.awt.event.ComponentEvent;
 import java.awt.event.ComponentListener;
 import java.awt.image.BufferedImage;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.swing.JPanel;
@@ -66,11 +68,12 @@ public class MainPanel extends JPanel implements ComponentListener {
     private Phylogeny                        _cut_or_copied_tree;
     private Set<Integer>                     _copied_and_pasted_nodes;
     private Hashtable<String, BufferedImage> _image_map;
+    private static Map<String, String>       _lineage_to_rank_map;
 
     MainPanel() {
     }
 
-    MainPanel( final Configuration configuration, final MainFrame parent ) {
+    public MainPanel( final Configuration configuration, final MainFrame parent ) {
         if ( configuration == null ) {
             throw new IllegalArgumentException( "configuration is null" );
         }
@@ -85,10 +88,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() );
@@ -204,7 +207,7 @@ public class MainPanel extends JPanel implements ComponentListener {
         return _configuration;
     }
 
-    ControlPanel getControlPanel() {
+    public ControlPanel getControlPanel() {
         return _control_panel;
     }
 
@@ -261,7 +264,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 );
@@ -299,7 +302,7 @@ public class MainPanel extends JPanel implements ComponentListener {
         return getCurrentScrollPane().getViewport().getExtentSize();
     }
 
-    JTabbedPane getTabbedPane() {
+    public JTabbedPane getTabbedPane() {
         return _tabbed_pane;
     }
 
@@ -409,4 +412,11 @@ public class MainPanel extends JPanel implements ComponentListener {
     synchronized Hashtable<String, BufferedImage> getImageMap() {
         return _image_map;
     }
+
+    public synchronized static Map<String, String> getLineageToRankMap() {
+        if ( _lineage_to_rank_map == null ) {
+            _lineage_to_rank_map = new HashMap<String, String>();
+        }
+        return _lineage_to_rank_map;
+    }
 }