X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fjbgui%2FGStructureViewer.java;h=24e7ee3d7a9ae7ad842ac8ff0b49d2d04b8e12e5;hb=c94c1390298db2e80abc04b371d3e7767f5e5968;hp=b1b5200a249c4f19838ef482af31f4a6b3868515;hpb=797df64fa2a0a30773d0f48f5494d4155e5a8be3;p=jalview.git
diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java
index b1b5200..24e7ee3 100644
--- a/src/jalview/jbgui/GStructureViewer.java
+++ b/src/jalview/jbgui/GStructureViewer.java
@@ -1,28 +1,84 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* 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.
- *
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
* 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 .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.jbgui;
-import javax.swing.*;
-import java.awt.event.ActionListener;
+import jalview.api.structures.JalviewStructureDisplayI;
+import jalview.util.MessageManager;
+
import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
-public class GStructureViewer extends JInternalFrame
+import javax.swing.ButtonGroup;
+import javax.swing.JInternalFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JRadioButtonMenuItem;
+
+public abstract class GStructureViewer extends JInternalFrame implements
+ JalviewStructureDisplayI
{
+ // private AAStructureBindingModel bindingModel;
+
+ protected JMenu savemenu = new JMenu();
+
+ protected JMenu viewMenu = new JMenu();
+
+ protected JMenu chainMenu = new JMenu();
+
+ protected JMenu viewerActionMenu = new JMenu();
+
+ protected JMenuItem alignStructs = new JMenuItem();
+
+ protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem viewerColour = new JRadioButtonMenuItem();
+
+ protected JMenuItem helpItem = new JMenuItem();
+
+ /**
+ * Constructor
+ */
public GStructureViewer()
{
try
@@ -36,11 +92,17 @@ public class GStructureViewer extends JInternalFrame
private void jbInit() throws Exception
{
+ JMenuBar menuBar = new JMenuBar();
this.setJMenuBar(menuBar);
- fileMenu.setText("File");
- savemenu.setActionCommand("Save Image");
- savemenu.setText("Save As");
- pdbFile.setText("PDB File");
+
+ JMenu fileMenu = new JMenu();
+ fileMenu.setText(MessageManager.getString("action.file"));
+
+ savemenu.setActionCommand(MessageManager.getString("action.save_image"));
+ savemenu.setText(MessageManager.getString("action.save_as"));
+
+ JMenuItem pdbFile = new JMenuItem();
+ pdbFile.setText(MessageManager.getString("label.pdb_file"));
pdbFile.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -48,6 +110,8 @@ public class GStructureViewer extends JInternalFrame
pdbFile_actionPerformed(actionEvent);
}
});
+
+ JMenuItem png = new JMenuItem();
png.setText("PNG");
png.addActionListener(new ActionListener()
{
@@ -56,6 +120,8 @@ public class GStructureViewer extends JInternalFrame
png_actionPerformed(actionEvent);
}
});
+
+ JMenuItem eps = new JMenuItem();
eps.setText("EPS");
eps.addActionListener(new ActionListener()
{
@@ -64,7 +130,9 @@ public class GStructureViewer extends JInternalFrame
eps_actionPerformed(actionEvent);
}
});
- viewMapping.setText("View Mapping");
+
+ JMenuItem viewMapping = new JMenuItem();
+ viewMapping.setText(MessageManager.getString("label.view_mapping"));
viewMapping.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -72,10 +140,15 @@ public class GStructureViewer extends JInternalFrame
viewMapping_actionPerformed(actionEvent);
}
});
- viewMenu.setText("View");
- chainMenu.setText("Show Chain");
- colourMenu.setText("Colours");
- backGround.setText("Background Colour...");
+ viewMenu.setText(MessageManager.getString("action.view"));
+ chainMenu.setText(MessageManager.getString("action.show_chain"));
+
+ JMenu colourMenu = new JMenu();
+ colourMenu.setText(MessageManager.getString("label.colours"));
+
+ JMenuItem backGround = new JMenuItem();
+ backGround.setText(MessageManager.getString("label.background_colour")
+ + "...");
backGround.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -84,7 +157,7 @@ public class GStructureViewer extends JInternalFrame
}
});
seqColour.setSelected(false);
- seqColour.setText("By Sequence");
+ seqColour.setText(MessageManager.getString("action.by_sequence"));
seqColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -92,7 +165,7 @@ public class GStructureViewer extends JInternalFrame
seqColour_actionPerformed(actionEvent);
}
});
- chainColour.setText("By Chain");
+ chainColour.setText(MessageManager.getString("action.by_chain"));
chainColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -100,7 +173,7 @@ public class GStructureViewer extends JInternalFrame
chainColour_actionPerformed(actionEvent);
}
});
- chargeColour.setText("Charge & Cysteine");
+ chargeColour.setText(MessageManager.getString("label.charge_cysteine"));
chargeColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -108,7 +181,7 @@ public class GStructureViewer extends JInternalFrame
chargeColour_actionPerformed(actionEvent);
}
});
- zappoColour.setText("Zappo");
+ zappoColour.setText(MessageManager.getString("label.zappo"));
zappoColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -116,7 +189,7 @@ public class GStructureViewer extends JInternalFrame
zappoColour_actionPerformed(actionEvent);
}
});
- taylorColour.setText("Taylor");
+ taylorColour.setText(MessageManager.getString("label.taylor"));
taylorColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -124,7 +197,7 @@ public class GStructureViewer extends JInternalFrame
taylorColour_actionPerformed(actionEvent);
}
});
- hydroColour.setText("Hydro");
+ hydroColour.setText(MessageManager.getString("label.hydrophobicity"));
hydroColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -132,7 +205,8 @@ public class GStructureViewer extends JInternalFrame
hydroColour_actionPerformed(actionEvent);
}
});
- strandColour.setText("Strand");
+ strandColour.setText(MessageManager
+ .getString("label.strand_propensity"));
strandColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -140,7 +214,7 @@ public class GStructureViewer extends JInternalFrame
strandColour_actionPerformed(actionEvent);
}
});
- helixColour.setText("Helix Propensity");
+ helixColour.setText(MessageManager.getString("label.helix_propensity"));
helixColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -148,7 +222,7 @@ public class GStructureViewer extends JInternalFrame
helixColour_actionPerformed(actionEvent);
}
});
- turnColour.setText("Turn Propensity");
+ turnColour.setText(MessageManager.getString("label.turn_propensity"));
turnColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -156,7 +230,7 @@ public class GStructureViewer extends JInternalFrame
turnColour_actionPerformed(actionEvent);
}
});
- buriedColour.setText("Buried Index");
+ buriedColour.setText(MessageManager.getString("label.buried_index"));
buriedColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -164,16 +238,17 @@ public class GStructureViewer extends JInternalFrame
buriedColour_actionPerformed(actionEvent);
}
});
- purinePyrimidineColour.setText("Purine/Pyrimidine");
+ purinePyrimidineColour.setText(MessageManager
+ .getString("label.purine_pyrimidine"));
purinePyrimidineColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
{
- purinePyrimidineColour_actionPerformed(actionEvent);
+ purinePyrimidineColour_actionPerformed(actionEvent);
}
});
-
- userColour.setText("User Defined ...");
+
+ userColour.setText(MessageManager.getString("action.user_defined"));
userColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -181,27 +256,31 @@ 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()
+ viewerColour.setSelected(false);
+ viewerColour
+ .setText(MessageManager.getString("label.colour_with_jmol"));
+ viewerColour.setToolTipText(MessageManager
+ .getString("label.let_jmol_manage_structure_colours"));
+ viewerColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
{
- jmolColour_actionPerformed(actionEvent);
+ viewerColour_actionPerformed(actionEvent);
}
- }
- );
- helpMenu.setText("Help");
- jmolHelp.setText("Jmol Help");
- jmolHelp.addActionListener(new ActionListener()
+ });
+
+ JMenu helpMenu = new JMenu();
+ helpMenu.setText(MessageManager.getString("action.help"));
+ helpItem.setText(MessageManager.getString("label.jmol_help"));
+ helpItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
{
- jmolHelp_actionPerformed(actionEvent);
+ showHelp_actionPerformed(actionEvent);
}
});
- alignStructs.setText("Align structures");
+ alignStructs
+ .setText(MessageManager.getString("label.align_structures"));
alignStructs.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
@@ -209,12 +288,12 @@ public class GStructureViewer extends JInternalFrame
alignStructs_actionPerformed(actionEvent);
}
});
- jmolActionMenu.setText("Jmol");
+ viewerActionMenu.setText(MessageManager.getString("label.jmol"));
menuBar.add(fileMenu);
menuBar.add(viewMenu);
menuBar.add(colourMenu);
- menuBar.add(jmolActionMenu);
- jmolActionMenu.setVisible(false);
+ menuBar.add(viewerActionMenu);
+ viewerActionMenu.setVisible(false);
menuBar.add(helpMenu);
fileMenu.add(savemenu);
fileMenu.add(viewMapping);
@@ -235,9 +314,11 @@ public class GStructureViewer extends JInternalFrame
colourMenu.add(buriedColour);
colourMenu.add(purinePyrimidineColour);
colourMenu.add(userColour);
- colourMenu.add(jmolColour);
+ colourMenu.add(viewerColour);
colourMenu.add(backGround);
+ ButtonGroup colourButtons = new ButtonGroup();
+
colourButtons.add(seqColour);
colourButtons.add(chainColour);
colourButtons.add(chargeColour);
@@ -249,13 +330,13 @@ public class GStructureViewer extends JInternalFrame
colourButtons.add(turnColour);
colourButtons.add(buriedColour);
colourButtons.add(userColour);
- colourButtons.add(jmolColour);
+ colourButtons.add(viewerColour);
- helpMenu.add(jmolHelp);
- jmolActionMenu.add(alignStructs);
+ helpMenu.add(helpItem);
+ viewerActionMenu.add(alignStructs);
}
- protected void jmolColour_actionPerformed(ActionEvent actionEvent)
+ protected void viewerColour_actionPerformed(ActionEvent actionEvent)
{
}
@@ -263,67 +344,6 @@ public class GStructureViewer extends JInternalFrame
{
}
- JMenuBar menuBar = new JMenuBar();
-
- JMenu fileMenu = new JMenu();
-
- JMenu savemenu = new JMenu();
-
- JMenuItem pdbFile = new JMenuItem();
-
- JMenuItem png = new JMenuItem();
-
- JMenuItem eps = new JMenuItem();
-
- JMenuItem viewMapping = new JMenuItem();
-
- protected JMenu viewMenu = new JMenu();
-
- protected JMenu chainMenu = new JMenu();
-
- JMenu jMenu1 = new JMenu();
-
- protected JMenu colourMenu = new JMenu();
-
- protected JMenu jmolActionMenu = new JMenu();
-
- protected JMenuItem alignStructs = new JMenuItem();
-
- JMenuItem backGround = new JMenuItem();
-
- protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem chargeColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem hydroColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
-
-
- protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
-
- protected JRadioButtonMenuItem jmolColour = new JRadioButtonMenuItem();
-
- protected ButtonGroup colourButtons = new ButtonGroup();
-
- JMenu helpMenu = new JMenu();
-
- JMenuItem jmolHelp = new JMenuItem();
-
public void pdbFile_actionPerformed(ActionEvent actionEvent)
{
@@ -393,7 +413,7 @@ public class GStructureViewer extends JInternalFrame
{
}
-
+
public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
{
@@ -409,8 +429,18 @@ public class GStructureViewer extends JInternalFrame
}
- public void jmolHelp_actionPerformed(ActionEvent actionEvent)
+ public void showHelp_actionPerformed(ActionEvent actionEvent)
{
}
+
+ // {
+ // return bindingModel;
+ // }
+
+ // public void setBindingModel(AAStructureBindingModel bindingModel)
+ // {
+ // this.bindingModel = bindingModel;
+ // }
+
}