apply version 2.7 copyright
[jalview.git] / src / jalview / jbgui / GStructureViewer.java
index d2bebc3..28d2c7a 100644 (file)
@@ -1,20 +1,19 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
  * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  */
 package jalview.jbgui;
 
@@ -84,7 +83,7 @@ public class GStructureViewer extends JInternalFrame
         backGround_actionPerformed(actionEvent);
       }
     });
-    seqColour.setSelected(true);
+    seqColour.setSelected(false);
     seqColour.setText("By Sequence");
     seqColour.addActionListener(new ActionListener()
     {
@@ -173,6 +172,17 @@ public class GStructureViewer extends JInternalFrame
         userColour_actionPerformed(actionEvent);
       }
     });
+    jmolColour.setSelected(false);
+    jmolColour.setText("Colour with Jmol");
+    jmolColour.setToolTipText("Let Jmol manage structure colours.");
+    jmolColour.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent actionEvent)
+      {
+        jmolColour_actionPerformed(actionEvent);
+      }
+    }
+    );
     helpMenu.setText("Help");
     jmolHelp.setText("Jmol Help");
     jmolHelp.addActionListener(new ActionListener()
@@ -182,9 +192,20 @@ public class GStructureViewer extends JInternalFrame
         jmolHelp_actionPerformed(actionEvent);
       }
     });
+    alignStructs.setText("Align structures");
+    alignStructs.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent actionEvent)
+      {
+        alignStructs_actionPerformed(actionEvent);
+      }
+    });
+    jmolActionMenu.setText("Jmol");
     menuBar.add(fileMenu);
     menuBar.add(viewMenu);
     menuBar.add(colourMenu);
+    menuBar.add(jmolActionMenu);
+    jmolActionMenu.setVisible(false);
     menuBar.add(helpMenu);
     fileMenu.add(savemenu);
     fileMenu.add(viewMapping);
@@ -192,6 +213,7 @@ public class GStructureViewer extends JInternalFrame
     savemenu.add(png);
     savemenu.add(eps);
     viewMenu.add(chainMenu);
+
     colourMenu.add(seqColour);
     colourMenu.add(chainColour);
     colourMenu.add(chargeColour);
@@ -203,8 +225,32 @@ public class GStructureViewer extends JInternalFrame
     colourMenu.add(turnColour);
     colourMenu.add(buriedColour);
     colourMenu.add(userColour);
+    colourMenu.add(jmolColour);
     colourMenu.add(backGround);
+
+    colourButtons.add(seqColour);
+    colourButtons.add(chainColour);
+    colourButtons.add(chargeColour);
+    colourButtons.add(zappoColour);
+    colourButtons.add(taylorColour);
+    colourButtons.add(hydroColour);
+    colourButtons.add(helixColour);
+    colourButtons.add(strandColour);
+    colourButtons.add(turnColour);
+    colourButtons.add(buriedColour);
+    colourButtons.add(userColour);
+    colourButtons.add(jmolColour);
+
     helpMenu.add(jmolHelp);
+    jmolActionMenu.add(alignStructs);
+  }
+
+  protected void jmolColour_actionPerformed(ActionEvent actionEvent)
+  {
+  }
+
+  protected void alignStructs_actionPerformed(ActionEvent actionEvent)
+  {
   }
 
   JMenuBar menuBar = new JMenuBar();
@@ -221,37 +267,45 @@ public class GStructureViewer extends JInternalFrame
 
   JMenuItem viewMapping = new JMenuItem();
 
-  JMenu viewMenu = new JMenu();
+  protected JMenu viewMenu = new JMenu();
 
   protected JMenu chainMenu = new JMenu();
 
   JMenu jMenu1 = new JMenu();
 
-  JMenu colourMenu = new JMenu();
+  protected JMenu colourMenu = new JMenu();
+
+  protected JMenu jmolActionMenu = new JMenu();
+
+  protected JMenuItem alignStructs = new JMenuItem();
 
   JMenuItem backGround = new JMenuItem();
 
-  protected JCheckBoxMenuItem seqColour = new JCheckBoxMenuItem();
+  protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
+
+  protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
+
+  protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
 
-  JMenuItem chainColour = new JMenuItem();
+  protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
 
-  JMenuItem chargeColour = new JMenuItem();
+  protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
 
-  JMenuItem zappoColour = new JMenuItem();
+  protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
 
-  JMenuItem taylorColour = new JMenuItem();
+  protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
 
-  JMenuItem hydroColour = new JMenuItem();
+  protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
 
-  JMenuItem strandColour = new JMenuItem();
+  protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
 
-  JMenuItem helixColour = new JMenuItem();
+  protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
 
-  JMenuItem turnColour = new JMenuItem();
+  protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
 
-  JMenuItem buriedColour = new JMenuItem();
+  protected JRadioButtonMenuItem jmolColour = new JRadioButtonMenuItem();
 
-  JMenuItem userColour = new JMenuItem();
+  protected ButtonGroup colourButtons = new ButtonGroup();
 
   JMenu helpMenu = new JMenu();