/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
+ * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
*
* 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.
- *
+ *
* 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
CheckboxMenuItem seqColour = new CheckboxMenuItem("By Sequence", true);
CheckboxMenuItem jmolColour = new CheckboxMenuItem("Using Jmol", false);
-
+
MenuItem chain = new MenuItem("By Chain");
MenuItem charge = new MenuItem("Charge & Cysteine");
MenuItem buried = new MenuItem("Buried Index");
+ MenuItem purinepyrimidine = new MenuItem("Purine/Pyrimidine");
+
MenuItem user = new MenuItem("User Defined Colours");
MenuItem jmolHelp = new MenuItem("Jmol Help");
RenderPanel renderPanel;
AlignmentPanel ap;
+
ArrayList _aps = new ArrayList();
String fileLoadingError;
AlignmentPanel ap, String protocol)
{
this.ap = ap;
- jmb = new AppletJmolBinding(this, new PDBEntry[]
- { pdbentry }, new SequenceI[][]
- { seq }, new String[][]
- { chains }, protocol);
+ jmb = new AppletJmolBinding(this, ap.getStructureSelectionManager(),
+ new PDBEntry[]
+ { pdbentry }, new SequenceI[][]
+ { seq }, new String[][]
+ { chains }, protocol);
jmb.setColourBySequence(true);
if (pdbentry.getId() == null || pdbentry.getId().length() < 1)
{
}
String alreadyMapped = StructureSelectionManager
- .getStructureSelectionManager().alreadyMappedToFile(
- pdbentry.getId());
+ .getStructureSelectionManager(ap.av.applet)
+ .alreadyMappedToFile(pdbentry.getId());
MCview.PDBfile reader = null;
if (alreadyMapped != null)
{
- reader = StructureSelectionManager.getStructureSelectionManager()
- .setMapping(seq, chains, pdbentry.getFile(), protocol);
+ reader = StructureSelectionManager.getStructureSelectionManager(
+ ap.av.applet).setMapping(seq, chains, pdbentry.getFile(),
+ protocol);
// PROMPT USER HERE TO ADD TO NEW OR EXISTING VIEW?
// FOR NOW, LETS JUST OPEN A NEW WINDOW
}
hydro.addActionListener(this);
chain.addActionListener(this);
seqColour.addItemListener(this);
+ jmolColour.addItemListener(this);
zappo.addActionListener(this);
taylor.addActionListener(this);
helix.addActionListener(this);
strand.addActionListener(this);
turn.addActionListener(this);
buried.addActionListener(this);
+ purinepyrimidine.addActionListener(this);
user.addActionListener(this);
- jmolColour.addActionListener(this);
-
+
jmolHelp.addActionListener(this);
coloursMenu.add(seqColour);
coloursMenu.add(strand);
coloursMenu.add(turn);
coloursMenu.add(buried);
+ coloursMenu.add(purinepyrimidine);
coloursMenu.add(user);
coloursMenu.add(jmolColour);
helpMenu.add(jmolHelp);
{
for (int s = 0; s < jmb.pdbentry.length; s++)
{
- sb.append(StructureSelectionManager
- .getStructureSelectionManager().printMapping(
- jmb.pdbentry[s].getFile()));
+ sb.append(jmb.printMapping(jmb.pdbentry[s].getFile()));
sb.append("\n");
}
cap.setText(sb.toString());
setEnabled(buried);
jmb.setJalviewColourScheme(new BuriedColourScheme());
}
+ else if (evt.getSource() == purinepyrimidine)
+ {
+ jmb.setJalviewColourScheme(new PurinePyrimidineColourScheme());
+ }
else if (evt.getSource() == user)
{
setEnabled(user);
}
/**
- * tick or untick the seqColour menu entry or jmoColour entry depending upon if it was selected
- * or not.
+ * tick or untick the seqColour menu entry or jmoColour entry depending upon
+ * if it was selected or not.
*
* @param itm
*/
{
setEnabled(jmolColour);
jmb.setColourBySequence(false);
- } else
- if (evt.getSource() == seqColour)
+ }
+ else if (evt.getSource() == seqColour)
{
setEnabled(seqColour);
jmb.colourBySequence(ap.av.getShowSequenceFeatures(), ap);
public AlignmentPanel getAlignmentPanelFor(AlignmentI alignment)
{
- for (int i=0;i<_aps.size();i++)
+ for (int i = 0; i < _aps.size(); i++)
{
- if (((AlignmentPanel)_aps.get(i)).av.getAlignment()==alignment)
+ if (((AlignmentPanel) _aps.get(i)).av.getAlignment() == alignment)
{
- return ((AlignmentPanel)_aps.get(i));
+ return ((AlignmentPanel) _aps.get(i));
}
}
return ap;