/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
package jalview.jbgui;
import jalview.api.structures.JalviewStructureDisplayI;
-import jalview.gui.AlignmentPanel;
import jalview.util.MessageManager;
+import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.util.ArrayList;
-import java.util.Vector;
import javax.swing.ButtonGroup;
import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
+import javax.swing.JPanel;
import javax.swing.JRadioButtonMenuItem;
public abstract class GStructureViewer extends JInternalFrame implements
protected JMenuItem alignStructs = new JMenuItem();
+ protected JMenuItem fitToWindow = new JMenuItem();
+
protected JRadioButtonMenuItem seqColour = new JRadioButtonMenuItem();
protected JRadioButtonMenuItem chainColour = new JRadioButtonMenuItem();
protected JMenuItem helpItem = new JMenuItem();
- /**
- * list of sequenceSet ids associated with the view
- */
- protected ArrayList<String> _aps = new ArrayList<String>();
+ protected JLabel statusBar = new JLabel();
- /**
- * list of alignment panels to use for superposition
- */
- protected Vector<AlignmentPanel> _alignwith = new Vector<AlignmentPanel>();
-
- /**
- * list of alignment panels that are used for colouring structures by aligned
- * sequences
- */
- protected Vector<AlignmentPanel> _colourwith = new Vector<AlignmentPanel>();
-
- private String viewId = null;
+ protected JPanel statusPanel = new JPanel();
/**
* Constructor
pdbFile.setText(MessageManager.getString("label.pdb_file"));
pdbFile.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
pdbFile_actionPerformed(actionEvent);
png.setText("PNG");
png.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
png_actionPerformed(actionEvent);
eps.setText("EPS");
eps.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
eps_actionPerformed(actionEvent);
viewMapping.setText(MessageManager.getString("label.view_mapping"));
viewMapping.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
viewMapping_actionPerformed(actionEvent);
}
});
viewMenu.setText(MessageManager.getString("action.view"));
+
chainMenu.setText(MessageManager.getString("action.show_chain"));
+ fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
+ fitToWindow.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ fitToWindow_actionPerformed();
+ }
+ });
+
JMenu colourMenu = new JMenu();
colourMenu.setText(MessageManager.getString("label.colours"));
JMenuItem backGround = new JMenuItem();
- backGround.setText(MessageManager.getString("label.background_colour")
- + "...");
+ backGround
+ .setText(MessageManager.getString("action.background_colour"));
backGround.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
backGround_actionPerformed(actionEvent);
seqColour.setText(MessageManager.getString("action.by_sequence"));
seqColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
seqColour_actionPerformed(actionEvent);
chainColour.setText(MessageManager.getString("action.by_chain"));
chainColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
chainColour_actionPerformed(actionEvent);
chargeColour.setText(MessageManager.getString("label.charge_cysteine"));
chargeColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
chargeColour_actionPerformed(actionEvent);
zappoColour.setText(MessageManager.getString("label.zappo"));
zappoColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
zappoColour_actionPerformed(actionEvent);
taylorColour.setText(MessageManager.getString("label.taylor"));
taylorColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
taylorColour_actionPerformed(actionEvent);
hydroColour.setText(MessageManager.getString("label.hydrophobicity"));
hydroColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
hydroColour_actionPerformed(actionEvent);
.getString("label.strand_propensity"));
strandColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
strandColour_actionPerformed(actionEvent);
helixColour.setText(MessageManager.getString("label.helix_propensity"));
helixColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
helixColour_actionPerformed(actionEvent);
turnColour.setText(MessageManager.getString("label.turn_propensity"));
turnColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
turnColour_actionPerformed(actionEvent);
buriedColour.setText(MessageManager.getString("label.buried_index"));
buriedColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
buriedColour_actionPerformed(actionEvent);
.getString("label.purine_pyrimidine"));
purinePyrimidineColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
purinePyrimidineColour_actionPerformed(actionEvent);
userColour.setText(MessageManager.getString("action.user_defined"));
userColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
userColour_actionPerformed(actionEvent);
.getString("label.let_jmol_manage_structure_colours"));
viewerColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
viewerColour_actionPerformed(actionEvent);
helpItem.setText(MessageManager.getString("label.jmol_help"));
helpItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
showHelp_actionPerformed(actionEvent);
.setText(MessageManager.getString("label.align_structures"));
alignStructs.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
alignStructs_actionPerformed(actionEvent);
colourButtons.add(strandColour);
colourButtons.add(turnColour);
colourButtons.add(buriedColour);
+ colourButtons.add(purinePyrimidineColour);
colourButtons.add(userColour);
colourButtons.add(viewerColour);
helpMenu.add(helpItem);
viewerActionMenu.add(alignStructs);
+
+ statusPanel.setLayout(new GridLayout());
+ this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH);
+ statusPanel.add(statusBar, null);
+ }
+
+ protected void fitToWindow_actionPerformed()
+ {
+ }
+
+ protected void highlightSelection_actionPerformed()
+ {
}
protected void viewerColour_actionPerformed(ActionEvent actionEvent)
// this.bindingModel = bindingModel;
// }
- /**
- *
- * @param ap2
- * @return true if this Jmol instance is linked with the given alignPanel
- */
- public boolean isLinkedWith(AlignmentPanel ap2)
- {
- return _aps.contains(ap2.av.getSequenceSetId());
- }
-
- public boolean isUsedforaligment(AlignmentPanel ap2)
- {
-
- return (_alignwith != null) && _alignwith.contains(ap2);
- }
-
- public boolean isUsedforcolourby(AlignmentPanel ap2)
- {
- return (_colourwith != null) && _colourwith.contains(ap2);
- }
-
- /**
- *
- * @return TRUE if the view is NOT being coloured by the alignment colours.
- */
- public boolean isColouredByViewer()
- {
- return !getBinding().isColourBySequence();
- }
-
- public String getViewId()
- {
- if (viewId == null)
- {
- viewId = System.currentTimeMillis() + "." + this.hashCode();
- }
- return viewId;
- }
-
- protected void setViewId(String viewId)
- {
- this.viewId = viewId;
- }
-
- public String getStateInfo()
- {
- return null;
- }
}