Merge branch 'JAL-1397' into develop
[jalview.git] / src / jalview / gui / PopupMenu.java
index 0216276..037f007 100644 (file)
@@ -23,14 +23,6 @@ import java.awt.*;
 import java.awt.event.*;
 
 import javax.swing.*;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-
-import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
-import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
-import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
-import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
 
 import jalview.analysis.*;
 import jalview.commands.*;
@@ -130,7 +122,11 @@ public class PopupMenu extends JPopupMenu
   JMenu pdbMenu = new JMenu();
 
   JMenuItem pdbFromFile = new JMenuItem();
-
+    // JBPNote: Commented these out - Should add these services via the web services menu system.
+    // JMenuItem ContraFold = new JMenuItem();
+  
+    // JMenuItem RNAFold = new JMenuItem();
+  
   JMenuItem enterPDB = new JMenuItem();
 
   JMenuItem discoverPDB = new JMenuItem();
@@ -471,10 +467,7 @@ public class PopupMenu extends JPopupMenu
         purinePyrimidineColour.setSelected(true);
       }
       
-      else if (sg.cs instanceof RNAInteractionColourScheme)
-      {
-        RNAInteractionColour.setSelected(true);
-      }
+   
       /*
        * else if (sg.cs instanceof CovariationColourScheme) {
        * covariationColour.setSelected(true); }
@@ -1081,6 +1074,32 @@ public class PopupMenu extends JPopupMenu
         pdbFromFile_actionPerformed();
       }
     });
+//    RNAFold.setText("From RNA Fold with predict2D");
+//    RNAFold.addActionListener(new ActionListener()
+//    {
+//      public void actionPerformed(ActionEvent e)
+//      {
+//       try {
+//                     RNAFold_actionPerformed();
+//             } catch (Exception e1) {
+//                     // TODO Auto-generated catch block
+//                     e1.printStackTrace();
+//             }
+//      }   
+//    });
+//    ContraFold.setText("From Contra Fold with predict2D");
+//    ContraFold.addActionListener(new ActionListener()
+//    {
+//      public void actionPerformed(ActionEvent e)
+//      {
+//       try {
+//                     ContraFold_actionPerformed();
+//             } catch (Exception e1) {
+//                     // TODO Auto-generated catch block
+//                     e1.printStackTrace();
+//             }
+//      }   
+//    });
     enterPDB.setText("Enter PDB Id");
     enterPDB.addActionListener(new ActionListener()
     {
@@ -1159,7 +1178,8 @@ public class PopupMenu extends JPopupMenu
     colourMenu.add(buriedColour);
     colourMenu.add(nucleotideMenuItem);
     if (ap.getAlignment().isNucleotide()) {
-      colourMenu.add(RNAInteractionColour);
+       // JBPNote - commented since the colourscheme isn't functional
+       //  colourMenu.add(RNAInteractionColour);
        colourMenu.add(purinePyrimidineColour);
     }
     // colourMenu.add(covariationColour);
@@ -1195,6 +1215,9 @@ public class PopupMenu extends JPopupMenu
     editMenu.add(lowerCase);
     editMenu.add(toggle);
     pdbMenu.add(pdbFromFile);
+    // JBPNote: These shouldn't be added here - should appear in a generic 'apply web service to this sequence menu'
+    //    pdbMenu.add(RNAFold);
+    //    pdbMenu.add(ContraFold);
     pdbMenu.add(enterPDB);
     pdbMenu.add(discoverPDB);
     jMenu1.add(groupName);
@@ -1323,15 +1346,7 @@ public class PopupMenu extends JPopupMenu
               }
             });
     
-    RNAInteractionColour.setText("RNA Interaction type");
-    RNAInteractionColour
-            .addActionListener(new java.awt.event.ActionListener()
-            {
-              public void actionPerformed(ActionEvent e)
-              {
-                RNAInteractionColour_actionPerformed();
-              }
-            });
+   
     /*
      * covariationColour.addActionListener(new java.awt.event.ActionListener() {
      * public void actionPerformed(ActionEvent e) {
@@ -1519,11 +1534,7 @@ public class PopupMenu extends JPopupMenu
     refresh();
   }
 
-  protected void RNAInteractionColour_actionPerformed()
-  {
-    getGroup().cs = new RNAInteractionColourScheme();
-    refresh();
-  }
+
   /*
    * protected void covariationColour_actionPerformed() { getGroup().cs = new
    * CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
@@ -1685,7 +1696,7 @@ public class PopupMenu extends JPopupMenu
             sequence.getAnnotation()[0], null,
             AnnotationColourGradient.NO_THRESHOLD);
 
-    acg.predefinedColours = true;
+    acg.setPredefinedColours(true);
     sg.cs = acg;
 
     refresh();
@@ -2003,7 +2014,18 @@ public class PopupMenu extends JPopupMenu
     }
 
   }
-
+    // JBNote: commented out - these won't be instantiated here...!  
+//  public void RNAFold_actionPerformed() throws Exception
+//  {
+//       Predict2D P2D = new Predict2D();
+//       P2D.getStructure2DFromRNAFold("toto");
+//  }
+//  
+//  public void ContraFold_actionPerformed() throws Exception
+//  {
+//       Predict2D P2D = new Predict2D();
+//       P2D.getStructure2DFromContraFold("toto");
+//  }
   public void enterPDB_actionPerformed()
   {
     String id = JOptionPane.showInternalInputDialog(Desktop.desktop,