protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem();
protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
-
+
protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
-
- //protected JRadioButtonMenuItem covariationColour = new JRadioButtonMenuItem();
+
+ // protected JRadioButtonMenuItem covariationColour = new
+ // JRadioButtonMenuItem();
JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
* @param links
* @param groupLinks
*/
- public PopupMenu(final AlignmentPanel ap, final Sequence seq, final Vector links,
- final Vector groupLinks)
+ public PopupMenu(final AlignmentPanel ap, final Sequence seq,
+ final Vector links, final Vector groupLinks)
{
// /////////////////////////////////////////////////////////
// If this is activated from the sequence panel, the user may want to
colours.add(PIDColour);
colours.add(BLOSUM62Colour);
colours.add(purinePyrimidineColour);
- //colours.add(covariationColour);
+ // colours.add(covariationColour);
for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
{
{
public void actionPerformed(ActionEvent e)
{
- // TODO re JAL-860: optionally open dialog or provide a menu entry allowing user to open just one structure per sequence
- new AppJmol(pdb, ap.av.collateForPDB(new PDBEntry[] { pdb })[0], null, ap);
+ // TODO re JAL-860: optionally open dialog or provide a menu entry
+ // allowing user to open just one structure per sequence
+ new AppJmol(pdb, ap.av.collateForPDB(new PDBEntry[]
+ { pdb })[0], null, ap);
// new PDBViewer(pdb, seqs2, null, ap, AppletFormatAdapter.FILE);
}
}
}
else
- {
- if(ap.av.alignment.isNucleotide()==false){
- structureMenu.remove(viewStructureMenu);
- }
+ {
+ if (ap.av.alignment.isNucleotide() == false)
+ {
+ structureMenu.remove(viewStructureMenu);
+ }
// structureMenu.remove(colStructureMenu);
}
-
- if(ap.av.alignment.isNucleotide()==true){
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
- String rnastruc=new String();
- for(int i=0; i<aa.length;i++){
- if(aa[i].getRNAStruc() != null){
- rnastruc=aa[i].getRNAStruc();
- break;
- }
- }
-
- AlignmentAnnotation a[] = seq.getAnnotation();
-
- //TODO: make rnastrucF a bit more nice
- final String rnastrucF=rnastruc;
- menuItem = new JMenuItem();
- menuItem.setText("RNA structure");
- menuItem.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- //System.out.println("Call Varna "+seq.getSequenceAsString()+" "+seq.getName());
- //TODO: VARNA does'nt print gaps in the sequence
-
- new AppVarna(seq.getSequenceAsString(),rnastrucF,seq.getName(),ap);
- }
- });
- viewStructureMenu.add(menuItem);
- }
+
+ if (ap.av.alignment.isNucleotide() == true)
+ {
+ AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+ for (int i = 0; i < aa.length; i++)
+ {
+ if (aa[i].getRNAStruc() != null)
+ {
+ final String rnastruc = aa[i].getRNAStruc();
+
+ menuItem = new JMenuItem();
+ menuItem.setText("RNA structure - consensus");
+ menuItem.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ new AppVarna(seq.getSequenceAsString(), rnastruc, seq
+ .getName(), ap);
+ }
+ });
+ viewStructureMenu.add(menuItem);
+ }
+ }
+
+ // SequenceFeatures[] test = seq.getSequenceFeatures();
+
+ if (seq.getAnnotation() != null)
+ {
+ AlignmentAnnotation seqAnno[] = seq.getAnnotation();
+ for (int i = 0; i < seqAnno.length; i++)
+ {
+ if (seqAnno[i].getRNAStruc() != null)
+ {
+ final String rnastruc = seqAnno[i].getRNAStruc();
+
+ // TODO: make rnastrucF a bit more nice
+ menuItem = new JMenuItem();
+ menuItem.setText("RNA structure - "+seq.getName());
+ menuItem.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ // TODO: VARNA does'nt print gaps in the sequence
+ new AppVarna(seq.getSequenceAsString(), rnastruc, seq
+ .getName(), ap);
+ }
+ });
+ viewStructureMenu.add(menuItem);
+ }
+ }
+ }
+
+
+ }
menuItem = new JMenuItem("Hide Sequences");
menuItem.addActionListener(new java.awt.event.ActionListener()
if (sg != null)
{
- groupName.setText("Name: "+sg.getName());
+ groupName.setText("Name: " + sg.getName());
groupName.setText("Edit name and description of current group.");
if (sg.cs instanceof ZappoColourScheme)
}
else if (sg.cs instanceof PurinePyrimidineColourScheme)
{
- purinePyrimidineColour.setSelected(true);
+ purinePyrimidineColour.setSelected(true);
}
- /* else if (sg.cs instanceof CovariationColourScheme)
- {
- covariationColour.setSelected(true);
- }*/
+ /*
+ * else if (sg.cs instanceof CovariationColourScheme) {
+ * covariationColour.setSelected(true); }
+ */
else
{
noColourmenuItem.setSelected(true);
buildGroupURLMenu(sg, groupLinks);
}
// Add a 'show all structures' for the current selection
- Hashtable<String, PDBEntry> pdbe=new Hashtable<String,PDBEntry>();
- for (SequenceI sq: ap.av.getSequenceSelection())
+ Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>();
+ for (SequenceI sq : ap.av.getSequenceSelection())
{
- Vector<PDBEntry> pes = (Vector<PDBEntry>) sq.getDatasetSequence().getPDBId();
- if (pes!=null) {
- for (PDBEntry pe: pes)
+ Vector<PDBEntry> pes = (Vector<PDBEntry>) sq.getDatasetSequence()
+ .getPDBId();
+ if (pes != null)
+ {
+ for (PDBEntry pe : pes)
{
- pdbe.put(pe.getId(), pe);
+ pdbe.put(pe.getId(), pe);
}
}
}
- if (pdbe.size()>0)
+ if (pdbe.size() > 0)
{
- final PDBEntry[] pe = pdbe.values().toArray(new PDBEntry[pdbe.size()]);
+ final PDBEntry[] pe = pdbe.values().toArray(
+ new PDBEntry[pdbe.size()]);
final JMenuItem gpdbview;
- structureMenu.add(gpdbview=new JMenuItem("View "+pdbe.size()+" structures."));
- gpdbview.setToolTipText("Open a new Jmol view with all structures associated with the current selection and superimpose them using the alignment.");
+ structureMenu.add(gpdbview = new JMenuItem("View " + pdbe.size()
+ + " structures."));
+ gpdbview
+ .setToolTipText("Open a new Jmol view with all structures associated with the current selection and superimpose them using the alignment.");
gpdbview.addActionListener(new ActionListener()
{
-
+
@Override
public void actionPerformed(ActionEvent e)
{
{
// collect matching db-refs
- DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
- seq.getDBRef(), new String[]
- { urlLink.getTarget() });
+ DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(seq
+ .getDBRef(), new String[]
+ { urlLink.getTarget() });
// collect id string too
String id = seq.getName();
String descr = seq.getDescription();
JMenu[] linkMenus = new JMenu[]
{ null, new JMenu("IDS"), new JMenu("Sequences"),
new JMenu("IDS and Sequences") }; // three types of url that might be
- // created.
+ // created.
SequenceI[] seqs = ap.av.getSelectionAsNewSequence();
String[][] idandseqs = GroupUrlLink.formStrings(seqs);
Hashtable commonDbrefs = new Hashtable();
}
// now create group links for all distinct ID/sequence sets.
boolean addMenu = false; // indicates if there are any group links to give
- // to user
+ // to user
for (int i = 0; i < groupLinks.size(); i++)
{
String link = groupLinks.elementAt(i).toString();
Object[] urlset = null;
try
{
- urlset = urlLink.makeUrlStubs(ids, seqstr,
- "FromJalview" + System.currentTimeMillis(), false);
+ urlset = urlLink.makeUrlStubs(ids, seqstr, "FromJalview"
+ + System.currentTimeMillis(), false);
} catch (UrlStringTooLongException e)
{
}
JMenuItem item = new JMenuItem(label);
item.setToolTipText("open URL (" + urlgenerator.getUrl_prefix()
+ "..) (" + urlgenerator.getNumberInvolved(urlstub) + " seqs)"); // TODO:
- // put
- // in
- // info
- // about
- // what
- // is
- // being
- // sent.
+ // put
+ // in
+ // info
+ // about
+ // what
+ // is
+ // being
+ // sent.
item.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
colourMenu.add(buriedColour);
colourMenu.add(nucleotideMenuItem);
colourMenu.add(purinePyrimidineColour);
- //colourMenu.add(covariationColour);
+ // colourMenu.add(covariationColour);
colourMenu.add(userDefinedColour);
if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
}
});
purinePyrimidineColour.setText("Purine/Pyrimidine");
- purinePyrimidineColour.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- purinePyrimidineColour_actionPerformed();
- }
- });
- /*
- covariationColour.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- covariationColour_actionPerformed();
- }
- });*/
-
+ purinePyrimidineColour
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ purinePyrimidineColour_actionPerformed();
+ }
+ });
+ /*
+ * covariationColour.addActionListener(new java.awt.event.ActionListener() {
+ * public void actionPerformed(ActionEvent e) {
+ * covariationColour_actionPerformed(); } });
+ */
+
conservationMenuItem.setText("Conservation");
conservationMenuItem
.addActionListener(new java.awt.event.ActionListener()
protected void clustalColour_actionPerformed()
{
SequenceGroup sg = getGroup();
- sg.cs = new ClustalxColourScheme(
- sg.getSequences(ap.av.hiddenRepSequences),
- ap.av.alignment.getWidth());
+ sg.cs = new ClustalxColourScheme(sg
+ .getSequences(ap.av.hiddenRepSequences), ap.av.alignment
+ .getWidth());
refresh();
}
getGroup().cs = new NucleotideColourScheme();
refresh();
}
-
+
protected void purinePyrimidineColour_actionPerformed()
{
getGroup().cs = new PurinePyrimidineColourScheme();
refresh();
}
+
/*
- protected void covariationColour_actionPerformed()
- {
- getGroup().cs = new CovariationColourScheme(sequence.getAnnotation()[0]);
- refresh();
- }
-*/
+ * protected void covariationColour_actionPerformed() { getGroup().cs = new
+ * CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
+ */
/**
* DOCUMENT ME!
*
if (abovePIDColour.isSelected())
{
- sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
- sg.getEndRes() + 1));
+ sg.cs.setConsensus(AAFrequency.calculate(sg
+ .getSequences(ap.av.hiddenRepSequences), sg.getStartRes(), sg
+ .getEndRes() + 1));
int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
.getName());
{
SequenceGroup sg = getGroup();
sg.cs = new PIDColourScheme();
- sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
- sg.getEndRes() + 1));
+ sg.cs.setConsensus(AAFrequency.calculate(sg
+ .getSequences(ap.av.hiddenRepSequences), sg.getStartRes(), sg
+ .getEndRes() + 1));
refresh();
}
sg.cs = new Blosum62ColourScheme();
- sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
- sg.getEndRes() + 1));
+ sg.cs.setConsensus(AAFrequency.calculate(sg
+ .getSequences(ap.av.hiddenRepSequences), sg.getStartRes(), sg
+ .getEndRes() + 1));
refresh();
}
if (conservationMenuItem.isSelected())
{
Conservation c = new Conservation("Group",
- ResidueProperties.propHash, 3,
- sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
- sg.getEndRes() + 1);
+ ResidueProperties.propHash, 3, sg
+ .getSequences(ap.av.hiddenRepSequences), sg
+ .getStartRes(), sg.getEndRes() + 1);
c.calculate();
c.verdict(false, ap.av.ConsPercGaps);
return;
}
- AnnotationColourGradient acg = new AnnotationColourGradient(
- sequence.getAnnotation()[0], null,
+ AnnotationColourGradient acg = new AnnotationColourGradient(sequence
+ .getAnnotation()[0], null,
AnnotationColourGradient.NO_THRESHOLD);
acg.predefinedColours = true;
{
SequenceGroup sg = getGroup();
- EditNameDialog dialog = new EditNameDialog(sg.getName(),
- sg.getDescription(), " Group Name ",
- "Group Description ", "Edit Group Name/Description",
- ap.alignFrame);
+ EditNameDialog dialog = new EditNameDialog(sg.getName(), sg
+ .getDescription(), " Group Name ", "Group Description ",
+ "Edit Group Name/Description", ap.alignFrame);
if (!dialog.accept)
{
*/
void sequenceName_actionPerformed()
{
- EditNameDialog dialog = new EditNameDialog(sequence.getName(),
- sequence.getDescription(), " Sequence Name ",
+ EditNameDialog dialog = new EditNameDialog(sequence.getName(), sequence
+ .getDescription(), " Sequence Name ",
"Sequence Description ", "Edit Sequence Name/Description",
ap.alignFrame);
caseChange = ChangeCaseCommand.TO_LOWER;
}
- ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
- sg.getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
+ ChangeCaseCommand caseCommand = new ChangeCaseCommand(description, sg
+ .getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
caseChange);
ap.alignFrame.addHistoryItem(caseCommand);
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
cap.setForInput(null);
- Desktop.addInternalFrame(cap,
- "Alignment output - " + e.getActionCommand(), 600, 500);
+ Desktop.addInternalFrame(cap, "Alignment output - "
+ + e.getActionCommand(), 600, 500);
String[] omitHidden = null;
jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new jalview.io.JalviewFileView());
- chooser.setDialogTitle("Select a PDB file for "+sequence.getDisplayId(false));
- chooser.setToolTipText("Load a PDB file and associate it with sequence '"+sequence.getDisplayId(false)+"'");
+ chooser.setDialogTitle("Select a PDB file for "
+ + sequence.getDisplayId(false));
+ chooser
+ .setToolTipText("Load a PDB file and associate it with sequence '"
+ + sequence.getDisplayId(false) + "'");
int value = chooser.showOpenDialog(null);
{
String choice = chooser.getSelectedFile().getPath();
jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
- new AssociatePdbFileWithSeq().associatePdbWithSeq(choice, jalview.io.AppletFormatAdapter.FILE, sequence, true);
+ new AssociatePdbFileWithSeq().associatePdbWithSeq(choice,
+ jalview.io.AppletFormatAdapter.FILE, sequence, true);
}
}
public void colourByStructure(String pdbid)
{
- Annotation[] anots = ap.av.getStructureSelectionManager().colourSequenceFromStructure(
- sequence, pdbid);
+ Annotation[] anots = ap.av.getStructureSelectionManager()
+ .colourSequenceFromStructure(sequence, pdbid);
AlignmentAnnotation an = new AlignmentAnnotation("Structure",
"Coloured by " + pdbid, anots);
if (sequence == null)
sequence = (Sequence) sg.getSequenceAt(0);
- EditNameDialog dialog = new EditNameDialog(
- sequence.getSequenceAsString(sg.getStartRes(),
- sg.getEndRes() + 1), null, "Edit Sequence ", null,
- "Edit Sequence", ap.alignFrame);
+ EditNameDialog dialog = new EditNameDialog(sequence
+ .getSequenceAsString(sg.getStartRes(), sg.getEndRes() + 1),
+ null, "Edit Sequence ", null, "Edit Sequence", ap.alignFrame);
if (dialog.accept)
{
EditCommand editCommand = new EditCommand("Edit Sequences",
EditCommand.REPLACE, dialog.getName().replace(' ',
- ap.av.getGapCharacter()),
- sg.getSequencesAsArray(ap.av.hiddenRepSequences),
- sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
+ ap.av.getGapCharacter()), sg
+ .getSequencesAsArray(ap.av.hiddenRepSequences), sg
+ .getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
ap.alignFrame.addHistoryItem(editCommand);