/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.analysis;
/**
* Sort by Percentage Identity w.r.t. s
- *
+ *
* @param align
* AlignmentI
* @param s
/**
* Sort by Percentage Identity w.r.t. s
- *
+ *
* @param align
* AlignmentI
* @param s
/**
* Reverse the order of the sort
- *
+ *
* @param align
* DOCUMENT ME!
* @param seqs
/**
* Sets the Alignment object with the given sequences
- *
+ *
* @param align
* Alignment object to be updated
* @param tmp
/**
* Sets the Alignment object with the given sequences
- *
+ *
* @param align
* DOCUMENT ME!
* @param seqs
/**
* Sorts by ID. Numbers are sorted before letters.
- *
+ *
* @param align
* The alignment object to sort
*/
/**
* Sorts by sequence length
- *
+ *
* @param align
* The alignment object to sort
*/
for (int i = 0; i < nSeq; i++)
{
seqs[i] = align.getSequenceAt(i);
- length[i] = (float) (seqs[i].getEnd() - seqs[i].getStart());
+ length[i] = (seqs[i].getEnd() - seqs[i].getStart());
}
QuickSort.sort(length, seqs);
* Sorts the alignment by size of group. <br>
* Maintains the order of sequences in each group by order in given alignment
* object.
- *
+ *
* @param align
* sorts the given alignment object by group
*/
// SORTS GROUPS BY SIZE
// ////////////////////
- for (SequenceGroup sg:align.getGroups())
+ for (SequenceGroup sg : align.getGroups())
{
for (int j = 0; j < groups.size(); j++)
{
/**
* Converts Vector to array. java 1.18 does not have Vector.toArray()
- *
+ *
* @param tmp
* Vector of SequenceI objects
- *
+ *
* @return array of Sequence[]
*/
private static SequenceI[] vectorToArray(Vector tmp)
/**
* Sorts by a given AlignmentOrder object
- *
+ *
* @param align
* Alignment to order
* @param order
/**
* DOCUMENT ME!
- *
+ *
* @param align
* alignment to order
* @param tree
* tree which has
- *
+ *
* @return DOCUMENT ME!
*/
private static Vector getOrderByTree(AlignmentI align, NJTree tree)
if (tmp.size() != nSeq)
{
- System.err.println("WARNING: tmp.size()=" + tmp.size() + " != nseq="
- + nSeq + " in getOrderByTree - tree contains sequences not in alignment");
+ System.err
+ .println("WARNING: tmp.size()="
+ + tmp.size()
+ + " != nseq="
+ + nSeq
+ + " in getOrderByTree - tree contains sequences not in alignment");
}
}
/**
* Sorts the alignment by a given tree
- *
+ *
* @param align
* alignment to order
* @param tree
/**
* DOCUMENT ME!
- *
+ *
* @param align
* DOCUMENT ME!
* @param seqs
/**
* DOCUMENT ME!
- *
+ *
* @param node
* DOCUMENT ME!
* @param tmp
* DOCUMENT ME!
* @param seqset
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
private static Vector _sortByTree(SequenceNode node, Vector tmp,
{
if (node.element() instanceof SequenceI)
{
- if (!tmp.contains(node.element())) // && (seqset==null || seqset.size()==0 || seqset.contains(tmp)))
+ if (!tmp.contains(node.element())) // && (seqset==null ||
+ // seqset.size()==0 ||
+ // seqset.contains(tmp)))
{
- tmp.addElement((SequenceI) node.element());
+ tmp.addElement(node.element());
}
}
}
/**
* Sort sequence in order of increasing score attribute for annotation with a
* particular scoreLabel. Or reverse if same label was used previously
- *
+ *
* @param scoreLabel
* exact label for sequence associated AlignmentAnnotation scores to
* use for sorting.
/**
* sort the alignment using the features on each sequence found between start
* and stop with the given featureLabel (and optional group qualifier)
- *
+ *
* @param featureLabel
* (may not be null)
* @param groupLabel
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
* Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
- * \r
+ *\r
* This file is part of Jalview.\r
- * \r
+ *\r
* Jalview is free software: you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License \r
+ * modify it under the terms of the GNU General Public License\r
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
- * \r
- * Jalview is distributed in the hope that it will be useful, but \r
- * WITHOUT ANY WARRANTY; without even the implied warranty \r
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ *\r
+ * Jalview is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty\r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
* PURPOSE. See the GNU General Public License for more details.\r
- * \r
+ *\r
* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.\r
*/\r
package jalview.analysis;\r
/**\r
* Functions for cross-referencing sequence databases. user must first specify\r
* if cross-referencing from protein or dna (set dna==true)\r
- * \r
+ *\r
* @author JimP\r
- * \r
+ *\r
*/\r
public class CrossRef\r
{\r
/**\r
* get the DNA or protein references for a protein or dna sequence\r
- * \r
+ *\r
* @param dna\r
* @param rfs\r
* @return\r
/**\r
* Indirect references are references from other sequences from the dataset to\r
* any of the direct DBRefEntrys on the given sequences.\r
- * \r
+ *\r
* @param dna\r
* true if seqs are DNA seqs\r
* @param seqs\r
}\r
\r
/**\r
- * \r
+ *\r
* @param dna\r
* @param seqs\r
* @return\r
}\r
\r
/**\r
- * \r
+ *\r
* @param seqs\r
* @param dna\r
* @param source\r
* find references to lrfs in the cross-reference set of each sequence in\r
* dataset (that is not equal to sequenceI) Identifies matching DBRefEntry\r
* based on source and accession string only - Map and Version are nulled.\r
- * \r
+ *\r
* @param sequenceI\r
* @param lrfs\r
* @param dataset\r
/**\r
* search a given sequence dataset for references matching cross-references to\r
* the given sequence\r
- * \r
+ *\r
* @param sequenceI\r
* @param xrf\r
* @param dataset\r
* TODO: generalise to different protein classifications Search dataset for\r
* DBRefEntrys matching the given one (xrf) and add the associated sequence to\r
* rseq.\r
- * \r
+ *\r
* @param sequenceI\r
* @param xrf\r
* @param dataset\r
/**\r
* precalculate different products that can be found for seqs in dataset and\r
* return them.\r
- * \r
+ *\r
* @param dna\r
* @param seqs\r
* @param dataset\r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
* Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
- * \r
+ *\r
* This file is part of Jalview.\r
- * \r
+ *\r
* Jalview is free software: you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License \r
+ * modify it under the terms of the GNU General Public License\r
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
- * \r
- * Jalview is distributed in the hope that it will be useful, but \r
- * WITHOUT ANY WARRANTY; without even the implied warranty \r
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ *\r
+ * Jalview is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty\r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
* PURPOSE. See the GNU General Public License for more details.\r
- * \r
+ *\r
* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.\r
*/\r
package jalview.appletgui;\r
int DEFAULT_HEIGHT = 500;\r
\r
String jalviewServletURL;\r
- \r
+\r
\r
public AlignFrame(AlignmentI al, jalview.bin.JalviewLite applet, String title, boolean embedded)\r
{\r
\r
/**\r
* Load a features file onto the alignment\r
- * \r
+ *\r
* @param file file URL, content, or other resolvable path\r
* @param type is protocol for accessing data referred to by file\r
*/\r
{\r
return parseFeaturesFile(file, type, true);\r
}\r
- \r
+\r
/**\r
* Load a features file onto the alignment\r
- * \r
+ *\r
* @param file file URL, content, or other resolvable path\r
* @param type is protocol for accessing data referred to by file\r
* @param autoenabledisplay when true, display features flag will be automatically enabled if features are loaded\r
* @return true if data parsed as a features file\r
*/\r
public boolean parseFeaturesFile(String file, String type, boolean autoenabledisplay)\r
- { \r
+ {\r
// TODO: test if importing a features file onto an alignment which already has features with links overwrites the original links.\r
- \r
+\r
Hashtable featureLinks = new Hashtable();\r
boolean featuresFile = false;\r
try\r
return featuresFile;\r
}\r
\r
+ @Override\r
public void keyPressed(KeyEvent evt)\r
{\r
if (viewport.cursorMode\r
{\r
case 27: // escape key\r
deselectAllSequenceMenuItem_actionPerformed();\r
- \r
- alignPanel.alabels.cancelDrag(); \r
+\r
+ alignPanel.alabels.cancelDrag();\r
break;\r
case KeyEvent.VK_X:\r
if (evt.isControlDown() || evt.isMetaDown())\r
\r
/**\r
* called by key handler and the hide all/show all menu items\r
- * \r
+ *\r
* @param toggleSeqs\r
* @param toggleCols\r
*/\r
}\r
}\r
\r
+ @Override\r
public void keyReleased(KeyEvent evt)\r
{\r
}\r
\r
+ @Override\r
public void keyTyped(KeyEvent evt)\r
{\r
}\r
\r
+ @Override\r
public void itemStateChanged(ItemEvent evt)\r
{\r
if (evt.getSource() == displayNonconservedMenuItem)\r
this.alignPanel.annotationPanel.repaint();\r
}\r
\r
+ @Override\r
public void actionPerformed(ActionEvent evt)\r
{\r
Object source = evt.getSource();\r
jalview.bin.JalviewLite.addFrame(frame, "Paste Annotations ", 400, 300);\r
\r
}\r
- \r
+\r
public String outputAnnotations(boolean displayTextbox)\r
{\r
String annotation = new AnnotationFile().printAnnotations(\r
features = "# No features visible - paste some and import them here.";\r
frimport=true;\r
}\r
- \r
+\r
CutAndPasteTransfer cap = new CutAndPasteTransfer(frimport, this);\r
if (frimport)\r
{\r
/**\r
* TODO: JAL-1104\r
* DOCUMENT ME!\r
- * \r
+ *\r
* @param e\r
* DOCUMENT ME!\r
*/\r
/**\r
* TODO: JAL-1104\r
* DOCUMENT ME!\r
- * \r
+ *\r
* @param e\r
* DOCUMENT ME!\r
*/\r
\r
SequenceI[] seqs2 = invertGroup.toArray(new SequenceI[invertGroup.size()]);\r
for (int i = 0; i < invertGroup.size(); i++)\r
- seqs2[i] = (SequenceI) invertGroup.elementAt(i);\r
+ seqs2[i] = invertGroup.elementAt(i);\r
\r
SlideSequencesCommand ssc;\r
if (right)\r
\r
/**\r
* group consensus toggled\r
- * \r
+ *\r
*/\r
protected void showGroupConsensus_actionPerformed()\r
{\r
\r
/*\r
* (non-Javadoc)\r
- * \r
+ *\r
* @see\r
* jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt\r
* .event.ActionEvent)\r
}\r
/*\r
* (non-Javadoc)\r
- * \r
+ *\r
* @see\r
* jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt\r
* .event.ActionEvent)\r
\r
/**\r
* create a new view derived from the current view\r
- * \r
+ *\r
* @param viewtitle\r
* @return frame for the new view\r
*/\r
}\r
\r
/**\r
- * \r
+ *\r
* @return list of feature groups on the view\r
*/\r
public String[] getFeatureGroups()\r
\r
/**\r
* get sequence feature groups that are hidden or shown\r
- * \r
+ *\r
* @param visible\r
* true is visible\r
* @return list\r
\r
/**\r
* Change the display state for the given feature groups\r
- * \r
+ *\r
* @param groups\r
* list of group strings\r
* @param state\r
final AlignmentPanel ap=alignPanel;\r
frame.addWindowListener(new WindowAdapter()\r
{\r
+ @Override\r
public void windowClosing(WindowEvent e)\r
{\r
if (ap!=null) {\r
\r
cs.setConsensus(viewport.getSequenceConsensusHash());\r
\r
- } \r
+ }\r
viewport.setGlobalColourScheme(cs);\r
\r
\r
\r
/**\r
* sort the alignment using the given treePanel\r
- * \r
+ *\r
* @param treePanel\r
* tree used to sort view\r
* @param title\r
/**\r
* Do any automatic reordering of the alignment and add the necessary bits to\r
* the menu structure for the new tree\r
- * \r
+ *\r
* @param treePanel\r
* @param title\r
*/\r
sortByTreeMenu.add(item);\r
item.addActionListener(new java.awt.event.ActionListener()\r
{\r
+ @Override\r
public void actionPerformed(ActionEvent evt)\r
{\r
sortByTree(treePanel, title); // treePanel.getTitle());\r
}\r
});\r
- \r
+\r
treePanel.addWindowListener(new WindowAdapter()\r
{\r
+ @Override\r
public void windowOpened(WindowEvent e)\r
{\r
if (viewport.sortByTree)\r
super.windowOpened(e);\r
}\r
\r
+ @Override\r
public void windowClosing(WindowEvent e)\r
{\r
sortByTreeMenu.remove(item);\r
this.builddate = builddate;\r
}\r
\r
+ @Override\r
public void paint(Graphics g)\r
{\r
g.setColor(Color.white);\r
MenuItem loadTree = new MenuItem("Load Associated Tree ...");\r
\r
MenuItem loadAnnotations = new MenuItem("Load Features/Annotations ...");\r
- \r
+\r
MenuItem outputFeatures = new MenuItem("Export Features ...");\r
\r
MenuItem outputAnnotations = new MenuItem("Export Annotations ...");\r
\r
MenuItem purinePyrimidineColour = new MenuItem();\r
MenuItem RNAHelixColour = new MenuItem();\r
- \r
+\r
MenuItem userDefinedColour = new MenuItem();\r
\r
MenuItem PIDColour = new MenuItem();\r
\r
MenuItem BLOSUM62Colour = new MenuItem();\r
- \r
+\r
MenuItem tcoffeeColour = new MenuItem();\r
\r
MenuItem njTreeBlosumMenuItem = new MenuItem();\r
CheckboxMenuItem seqLimits = new CheckboxMenuItem();\r
\r
CheckboxMenuItem centreColumnLabelFlag = new CheckboxMenuItem();\r
- \r
+\r
CheckboxMenuItem followMouseOverFlag = new CheckboxMenuItem();\r
Menu autoAnnMenu=new Menu();\r
CheckboxMenuItem showSequenceLogo= new CheckboxMenuItem();\r
\r
item.addActionListener(new java.awt.event.ActionListener()\r
{\r
+ @Override\r
public void actionPerformed(ActionEvent e)\r
{\r
outputText_actionPerformed(e);\r
applyAutoAnnotationSettings.setLabel("Apply to all groups");\r
applyAutoAnnotationSettings.setState(true);\r
autoAnnMenu.setLabel("Autocalculated Annotation");\r
- \r
+\r
invertColSel.addActionListener(this);\r
showColumns.addActionListener(this);\r
showSeqs.addActionListener(this);\r
fileMenu.add(inputText);\r
fileMenu.add(loadTree);\r
fileMenu.add(loadAnnotations);\r
- \r
+\r
fileMenu.addSeparator();\r
fileMenu.add(outputTextboxMenu);\r
fileMenu.add(outputFeatures);\r
* Attach the alignFrame panels after embedding menus, if necessary. This used\r
* to be called setEmbedded, but is now creates the dropdown menus in a\r
* platform independent manner to avoid OSX/Mac menu appendage daftness.\r
- * \r
+ *\r
* @param reallyEmbedded\r
* true to attach the view to the applet area on the page rather than\r
* in a new window\r
final AlignFrame me = this;\r
viewport.applet.addFocusListener(new FocusListener()\r
{\r
- \r
+\r
@Override\r
public void focusLost(FocusEvent e)\r
{\r
if (me.viewport.applet.currentAlignFrame==me) {\r
me.viewport.applet.currentAlignFrame = null;\r
}}\r
- \r
+\r
@Override\r
public void focusGained(FocusEvent e)\r
{\r
* structures in the original jmol window. Note This method doesn't work\r
* without an additional javascript library to exchange messages between the\r
* distinct applets. See http://issues.jalview.org/browse/JAL-621\r
- * \r
+ *\r
* @param viewer\r
* JmolViewer instance\r
* @param sequenceIds\r
}\r
/**\r
* bind a pdb file to a sequence in the current view\r
- * \r
+ *\r
* @param sequenceId\r
* - sequenceId within the dataset.\r
* @param pdbEntryString\r
\r
/**\r
* modify the current selection, providing the user has not made a selection already.\r
- * @param sel - sequences from this alignment \r
+ * @param sel - sequences from this alignment\r
* @param csel - columns to be selected on the alignment\r
*/\r
public void select(SequenceGroup sel, ColumnSelection csel)\r
\r
public void scrollTo(int row, int column)\r
{\r
- alignPanel.seqPanel.scrollTo(row, column); \r
+ alignPanel.seqPanel.scrollTo(row, column);\r
}\r
public void scrollToRow(int row)\r
{\r
- alignPanel.seqPanel.scrollToRow(row); \r
+ alignPanel.seqPanel.scrollToRow(row);\r
}\r
public void scrollToColumn(int column)\r
{\r
- alignPanel.seqPanel.scrollToColumn(column); \r
+ alignPanel.seqPanel.scrollToColumn(column);\r
}\r
/**\r
* @return the alignments unique ID.\r
public String getSequenceSetId() {\r
return viewport.getSequenceSetId();\r
}\r
- \r
- \r
+\r
+\r
/**\r
- * Load the (T-Coffee) score file from the specified url \r
- * \r
+ * Load the (T-Coffee) score file from the specified url\r
+ *\r
* @param source File/URL/T-COFFEE score file contents\r
- * @throws IOException \r
+ * @throws IOException\r
* @return true if alignment was annotated with data from source\r
*/\r
public boolean loadScoreFile( String source ) throws IOException {\r
System.err.println("Origin was:\n"+source);\r
return false;\r
}\r
- \r
+\r
/*\r
* check that the score matrix matches the alignment dimensions\r
*/\r
- AlignmentI aln; \r
+ AlignmentI aln;\r
if( (aln=viewport.getAlignment()) != null && (aln.getHeight() != file.getHeight() || aln.getWidth() != file.getWidth()) ) {\r
// TODO: raise a dialog box here rather than bomb out.\r
System.err.println("The scores matrix does not match the alignment dimensions");\r
- \r
+\r
}\r
- \r
+\r
// TODO add parameter to indicate if matching should be done\r
if (file.annotateAlignment(alignPanel.getAlignment(), false))\r
{\r
}\r
return false;\r
}\r
- \r
- \r
+\r
+\r
}\r
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.appletgui;
import java.awt.*;
import java.awt.event.*;
-import java.awt.font.LineMetrics;
-import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
-import jalview.analysis.AAFrequency;
import jalview.datamodel.*;
import jalview.renderer.AnnotationRenderer;
import jalview.renderer.AwtRenderPanelI;
-import jalview.schemes.ColourSchemeI;
public class AnnotationPanel extends Panel implements AwtRenderPanelI, AdjustmentListener,
ActionListener, MouseListener, MouseMotionListener
final String HELIX = "Helix";
final String SHEET = "Sheet";
-
+
/**
* For RNA secondary structure "stems" aka helices
*/
renderer = new AnnotationRenderer();
}
+ @Override
public void adjustmentValueChanged(AdjustmentEvent evt)
{
}
/**
* DOCUMENT ME!
- *
+ *
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void actionPerformed(ActionEvent evt)
{
AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
return null;
}
+ @Override
public void mousePressed(MouseEvent evt)
{
AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
ap.scalePanel.mousePressed(evt);
}
+ @Override
public void mouseReleased(MouseEvent evt)
{
graphStretch = -1;
ap.scalePanel.mouseReleased(evt);
}
+ @Override
public void mouseClicked(MouseEvent evt)
{
}
boolean needValidating = false;
+ @Override
public void mouseDragged(MouseEvent evt)
{
if (graphStretch > -1)
}
}
+ @Override
public void mouseMoved(MouseEvent evt)
{
AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
}
}
+ @Override
public void mouseEntered(MouseEvent evt)
{
ap.scalePanel.mouseEntered(evt);
}
+ @Override
public void mouseExited(MouseEvent evt)
{
ap.scalePanel.mouseExited(evt);
activeRes.addElement(String.valueOf(i));
}
+ @Override
public void update(Graphics g)
{
paint(g);
}
+ @Override
public void paint(Graphics g)
{
Dimension d = getSize();
/**
* DOCUMENT ME!
- *
+ *
* @param g
* DOCUMENT ME!
* @param startRes
renderer.drawComponent(this, av, g, activeRow, startRes, endRes);
g.translate(0, +scrollOffset);
}
-
+
int scrollOffset = 0;
public void setScrollOffset(int value)
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.appletgui;
/**
* DOCUMENT ME!
- *
+ *
* @author $author$
* @version $Revision$
*/
/**
* DOCUMENT ME!
- *
+ *
* @param comp
* DOCUMENT ME!
* @param al
{
if (comps.elementAt(i) instanceof AlignmentPanel)
{
- tmp.addElement(((AlignmentPanel) comps.elementAt(i)));
+ tmp.addElement(comps.elementAt(i));
}
}
AlignmentPanel[] result = new AlignmentPanel[tmp.size()];
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.commands;
import jalview.datamodel.*;
/**
- *
+ *
* <p>
* Title: EditCommmand
* </p>
- *
+ *
* <p>
* Description: Essential information for performing undo and redo for cut/paste
* insert/delete gap which can be stored in the HistoryList
* </p>
- *
+ *
* <p>
* Copyright: Copyright (c) 2006
* </p>
- *
+ *
* <p>
* Company: Dundee University
* </p>
- *
+ *
* @author not attributable
* @version 1.0
*/
public static final int PASTE = 3;
public static final int REPLACE = 4;
-
+
public static final int INSERT_NUC=5;
Edit[] edits;
performEdit(0, null);
}
+ @Override
final public String getDescription()
{
return description;
}
+ @Override
public int getSize()
{
return edits == null ? 0 : edits.length;
* operation affects more alignment objects than the one referenced in al (for
* example, cut or pasting whole sequences). Use the form with an additional
* AlignmentI[] views parameter.
- *
+ *
* @param command
* @param seqs
* @param position
/**
* append a new edit command with a set of alignment views that may be
* operated on
- *
+ *
* @param command
* @param seqs
* @param position
}
}
+ @Override
final public void doCommand(AlignmentI[] views)
{
performEdit(0, views);
}
+ @Override
final public void undoCommand(AlignmentI[] views)
{
int e = 0, eSize = edits.length;
adjustAnnotations(command, true, false, null);
}
-//
+//
// final void insertNuc(Edit command)
// {
//
* cut addHistoryItem(new EditCommand("Cut Sequences", EditCommand.CUT,
* cut, sg.getStartRes(), sg.getEndRes()-sg.getStartRes()+1,
* viewport.alignment));
- *
+ *
*/
/**
* then addHistoryItem(new EditCommand( "Add sequences",
* EditCommand.PASTE, sequences, 0, alignment.getWidth(), alignment) );
- *
+ *
*/
oldstring = command.seqs[i].getSequenceAsString();
tmp = new StringBuffer(oldstring.substring(0, start));
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.datamodel;
import java.util.*;
-import jalview.analysis.*;
-
/**
* Data structure to hold and manipulate a multiple sequence alignment
*/
/**
* @author JimP
- *
+ *
*/
public class Alignment implements AlignmentI
{
public static final int PROTEIN = 0;
public static final int NUCLEOTIDE = 1;
-
+
public boolean hasRNAStructure = false;
/** DOCUMENT ME!! */
/**
* Make an alignment from an array of Sequences.
- *
+ *
* @param sequences
*/
public Alignment(SequenceI[] seqs)
/**
* Make a new alignment from an array of SeqCigars
- *
+ *
* @param seqs
* SeqCigar[]
*/
* compactAlignment does not contain hidden regions. JBPNote - must also check
* that compactAlignment resolves to a set of SeqCigars - or construct them
* appropriately.
- *
+ *
* @param compactAlignment
* CigarArray
*/
/**
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
@Override
{
return sequences;
}
+
@Override
public List<SequenceI> getSequences(
Map<SequenceI, SequenceCollectionI> hiddenReps)
{
- // TODO: in jalview 2.8 we don't do anything with hiddenreps - fix design to work on this.
+ // TODO: in jalview 2.8 we don't do anything with hiddenreps - fix design to
+ // work on this.
return sequences;
}
+ @Override
public SequenceI[] getSequencesArray()
{
if (sequences == null)
/**
* DOCUMENT ME!
- *
+ *
* @param i
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
+ @Override
public SequenceI getSequenceAt(int i)
{
synchronized (sequences)
/**
* Adds a sequence to the alignment. Recalculates maxLength and size.
- *
+ *
* @param snew
*/
+ @Override
public void addSequence(SequenceI snew)
{
if (dataset != null)
/**
* Adds a sequence to the alignment. Recalculates maxLength and size.
- *
+ *
* @param snew
*/
+ @Override
public void setSequenceAt(int i, SequenceI snew)
{
SequenceI oldseq = getSequenceAt(i);
/**
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
- public Vector getGroups()
+ @Override
+ public List<SequenceGroup> getGroups()
{
return groups;
}
+ @Override
public void finalize()
{
if (getDataset() != null)
/**
* DOCUMENT ME!
- *
+ *
* @param s
* DOCUMENT ME!
*/
+ @Override
public void deleteSequence(SequenceI s)
{
deleteSequence(findIndex(s));
/**
* DOCUMENT ME!
- *
+ *
* @param i
* DOCUMENT ME!
*/
+ @Override
public void deleteSequence(int i)
{
if (i > -1 && i < getHeight())
return null;
}
- /**
- * DOCUMENT ME!
- *
- * @param s
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * jalview.datamodel.AlignmentI#findAllGroups(jalview.datamodel.SequenceI)
*/
+ @Override
public SequenceGroup[] findAllGroups(SequenceI s)
{
ArrayList<SequenceGroup> temp = new ArrayList<SequenceGroup>();
}
/** */
+ @Override
public void addGroup(SequenceGroup sg)
{
synchronized (groups)
/**
* remove any annotation that references gp
- *
+ *
* @param gp
* (if null, removes all group associated annotation)
*/
}
}
+ @Override
public void deleteAllGroups()
{
synchronized (groups)
}
/** */
+ @Override
public void deleteGroup(SequenceGroup g)
{
synchronized (groups)
}
/** */
+ @Override
public SequenceI findName(String name)
{
return findName(name, false);
/*
* (non-Javadoc)
- *
+ *
* @see jalview.datamodel.AlignmentI#findName(java.lang.String, boolean)
*/
+ @Override
public SequenceI findName(String token, boolean b)
{
return findName(null, token, b);
/*
* (non-Javadoc)
- *
+ *
* @see jalview.datamodel.AlignmentI#findName(SequenceI, java.lang.String,
* boolean)
*/
+ @Override
public SequenceI findName(SequenceI startAfter, String token, boolean b)
{
return null;
}
+ @Override
public SequenceI[] findSequenceMatch(String name)
{
Vector matches = new Vector();
/*
* (non-Javadoc)
- *
+ *
* @see jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SequenceI)
*/
+ @Override
public int findIndex(SequenceI s)
{
int i = 0;
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SearchResults)
*/
+ @Override
public int findIndex(SearchResults results)
{
int i = 0;
/**
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
+ @Override
public int getHeight()
{
return sequences.size();
/**
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
+ @Override
public int getWidth()
{
int maxLength = -1;
/**
* DOCUMENT ME!
- *
+ *
* @param gc
* DOCUMENT ME!
*/
+ @Override
public void setGapCharacter(char gc)
{
gapCharacter = gc;
/**
* DOCUMENT ME!
- *
+ *
* @return DOCUMENT ME!
*/
+ @Override
public char getGapCharacter()
{
return gapCharacter;
/*
* (non-Javadoc)
- *
+ *
* @see jalview.datamodel.AlignmentI#isAligned()
*/
+ @Override
public boolean isAligned()
{
return isAligned(false);
/*
* (non-Javadoc)
- *
+ *
* @see jalview.datamodel.AlignmentI#isAligned(boolean)
*/
+ @Override
public boolean isAligned(boolean includeHidden)
{
int width = getWidth();
/*
* (non-Javadoc)
- *
+ *
* @seejalview.datamodel.AlignmentI#deleteAnnotation(jalview.datamodel.
* AlignmentAnnotation)
*/
+ @Override
public boolean deleteAnnotation(AlignmentAnnotation aa)
{
return deleteAnnotation(aa, true);
}
-
+
+ @Override
public boolean deleteAnnotation(AlignmentAnnotation aa, boolean unhook)
{
int aSize = 1;
if (swap)
{
annotations = temp;
- if (unhook) {
+ if (unhook)
+ {
unhookAnnotation(aa);
}
}
/**
* remove any object references associated with this annotation
- *
+ *
* @param aa
*/
private void unhookAnnotation(AlignmentAnnotation aa)
/*
* (non-Javadoc)
- *
+ *
* @seejalview.datamodel.AlignmentI#addAnnotation(jalview.datamodel.
* AlignmentAnnotation)
*/
+ @Override
public void addAnnotation(AlignmentAnnotation aa)
{
addAnnotation(aa, -1);
/*
* (non-Javadoc)
- *
+ *
* @seejalview.datamodel.AlignmentI#addAnnotation(jalview.datamodel.
* AlignmentAnnotation, int)
*/
+ @Override
public void addAnnotation(AlignmentAnnotation aa, int pos)
{
- if(aa.getRNAStruc()!= null){
- hasRNAStructure=true;
+ if (aa.getRNAStruc() != null)
+ {
+ hasRNAStructure = true;
}
-
+
int aSize = 1;
if (annotations != null)
{
annotations = temp;
}
+ @Override
public void setAnnotationIndex(AlignmentAnnotation aa, int index)
{
if (aa == null || annotations == null || annotations.length - 1 < index)
return annotations;
}
+ @Override
public void setNucleotide(boolean b)
{
if (b)
}
}
+ @Override
public boolean isNucleotide()
{
if (type == NUCLEOTIDE)
return false;
}
}
-
- public boolean hasRNAStructure(){
- //TODO can it happen that structure is removed from alignment?
+
+ @Override
+ public boolean hasRNAStructure()
+ {
+ // TODO can it happen that structure is removed from alignment?
return hasRNAStructure;
}
+ @Override
public void setDataset(Alignment data)
{
if (dataset == null && data == null)
currentSeq = getSequenceAt(i);
if (currentSeq.getDatasetSequence() != null)
{
- seqs[i] = (Sequence) currentSeq.getDatasetSequence();
+ seqs[i] = currentSeq.getDatasetSequence();
}
else
{
alignmentRefs++;
}
+ @Override
public Alignment getDataset()
{
return dataset;
}
+ @Override
public boolean padGaps()
{
boolean modified = false;
/**
* Justify the sequences to the left or right by deleting and inserting gaps
* before the initial residue or after the terminal residue
- *
+ *
* @param right
* true if alignment padded to right, false to justify to left
* @return true if alignment was changed
*/
+ @Override
public boolean justify(boolean right)
{
boolean modified = false;
return modified;
}
+ @Override
public HiddenSequences getHiddenSequences()
{
return hiddenSequences;
}
+ @Override
public CigarArray getCompactAlignment()
{
synchronized (sequences)
alignmentProperties.put(key, value);
}
+ @Override
public Object getProperty(Object key)
{
if (alignmentProperties != null)
return null;
}
+ @Override
public Hashtable getProperties()
{
return alignmentProperties;
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.datamodel.AlignmentI#addCodonFrame(jalview.datamodel.AlignedCodonFrame
* )
*/
+ @Override
public void addCodonFrame(AlignedCodonFrame codons)
{
if (codons == null)
/*
* (non-Javadoc)
- *
+ *
* @see jalview.datamodel.AlignmentI#getCodonFrame(int)
*/
+ @Override
public AlignedCodonFrame getCodonFrame(int index)
{
return codonFrameList[index];
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.datamodel.AlignmentI#getCodonFrame(jalview.datamodel.SequenceI)
*/
+ @Override
public AlignedCodonFrame[] getCodonFrame(SequenceI seq)
{
if (seq == null || codonFrameList == null)
/*
* (non-Javadoc)
- *
+ *
* @see jalview.datamodel.AlignmentI#getCodonFrames()
*/
+ @Override
public AlignedCodonFrame[] getCodonFrames()
{
return codonFrameList;
/*
* (non-Javadoc)
- *
+ *
* @seejalview.datamodel.AlignmentI#removeCodonFrame(jalview.datamodel.
* AlignedCodonFrame)
*/
+ @Override
public boolean removeCodonFrame(AlignedCodonFrame codons)
{
if (codons == null || codonFrameList == null)
return removed;
}
+ @Override
public void append(AlignmentI toappend)
{
if (toappend == this)
List<SequenceGroup> sg = toappend.getGroups();
if (sg != null)
{
- for (SequenceGroup _sg:sg)
+ for (SequenceGroup _sg : sg)
{
addGroup(_sg);
}
}
@Override
- public AlignmentAnnotation findOrCreateAnnotation(String name, boolean autoCalc,
- SequenceI seqRef, SequenceGroup groupRef)
+ public AlignmentAnnotation findOrCreateAnnotation(String name,
+ boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef)
{
- for (AlignmentAnnotation annot :
- getAlignmentAnnotation())
+ for (AlignmentAnnotation annot : getAlignmentAnnotation())
{
if (annot.autoCalculated == autoCalc
&& annot.getCalcId().equals(name)
@Override
public Iterable<AlignmentAnnotation> findAnnotation(String calcId)
{
- ArrayList<AlignmentAnnotation> aa=new ArrayList<AlignmentAnnotation>();
- for (AlignmentAnnotation a:getAlignmentAnnotation())
+ ArrayList<AlignmentAnnotation> aa = new ArrayList<AlignmentAnnotation>();
+ for (AlignmentAnnotation a : getAlignmentAnnotation())
{
- if (a.getCalcId()==calcId || (a.getCalcId()!=null && calcId!=null && a.getCalcId().equals(calcId)))
+ if (a.getCalcId() == calcId
+ || (a.getCalcId() != null && calcId != null && a.getCalcId()
+ .equals(calcId)))
{
aa.add(a);
}
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.datamodel;
{
/**
* Calculates the number of sequences in an alignment
- *
+ *
* @return Number of sequences in alignment
*/
public int getHeight();
/**
* Calculates the maximum width of the alignment, including gaps.
- *
+ *
* @return Greatest sequence length within alignment.
*/
+ @Override
public int getWidth();
/**
* Calculates if this set of sequences (visible and invisible) are all the
* same length
- *
+ *
* @return true if all sequences in alignment are the same length
*/
public boolean isAligned();
/**
* Calculates if this set of sequences is all the same length
- *
+ *
* @param includeHidden
* optionally exclude hidden sequences from test
* @return true if all (or just visible) sequences are the same length
/**
* Gets sequences as a SequenceI[]
- *
+ *
* @return All sequences in alignment.
*/
public SequenceI[] getSequencesArray();
/**
* Find a specific sequence in this alignment.
- *
+ *
* @param i
* Index of required sequence.
- *
+ *
* @return SequenceI at given index.
*/
public SequenceI getSequenceAt(int i);
/**
* Add a new sequence to this alignment.
- *
+ *
* @param seq
* New sequence will be added at end of alignment.
*/
public void addSequence(SequenceI seq);
+
/**
* Used to set a particular index of the alignment with the given sequence.
- *
+ *
* @param i
* Index of sequence to be updated.
* @param seq
/**
* Deletes a sequence from the alignment
- *
+ *
* @param s
* Sequence to be deleted.
*/
/**
* Deletes a sequence from the alignment.
- *
+ *
* @param i
* Index of sequence to be deleted.
*/
/**
* Finds sequence in alignment using sequence name as query.
- *
+ *
* @param name
* Id of sequence to search for.
- *
+ *
* @return Sequence matching query, if found. If not found returns null.
*/
public SequenceI findName(String name);
/**
* Finds index of a given sequence in the alignment.
- *
+ *
* @param s
* Sequence to look for.
- *
+ *
* @return Index of sequence within the alignment or -1 if not found
*/
public int findIndex(SequenceI s);
/**
* Finds group that given sequence is part of.
- *
+ *
* @param s
* Sequence in alignment.
- *
+ *
* @return First group found for sequence. WARNING : Sequences may be members
* of several groups. This method is incomplete.
*/
/**
* Finds all groups that a given sequence is part of.
- *
+ *
* @param s
* Sequence in alignment.
- *
+ *
* @return All groups containing given sequence.
*/
public SequenceGroup[] findAllGroups(SequenceI s);
/**
* Adds a new SequenceGroup to this alignment.
- *
+ *
* @param sg
* New group to be added.
*/
/**
* Deletes a specific SequenceGroup
- *
+ *
* @param g
* Group will be deleted from alignment.
*/
/**
* Get all the groups associated with this alignment.
- *
+ *
* @return All groups as a list.
*/
public List<SequenceGroup> getGroups();
/**
* Adds a new AlignmentAnnotation to this alignment
- *
+ *
* @note Care should be taken to ensure that annotation is at least as wide as
* the longest sequence in the alignment for rendering purposes.
*/
/**
* moves annotation to a specified index in alignment annotation display stack
- *
+ *
* @param aa
* the annotation object to be moved
* @param index
* reference from any SequenceI or SequenceGroup object's annotation if and
* only if aa is contained within the alignment's annotation vector.
* Otherwise, it will do nothing.
- *
+ *
* @param aa
* the annotation to delete
* @return true if annotation was deleted from this alignment.
* removes any reference from any SequenceI or SequenceGroup object's
* annotation if and only if aa is contained within the alignment's annotation
* vector. Otherwise, it will do nothing.
- *
+ *
* @param aa
* the annotation to delete
* @param unhook
/**
* Get the annotation associated with this alignment (this can be null if no
* annotation has ever been created on the alignment)
- *
+ *
* @return array of AlignmentAnnotation objects
*/
+ @Override
public AlignmentAnnotation[] getAlignmentAnnotation();
/**
* Change the gap character used in this alignment to 'gc'
- *
+ *
* @param gc
* the new gap character.
*/
/**
* Get the gap character used in this alignment
- *
+ *
* @return gap character
*/
public char getGapCharacter();
/**
* Test for all nucleotide alignment
- *
+ *
* @return true if alignment is nucleotide sequence
*/
public boolean isNucleotide();
/**
* Test if alignment contains RNA structure
- *
+ *
* @return true if RNA structure AligmnentAnnotation was added to alignment
*/
public boolean hasRNAStructure();
/**
* Set alignment to be a nucleotide sequence
- *
+ *
*/
public void setNucleotide(boolean b);
/**
* Get the associated dataset for the alignment.
- *
+ *
* @return Alignment containing dataset sequences or null of this is a
* dataset.
*/
/**
* Set the associated dataset for the alignment, or create one.
- *
+ *
* @param dataset
* The dataset alignment or null to construct one.
*/
/**
* pads sequences with gaps (to ensure the set looks like an alignment)
- *
+ *
* @return boolean true if alignment was modified
*/
public boolean padGaps();
/**
* Compact representation of alignment
- *
+ *
* @return CigarArray
*/
public CigarArray getCompactAlignment();
/**
* Set an arbitrary key value pair for an alignment. Note: both key and value
* objects should return a meaningful, human readable response to .toString()
- *
+ *
* @param key
* @param value
*/
/**
* Get a named property from the alignment.
- *
+ *
* @param key
* @return value of property
*/
/**
* Get the property hashtable.
- *
+ *
* @return hashtable of alignment properties (or null if none are defined)
*/
public Hashtable getProperties();
/**
* add a reference to a frame of aligned codons for this alignment
- *
+ *
* @param codons
*/
public void addCodonFrame(AlignedCodonFrame codons);
/**
* remove a particular codon frame reference from this alignment
- *
+ *
* @param codons
* @return true if codon frame was removed.
*/
/**
* get all codon frames associated with this alignment
- *
+ *
* @return
*/
public AlignedCodonFrame[] getCodonFrames();
/**
* get a particular codon frame
- *
+ *
* @param index
* @return
*/
/**
* find sequence with given name in alignment
- *
+ *
* @param token
* name to find
* @param b
/**
* find next sequence with given name in alignment starting after a given
* sequence
- *
+ *
* @param startAfter
* the sequence after which the search will be started (usually the
* result of the last call to findName)
/**
* find first sequence in alignment which is involved in the given search
* result object
- *
+ *
* @param results
* @return -1 or index of sequence in alignment
*/
* gap characters, etc...). If you are uncertain, use the copy Alignment copy
* constructor to create a new version which can be appended without side
* effect.
- *
+ *
* @param toappend
* - the alignment to be appended.
*/
/**
* Justify the sequences to the left or right by deleting and inserting gaps
* before the initial residue or after the terminal residue
- *
+ *
* @param right
* true if alignment padded to right, false to justify to left
* @return true if alignment was changed TODO: return undo object
/**
* add given annotation row at given position (0 is start, -1 is end)
- *
+ *
* @param consensus
* @param i
*/
/**
* search for or create a specific annotation row on the alignment
- *
+ *
* @param method - CalcId for the annotation (must match)
* @param autoCalc - value of autocalc flag for the annotation
* @param seqRef - null or specific sequence reference
- * @param groupRef - null or specific group reference
- * @return existing annotation matching the given attributes
+ * @param groupRef - null or specific group reference
+ * @return existing annotation matching the given attributes
*/
public AlignmentAnnotation findOrCreateAnnotation(String name, boolean autoCalc,
SequenceI seqRef, SequenceGroup groupRef);
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.datamodel;
alignment.deleteSequence(sequence);
}
- public Vector showAll(Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ public Vector showAll(
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
{
Vector revealedSeqs = new Vector();
for (int i = 0; i < hiddenSequences.length; i++)
return revealedSeqs;
}
- public Vector showSequence(int alignmentIndex, Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ public Vector showSequence(int alignmentIndex,
+ Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
{
Vector revealedSeqs = new Vector();
SequenceI repSequence = alignment.getSequenceAt(alignmentIndex);
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.gui;
/**
* DOCUMENT ME!
- *
+ *
* @author $author$
* @version $Revision$
*/
AlignViewport viewport;
Vector alignPanels = new Vector();
-
+
/**
* Last format used to load or save alignments in this window
*/
/**
* Creates a new AlignFrame object with specific width and height.
- *
+ *
* @param al
* @param width
* @param height
/**
* Creates a new AlignFrame object with specific width, height and
* sequenceSetId
- *
+ *
* @param al
* @param width
* @param height
/**
* Creates a new AlignFrame object with specific width, height and
* sequenceSetId
- *
+ *
* @param al
* @param width
* @param height
/**
* new alignment window with hidden columns
- *
+ *
* @param al
* AlignmentI
* @param hiddenColumns
/**
* Create alignment frame for al with hiddenColumns, a specific width and
* height, and specific sequenceId
- *
+ *
* @param al
* @param hiddenColumns
* @param width
/**
* Create alignment frame for al with hiddenColumns, a specific width and
* height, and specific sequenceId
- *
+ *
* @param al
* @param hiddenColumns
* @param width
/**
* Make a new AlignFrame from exisiting alignmentPanels
- *
+ *
* @param ap
* AlignmentPanel
* @param av
/**
* Change the filename and format for the alignment, and enable the 'reload'
* button functionality.
- *
+ *
* @param file
* valid filename
* @param format
{
addKeyListener(new KeyAdapter()
{
+ @Override
public void keyPressed(KeyEvent evt)
{
if (viewport.cursorMode
}
}
+ @Override
public void keyReleased(KeyEvent evt)
{
switch (evt.getKeyCode())
Desktop.instance.addJalviewPropertyChangeListener("services",
thisListener = new java.beans.PropertyChangeListener()
{
+ @Override
public void propertyChange(PropertyChangeEvent evt)
{
// // System.out.println("Discoverer property change.");
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
System.err
});
addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
+ @Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
{
// Finally, build the menu once to get current service state
new Thread(new Runnable()
{
+ @Override
public void run()
{
BuildWebServiceMenu();
/**
* Need to call this method when tabs are selected for multiple views, or when
* loading from Jalview2XML.java
- *
+ *
* @param av
* AlignViewport
*/
/*
* (non-Javadoc)
- *
+ *
* @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long)
*/
+ @Override
public void setProgressBar(String message, long id)
{
if (progressBars == null)
validate();
}
+ @Override
public void registerHandler(final long id,
final IProgressIndicatorHandler handler)
{
cancel.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
handler.cancelActivity(id);
}
/**
- *
+ *
* @return true if any progress bars are still active
*/
public boolean operationInProgress()
return alignPanel.seqPanel.seqCanvas.getFeatureRenderer();
}
+ @Override
public void fetchSequence_actionPerformed(ActionEvent e)
{
new SequenceFetcher(this);
}
+ @Override
public void addFromFile_actionPerformed(ActionEvent e)
{
Desktop.instance.inputLocalFileMenuItem_actionPerformed(viewport);
}
+ @Override
public void reload_actionPerformed(ActionEvent e)
{
if (fileName != null)
final FeatureSettings nfs = newframe.featureSettings;
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
nfs.frame.setBounds(fspos);
}
}
+ @Override
public void addFromText_actionPerformed(ActionEvent e)
{
Desktop.instance.inputTextboxMenuItem_actionPerformed(viewport);
}
+ @Override
public void addFromURL_actionPerformed(ActionEvent e)
{
Desktop.instance.inputURLMenuItem_actionPerformed(viewport);
}
+ @Override
public void save_actionPerformed(ActionEvent e)
{
if (fileName == null
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void saveAs_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
FormatAdapter f = new FormatAdapter();
String output = f.formatSequences(
format,
- (Alignment) viewport.getAlignment(), // class cast exceptions will
+ viewport.getAlignment(), // class cast exceptions will
// occur in the distant future
omitHidden, f.getCacheSuffixDefault(format),
viewport.getColumnSelection());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void outputText_actionPerformed(ActionEvent e)
{
String[] omitHidden = null;
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void htmlMenuItem_actionPerformed(ActionEvent e)
{
new HTMLOutput(alignPanel,
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void createPNG(File f)
{
alignPanel.makePNG(f);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void createEPS(File f)
{
alignPanel.makeEPS(f);
}
+ @Override
public void pageSetup_actionPerformed(ActionEvent e)
{
PrinterJob printJob = PrinterJob.getPrinterJob();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void printMenuItem_actionPerformed(ActionEvent e)
{
// Putting in a thread avoids Swing painting problems
thread.start();
}
+ @Override
public void exportFeatures_actionPerformed(ActionEvent e)
{
new AnnotationExporter().exportFeatures(alignPanel);
}
+ @Override
public void exportAnnotations_actionPerformed(ActionEvent e)
{
new AnnotationExporter().exportAnnotations(alignPanel,
.getAlignment()).alignmentProperties);
}
+ @Override
public void associatedData_actionPerformed(ActionEvent e)
{
// Pick the tree file
/**
* Close the current view or all views in the alignment frame. If the frame
* only contains one view then the alignment will be removed from memory.
- *
+ *
* @param closeAllTabs
*/
+ @Override
public void closeMenuItem_actionPerformed(boolean closeAllTabs)
{
if (alignPanels != null && alignPanels.size() < 2)
/**
* close alignPanel2 and shuffle tabs appropriately.
- *
+ *
* @param alignPanel2
*/
public void closeView(AlignmentPanel alignPanel2)
}
/**
- *
+ *
* @return alignment objects for all views
*/
AlignmentI[] getViewAlignments()
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void undoMenuItem_actionPerformed(ActionEvent e)
{
if (viewport.historyList.empty())
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void redoMenuItem_actionPerformed(ActionEvent e)
{
if (viewport.redoList.size() < 1)
/**
* DOCUMENT ME!
- *
+ *
* @param up
* DOCUMENT ME!
*/
}
SequenceI[] seqs1 = sg.toArray(new SequenceI[0]);
-
+
SequenceI[] seqs2 = new SequenceI[invertGroup.size()];
for (int i = 0; i < invertGroup.size(); i++)
seqs2[i] = (SequenceI) invertGroup.elementAt(i);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void copy_actionPerformed(ActionEvent e)
{
System.gc();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void pasteNew_actionPerformed(ActionEvent e)
{
paste(true);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void pasteThis_actionPerformed(ActionEvent e)
{
paste(false);
/**
* Paste contents of Jalview clipboard
- *
+ *
* @param newAlignment
* true to paste to a new alignment, otherwise add to this.
*/
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void cut_actionPerformed(ActionEvent e)
{
copy_actionPerformed(null);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void delete_actionPerformed(ActionEvent evt)
{
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void deleteGroups_actionPerformed(ActionEvent e)
{
viewport.getAlignment().deleteAllGroups();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
{
SequenceGroup sg = new SequenceGroup();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
{
if (viewport.cursorMode)
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void invertSequenceMenuItem_actionPerformed(ActionEvent e)
{
SequenceGroup sg = viewport.getSelectionGroup();
viewport.sendSelection();
}
+ @Override
public void invertColSel_actionPerformed(ActionEvent e)
{
viewport.invertColumnSelection();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void remove2LeftMenuItem_actionPerformed(ActionEvent e)
{
trimAlignment(true);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void remove2RightMenuItem_actionPerformed(ActionEvent e)
{
trimAlignment(false);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
{
int start = 0, end = viewport.getAlignment().getWidth() - 1;
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
{
int start = 0, end = viewport.getAlignment().getWidth() - 1;
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void padGapsMenuitem_actionPerformed(ActionEvent e)
{
viewport.setPadGaps(padGapsMenuitem.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void findMenuItem_actionPerformed(ActionEvent e)
{
new Finder();
}
+ @Override
public void newView_actionPerformed(ActionEvent e)
{
newView(true);
}
/**
- *
+ *
* @param copyAnnotation
* if true then duplicate all annnotation, groups and settings
* @return new alignment panel, already displayed.
}
/**
- *
+ *
* @param viewTitle
* title of newly created view
* @return new alignment panel, already displayed.
}
/**
- *
+ *
* @param viewTitle
* title of newly created view
* @param copyAnnotation
return newap;
}
+ @Override
public void expandViews_actionPerformed(ActionEvent e)
{
Desktop.instance.explodeViews(this);
}
+ @Override
public void gatherViews_actionPerformed(ActionEvent e)
{
Desktop.instance.gatherViews(this);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void font_actionPerformed(ActionEvent e)
{
new FontChooser(alignPanel);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void seqLimit_actionPerformed(ActionEvent e)
{
viewport.setShowJVSuffix(seqLimits.isSelected());
alignPanel.paintAlignment(true);
}
+ @Override
public void idRightAlign_actionPerformed(ActionEvent e)
{
viewport.rightAlignIds = idRightAlign.isSelected();
alignPanel.paintAlignment(true);
}
+ @Override
public void centreColumnLabels_actionPerformed(ActionEvent e)
{
viewport.centreColumnLabels = centreColumnLabelsMenuItem.getState();
/*
* (non-Javadoc)
- *
+ *
* @see jalview.jbgui.GAlignFrame#followHighlight_actionPerformed()
*/
+ @Override
protected void followHighlight_actionPerformed()
{
if (viewport.followHighlight = this.followHighlightMenuItem.getState())
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void colourTextMenuItem_actionPerformed(ActionEvent e)
{
viewport.setColourText(colourTextMenuItem.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void wrapMenuItem_actionPerformed(ActionEvent e)
{
scaleAbove.setVisible(wrapMenuItem.isSelected());
alignPanel.setWrapAlignment(wrapMenuItem.isSelected());
}
+ @Override
public void showAllSeqs_actionPerformed(ActionEvent e)
{
viewport.showAllHiddenSeqs();
}
+ @Override
public void showAllColumns_actionPerformed(ActionEvent e)
{
viewport.showAllHiddenColumns();
repaint();
}
+ @Override
public void hideSelSequences_actionPerformed(ActionEvent e)
{
viewport.hideAllSelectedSeqs();
/**
* called by key handler and the hide all/show all menu items
- *
+ *
* @param toggleSeqs
* @param toggleCols
*/
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#hideAllButSelection_actionPerformed(java.awt.
* event.ActionEvent)
*/
+ @Override
public void hideAllButSelection_actionPerformed(ActionEvent e)
{
toggleHiddenRegions(false, false);
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#hideAllSelection_actionPerformed(java.awt.event
* .ActionEvent)
*/
+ @Override
public void hideAllSelection_actionPerformed(ActionEvent e)
{
SequenceGroup sg = viewport.getSelectionGroup();
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#showAllhidden_actionPerformed(java.awt.event.
* ActionEvent)
*/
+ @Override
public void showAllhidden_actionPerformed(ActionEvent e)
{
viewport.showAllHiddenColumns();
alignPanel.paintAlignment(true);
}
+ @Override
public void hideSelColumns_actionPerformed(ActionEvent e)
{
viewport.hideSelectedColumns();
alignPanel.paintAlignment(true);
}
+ @Override
public void hiddenMarkers_actionPerformed(ActionEvent e)
{
viewport.setShowHiddenMarkers(hiddenMarkers.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void scaleAbove_actionPerformed(ActionEvent e)
{
viewport.setScaleAboveWrapped(scaleAbove.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void scaleLeft_actionPerformed(ActionEvent e)
{
viewport.setScaleLeftWrapped(scaleLeft.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void scaleRight_actionPerformed(ActionEvent e)
{
viewport.setScaleRightWrapped(scaleRight.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void viewBoxesMenuItem_actionPerformed(ActionEvent e)
{
viewport.setShowBoxes(viewBoxesMenuItem.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void viewTextMenuItem_actionPerformed(ActionEvent e)
{
viewport.setShowText(viewTextMenuItem.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
{
viewport.setRenderGaps(renderGapsMenuItem.isSelected());
public FeatureSettings featureSettings;
+ @Override
public void featureSettings_actionPerformed(ActionEvent e)
{
if (featureSettings != null)
/**
* Set or clear 'Show Sequence Features'
- *
+ *
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void showSeqFeatures_actionPerformed(ActionEvent evt)
{
viewport.setShowSequenceFeatures(showSeqFeatures.isSelected());
/**
* Set or clear 'Show Sequence Features'
- *
+ *
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void showSeqFeaturesHeight_actionPerformed(ActionEvent evt)
{
viewport.setShowSequenceFeaturesHeight(showSeqFeaturesHeight
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void annotationPanelMenuItem_actionPerformed(ActionEvent e)
{
viewport.setShowAnnotation(annotationPanelMenuItem.isSelected());
alignPanel.setAnnotationVisible(annotationPanelMenuItem.isSelected());
}
+ @Override
public void alignmentProperties()
{
JEditorPane editPane = new JEditorPane("text/html", "");
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void overviewMenuItem_actionPerformed(ActionEvent e)
{
if (alignPanel.overviewPanel != null)
frame.setLayer(JLayeredPane.PALETTE_LAYER);
frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
+ @Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
{
alignPanel.setOverviewPanel(overview);
}
+ @Override
public void textColour_actionPerformed(ActionEvent e)
{
new TextColourChooser().chooseColour(alignPanel, null);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void noColourmenuItem_actionPerformed(ActionEvent e)
{
changeColour(null);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void clustalColour_actionPerformed(ActionEvent e)
{
changeColour(new ClustalxColourScheme(viewport.getAlignment(), viewport.getHiddenRepSequences()));
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void zappoColour_actionPerformed(ActionEvent e)
{
changeColour(new ZappoColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void taylorColour_actionPerformed(ActionEvent e)
{
changeColour(new TaylorColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void hydrophobicityColour_actionPerformed(ActionEvent e)
{
changeColour(new HydrophobicColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void helixColour_actionPerformed(ActionEvent e)
{
changeColour(new HelixColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void strandColour_actionPerformed(ActionEvent e)
{
changeColour(new StrandColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void turnColour_actionPerformed(ActionEvent e)
{
changeColour(new TurnColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void buriedColour_actionPerformed(ActionEvent e)
{
changeColour(new BuriedColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void nucleotideColour_actionPerformed(ActionEvent e)
{
changeColour(new NucleotideColourScheme());
}
+ @Override
public void purinePyrimidineColour_actionPerformed(ActionEvent e)
{
changeColour(new PurinePyrimidineColourScheme());
* CovariationColourScheme(viewport.getAlignment().getAlignmentAnnotation
* ()[0])); }
*/
+ @Override
public void annotationColour_actionPerformed(ActionEvent e)
{
new AnnotationColourChooser(viewport, alignPanel);
}
+ @Override
public void rnahelicesColour_actionPerformed(ActionEvent e)
{
new RNAHelicesColourChooser(viewport, alignPanel);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void applyToAllGroups_actionPerformed(ActionEvent e)
{
viewport.setColourAppliesToAllGroups(applyToAllGroups.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param cs
* DOCUMENT ME!
*/
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void modifyPID_actionPerformed(ActionEvent e)
{
if (viewport.getAbovePIDThreshold()
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void modifyConservation_actionPerformed(ActionEvent e)
{
if (viewport.getConservationSelected()
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void conservationMenuItem_actionPerformed(ActionEvent e)
{
viewport.setConservationSelected(conservationMenuItem.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void abovePIDThreshold_actionPerformed(ActionEvent e)
{
viewport.setAbovePIDThreshold(abovePIDThreshold.isSelected());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void userDefinedColour_actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("User Defined..."))
radioItem.setName("USER_DEFINED");
radioItem.addMouseListener(new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent evt)
{
if (evt.isControlDown()
{
radioItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
userDefinedColour_actionPerformed(evt);
});
radioItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
userDefinedColour_actionPerformed(evt);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void PIDColour_actionPerformed(ActionEvent e)
{
changeColour(new PIDColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void BLOSUM62Colour_actionPerformed(ActionEvent e)
{
changeColour(new Blosum62ColourScheme());
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void sortIDMenuItem_actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void sortLengthMenuItem_actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void sortGroupMenuItem_actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
{
new RedundancyPanel(alignPanel, this);
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
{
if ((viewport.getSelectionGroup() == null)
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void PCAMenuItem_actionPerformed(ActionEvent e)
{
if (((viewport.getSelectionGroup() != null)
new PCAPanel(alignPanel);
}
+ @Override
public void autoCalculate_actionPerformed(ActionEvent e)
{
viewport.autoCalculateConsensus = autoCalculate.isSelected();
}
}
+ @Override
public void sortByTreeOption_actionPerformed(ActionEvent e)
{
viewport.sortByTree = sortByTree.isSelected();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void averageDistanceTreeMenuItem_actionPerformed(ActionEvent e)
{
NewTreePanel("AV", "PID", "Average distance tree using PID");
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void neighbourTreeMenuItem_actionPerformed(ActionEvent e)
{
NewTreePanel("NJ", "PID", "Neighbour joining tree using PID");
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void njTreeBlosumMenuItem_actionPerformed(ActionEvent e)
{
NewTreePanel("NJ", "BL", "Neighbour joining tree using BLOSUM62");
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void avTreeBlosumMenuItem_actionPerformed(ActionEvent e)
{
NewTreePanel("AV", "BL", "Average distance tree using BLOSUM62");
/**
* DOCUMENT ME!
- *
+ *
* @param type
* DOCUMENT ME!
* @param pwType
/**
* DOCUMENT ME!
- *
+ *
* @param title
* DOCUMENT ME!
* @param order
sort.add(item);
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
/**
* Add a new sort by annotation score menu item
- *
+ *
* @param sort
* the menu to add the option to
* @param scoreLabel
sort.add(item);
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
* search the alignment and rebuild the sort by annotation score submenu the
* last alignment annotation vector hash is stored to minimize cost of
* rebuilding in subsequence calls.
- *
+ *
*/
+ @Override
public void buildSortByAnnotationScoresMenu()
{
if (viewport.getAlignment().getAlignmentAnnotation() == null)
* call. Listeners are added to remove the menu item when the treePanel is
* closed, and adjust the tree leaf to sequence mapping when the alignment is
* modified.
- *
+ *
* @param treePanel
* Displayed tree window.
* @param title
* SortBy menu item title.
*/
+ @Override
public void buildTreeMenu()
{
sortByTreeMenu.removeAll();
final NJTree tree = ((TreePanel) treePanels.elementAt(i)).getTree();
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
tp.sortByTree_actionPerformed(null);
/**
* Work out whether the whole set of sequences or just the selected set will
* be submitted for multiple alignment.
- *
+ *
*/
public jalview.datamodel.AlignmentView gatherSequencesForAlignment()
{
/*
* SequenceGroup seqs = viewport.getSelectionGroup(); int sz; msa = new
* SequenceI[sz = seqs.getSize(false)];
- *
+ *
* for (int i = 0; i < sz; i++) { msa[i] = (SequenceI)
* seqs.getSequenceAt(i); }
*/
{
/*
* Vector seqs = viewport.getAlignment().getSequences();
- *
+ *
* if (seqs.size() > 1) { msa = new SequenceI[seqs.size()];
- *
+ *
* for (int i = 0; i < seqs.size(); i++) { msa[i] = (SequenceI)
* seqs.elementAt(i); } }
*/
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void LoadtreeMenuItem_actionPerformed(ActionEvent e)
{
// Pick the tree file
/**
* Add a treeviewer for the tree extracted from a newick file object to the
* current alignment view
- *
+ *
* @param nf
* the tree
* @param title
/**
* Generates menu items and listener event actions for web service clients
- *
+ *
*/
public void BuildWebServiceMenu()
{
buildingMenu = true;
new Thread(new Runnable()
{
+ @Override
public void run()
{
try
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
try
{
for (int i = 0, j = wsmenu.size(); i < j; i++)
{
- webService.add((JMenu) wsmenu.get(i));
+ webService.add(wsmenu.get(i));
}
}
else
/**
* construct any groupURL type service menu entries.
- *
+ *
* @param webService
*/
private void build_urlServiceMenu(JMenu webService)
/*
* JMenuItem testAlView = new JMenuItem("Test AlignmentView"); final
* AlignFrame af = this; testAlView.addActionListener(new ActionListener() {
- *
+ *
* @Override public void actionPerformed(ActionEvent e) {
* jalview.datamodel.AlignmentView
* .testSelectionViews(af.viewport.getAlignment(),
* af.viewport.getColumnSelection(), af.viewport.selectionGroup); }
- *
+ *
* }); webService.add(testAlView);
*/
// TODO: refactor to RestClient discoverer and merge menu entries for
* public void vamsasStore_actionPerformed(ActionEvent e) { JalviewFileChooser
* chooser = new JalviewFileChooser(jalview.bin.Cache.
* getProperty("LAST_DIRECTORY"));
- *
+ *
* chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Export
* to Vamsas file"); chooser.setToolTipText("Export");
- *
+ *
* int value = chooser.showSaveDialog(this);
- *
+ *
* if (value == JalviewFileChooser.APPROVE_OPTION) {
* jalview.io.VamsasDatastore vs = new jalview.io.VamsasDatastore(viewport);
* //vs.store(chooser.getSelectedFile().getAbsolutePath() ); vs.storeJalview(
*/
/**
* prototype of an automatically enabled/disabled analysis function
- *
+ *
*/
protected void setShowProductsEnabled()
{
/**
* search selection for sequence xRef products and build the show products
* menu.
- *
+ *
* @param selection
* @param dataset
* @return true if showProducts menu should be enabled.
xtype.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
// TODO: new thread for this call with vis-delay
Runnable foo = new Runnable()
{
+ @Override
public void run()
{
final long sttime = System.currentTimeMillis();
}
}
+ @Override
public void showProducts_actionPerformed(ActionEvent e)
{
// /////////////////////////////
}
}
+ @Override
public void showTranslation_actionPerformed(ActionEvent e)
{
// /////////////////////////////
/**
* Try to load a features file onto the alignment.
- *
+ *
* @param file
* contents or path to retrieve file
* @param type
return featuresFile;
}
+ @Override
public void dragEnter(DropTargetDragEvent evt)
{
}
+ @Override
public void dragExit(DropTargetEvent evt)
{
}
+ @Override
public void dragOver(DropTargetDragEvent evt)
{
}
+ @Override
public void dropActionChanged(DropTargetDragEvent evt)
{
}
+ @Override
public void drop(DropTargetDropEvent evt)
{
Transferable t = evt.getTransferable();
* it's and Annotation file, then a JNet file, and finally a features file. If
* all are false then the user may have dropped an alignment file onto this
* AlignFrame.
- *
+ *
* @param file
* either a filename or a URL string.
*/
{
/*
* if (format.equalsIgnoreCase("PDB")) {
- *
+ *
* String pdbfn = ""; // try to match up filename with sequence id
* try { if (protocol == jalview.io.FormatAdapter.FILE) { File fl =
* new File(file); pdbfn = fl.getName(); } else if (protocol ==
}
}
+ @Override
public void tabSelectionChanged(int index)
{
if (index > -1)
}
}
+ @Override
public void tabbedPane_mousePressed(MouseEvent e)
{
if (SwingUtilities.isRightMouseButton(e))
/**
* Open the dialog for regex description parsing.
*/
+ @Override
protected void extractScores_actionPerformed(ActionEvent e)
{
ParseProperties pp = new jalview.analysis.ParseProperties(
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#showDbRefs_actionPerformed(java.awt.event.ActionEvent
* )
*/
+ @Override
protected void showDbRefs_actionPerformed(ActionEvent e)
{
viewport.setShowDbRefs(showDbRefsMenuitem.isSelected());
/*
* (non-Javadoc)
- *
+ *
* @seejalview.jbgui.GAlignFrame#showNpFeats_actionPerformed(java.awt.event.
* ActionEvent)
*/
+ @Override
protected void showNpFeats_actionPerformed(ActionEvent e)
{
viewport.setShowNpFeats(showNpFeatsMenuitem.isSelected());
/**
* find the viewport amongst the tabs in this alignment frame and close that
* tab
- *
+ *
* @param av
*/
public boolean closeView(AlignViewport av)
fetchr.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
new jalview.ws.DBRefFetcher(alignPanel.av
final AlignFrame me = this;
new Thread(new Runnable()
{
+ @Override
public void run()
{
final jalview.ws.SequenceFetcher sf = SequenceFetcher
.getSequenceFetcherSingleton(me);
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
String[] dbclasses = sf.getOrderedSupportedSources();
fetchr.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
new jalview.ws.DBRefFetcher(alignPanel.av
+ "'");
fetchr.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
new jalview.ws.DBRefFetcher(alignPanel.av
fetchr.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
new jalview.ws.DBRefFetcher(alignPanel.av
/**
* Left justify the whole alignment.
*/
+ @Override
protected void justifyLeftMenuItem_actionPerformed(ActionEvent e)
{
AlignmentI al = viewport.getAlignment();
/**
* Right justify the whole alignment.
*/
+ @Override
protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
{
AlignmentI al = viewport.getAlignment();
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#showUnconservedMenuItem_actionPerformed(java.
* awt.event.ActionEvent)
*/
+ @Override
protected void showUnconservedMenuItem_actionPerformed(ActionEvent e)
{
viewport.setShowUnconserved(showNonconservedMenuItem.getState());
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#showGroupConsensus_actionPerformed(java.awt.event
* .ActionEvent)
*/
+ @Override
protected void showGroupConsensus_actionPerformed(ActionEvent e)
{
viewport.setShowGroupConsensus(showGroupConsensus.getState());
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#showGroupConservation_actionPerformed(java.awt
* .event.ActionEvent)
*/
+ @Override
protected void showGroupConservation_actionPerformed(ActionEvent e)
{
viewport.setShowGroupConservation(showGroupConservation.getState());
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt
* .event.ActionEvent)
*/
+ @Override
protected void showConsensusHistogram_actionPerformed(ActionEvent e)
{
viewport.setShowConsensusHistogram(showConsensusHistogram.getState());
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt
* .event.ActionEvent)
*/
+ @Override
protected void showSequenceLogo_actionPerformed(ActionEvent e)
{
viewport.setShowSequenceLogo(showSequenceLogo.getState());
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
+ @Override
protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
{
viewport.setNormaliseSequenceLogo(normaliseSequenceLogo.getState());
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
+ @Override
protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
{
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
/*
* (non-Javadoc)
- *
+ *
* @see
* jalview.jbgui.GAlignFrame#makeGrpsFromSelection_actionPerformed(java.awt
* .event.ActionEvent)
*/
+ @Override
protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
{
if (viewport.getSelectionGroup() != null)
/**
* make the given alignmentPanel the currently selected tab
- *
+ *
* @param alignmentPanel
*/
public void setDisplayedView(AlignmentPanel alignmentPanel)
static PageFormat pf;
+ @Override
public void run()
{
PrinterJob printJob = PrinterJob.getPrinterJob();
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.gui;
/**
* DOCUMENT ME!
- *
+ *
* @author $author$
* @version $Revision$
*/
/**
* Creates a new IdPanel object.
- *
+ *
* @param av
* DOCUMENT ME!
* @param parent
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mouseMoved(MouseEvent e)
{
SeqPanel sp = alignPanel.seqPanel;
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mouseDragged(MouseEvent e)
{
mouseDragging = true;
alignPanel.paintAlignment(true);
}
+ @Override
public void mouseWheelMoved(MouseWheelEvent e)
{
e.consume();
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mouseClicked(MouseEvent e)
{
if (e.getClickCount() < 2)
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mouseEntered(MouseEvent e)
{
if (scrollThread != null)
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mouseExited(MouseEvent e)
{
if (av.getWrapAlignment())
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mousePressed(MouseEvent e)
{
if (e.getClickCount() == 2)
/**
* DOCUMENT ME!
- *
+ *
* @param seq
* DOCUMENT ME!
*/
/**
* DOCUMENT ME!
- *
+ *
* @param start
* DOCUMENT ME!
* @param end
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mouseReleased(MouseEvent e)
{
if (scrollThread != null)
/**
* DOCUMENT ME!
- *
+ *
* @param list
* DOCUMENT ME!
*/
return;
}
- int index = av.getAlignment().findIndex((SequenceI) list.get(0));
+ int index = av.getAlignment().findIndex(list.get(0));
// do we need to scroll the panel?
if ((av.getStartSeq() > index) || (av.getEndSeq() < index))
running = false;
}
+ @Override
public void run()
{
running = true;
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.gui;
import org.exolab.castor.xml.*;
-import uk.ac.vamsas.objects.utils.MapList;
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.SequenceI;
import jalview.schemabinding.version2.*;
import jalview.schemes.*;
-import jalview.structure.StructureSelectionManager;
import jalview.util.Platform;
import jalview.util.jarInputStreamProvider;
/**
* Write out the current jalview desktop state as a Jalview XML stream.
- *
+ *
* Note: the vamsas objects referred to here are primitive versions of the
* VAMSAS project schema elements - they are not the same and most likely never
* will be :)
- *
+ *
* @author $author$
* @version $Revision: 1.134 $
*/
{
/**
* create/return unique hash string for sq
- *
+ *
* @param sq
* @return new or existing unique string for sq
*/
/**
* Writes a jalview project archive to the given Jar output stream.
- *
+ *
* @param jout
*/
public void SaveState(JarOutputStream jout)
/**
* create a JalviewModel from an algnment view and marshall it to a
* JarOutputStream
- *
+ *
* @param ap
* panel to create jalview model for
* @param fileName
{
annotationIds.put(aa[i].annotationId, aa[i]);
}
-
+
an.setId(aa[i].annotationId);
an.setVisible(aa[i].visible);
an.setDescription(aa[i].description);
-
+
if (aa[i].sequenceRef != null)
{
// TODO later annotation sequenceRef should be the XML ID of the
/**
* Construct a unique ID for jvobj using either existing bindings or if none
* exist, the result of the hashcode call for the object.
- *
+ *
* @param jvobj
* jalview data object
* @return unique ID for referring to jvobj
/**
* return local jalview object mapped to ID, if it exists
- *
+ *
* @param idcode
* (may be null)
* @return null or object bound to idcode
/**
* Load a jalview project archive from a jar file
- *
+ *
* @param file
* - HTTP URL or filename
*/
return new jarInputStreamProvider()
{
+ @Override
public JarInputStream getJarInputStream() throws IOException
{
if (_url != null)
}
}
+ @Override
public String getFilename()
{
return file;
* initialise uniqueSetSuffix, seqRefIds, viewportsAdded and frefedSequence
* themselves. Any null fields will be initialised with default values,
* non-null fields are left alone.
- *
+ *
* @param jprovider
* @return
*/
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
* Currently (28th Sep 2008) things will go horribly wrong in vamsas document
* sync if this is set to true.
*/
- private boolean updateLocalViews = false;
+ private final boolean updateLocalViews = false;
String loadPDBFile(jarInputStreamProvider jprovider, String pdbId)
{
/**
* Load alignment frame from jalview XML DOM object
- *
+ *
* @param object
* DOM
* @param file
if (seqRefIds.get(seqId) != null)
{
- tmpseqs.add((jalview.datamodel.Sequence) seqRefIds.get(seqId));
+ tmpseqs.add(seqRefIds.get(seqId));
multipleView = true;
}
else
hiddenSeqs = new Vector();
}
- hiddenSeqs.addElement((jalview.datamodel.Sequence) seqRefIds
+ hiddenSeqs.addElement(seqRefIds
.get(seqId));
}
jaa.belowAlignment=an[i].isBelowAlignment();
}
jaa.setCalcId(an[i].getCalcId());
-
+
if (jaa.autoCalculated)
{
autoAlan.add(new JvAnnotRow(i, jaa));
// file }, orig_fileloc, SequenceI[][] {{ seqs_file 1 }, {
// seqs_file 2}, boolean[] {
// linkAlignPanel,superposeWithAlignpanel}} from hash
- Object[] jmoldat = (Object[]) jmolViewIds.get(sviewid);
+ Object[] jmoldat = jmolViewIds.get(sviewid);
((boolean[]) jmoldat[3])[0] |= ids[p].getStructureState(s)
.hasAlignwithAlignPanel() ? ids[p].getStructureState(
s).getAlignwithAlignPanel() : false;
newFileLoc.append(Platform.escapeString((String) filedat[0]));
pdbfilenames.addElement((String) filedat[0]);
pdbids.addElement((String) filedat[1]);
- seqmaps.addElement((SequenceI[]) ((Vector<SequenceI>) filedat[2])
+ seqmaps.addElement(((Vector<SequenceI>) filedat[2])
.toArray(new SequenceI[0]));
newFileLoc.append("\"");
cp = ecp + 1; // advance beyond last \" and set cursor so we can
newFileLoc.append(((String) filedat[0]));
pdbfilenames.addElement((String) filedat[0]);
pdbids.addElement((String) filedat[1]);
- seqmaps.addElement((SequenceI[]) ((Vector<SequenceI>) filedat[2])
+ seqmaps.addElement(((Vector<SequenceI>) filedat[2])
.toArray(new SequenceI[0]));
newFileLoc.append(" \"");
newFileLoc.append((String) filedat[0]);
// TODO: assemble String[] { pdb files }, String[] { id for each
// file }, orig_fileloc, SequenceI[][] {{ seqs_file 1 }, {
// seqs_file 2}} from hash
- final String[] pdbf = (String[]) pdbfilenames
- .toArray(new String[pdbfilenames.size()]), id = (String[]) pdbids
+ final String[] pdbf = pdbfilenames
+ .toArray(new String[pdbfilenames.size()]), id = pdbids
.toArray(new String[pdbids.size()]);
- final SequenceI[][] sq = (SequenceI[][]) seqmaps
+ final SequenceI[][] sq = seqmaps
.toArray(new SequenceI[seqmaps.size()][]);
final String fileloc = newFileLoc.toString(), vid = sviewid;
final AlignFrame alf = af;
{
javax.swing.SwingUtilities.invokeAndWait(new Runnable()
{
+ @Override
public void run()
{
AppJmol sview = null;
// viewer
Object[] filedat = oldFiles.get(id);
String pdbFile = (String) filedat[0];
- SequenceI[] seq = (SequenceI[]) ((Vector<SequenceI>) filedat[2])
+ SequenceI[] seq = ((Vector<SequenceI>) filedat[2])
.toArray(new SequenceI[0]);
- ((AppJmol) comp).jmb.ssm.setMapping(seq, null, pdbFile,
+ comp.jmb.ssm.setMapping(seq, null, pdbFile,
jalview.io.AppletFormatAdapter.FILE);
- ((AppJmol) comp).jmb.addSequenceForStructFile(pdbFile, seq);
+ comp.jmb.addSequenceForStructFile(pdbFile, seq);
}
// and add the AlignmentPanel's reference to the Jmol view
- ((AppJmol) comp).addAlignmentPanel(ap);
+ comp.addAlignmentPanel(ap);
if (useinJmolsuperpos)
{
- ((AppJmol) comp).useAlignmentPanelForSuperposition(ap);
+ comp.useAlignmentPanelForSuperposition(ap);
}
else
{
- ((AppJmol) comp).excludeAlignmentPanelForSuperposition(ap);
+ comp.excludeAlignmentPanelForSuperposition(ap);
}
if (usetoColourbyseq)
{
- ((AppJmol) comp).useAlignmentPanelForColourbyseq(ap,
+ comp.useAlignmentPanelForColourbyseq(ap,
!jmolColouring);
}
else
{
- ((AppJmol) comp).excludeAlignmentPanelForColourbyseq(ap);
+ comp.excludeAlignmentPanelForColourbyseq(ap);
}
}
}
/**
* TODO remove this method
- *
+ *
* @param view
* @return AlignFrame bound to sequenceSetId from view, if one exists. private
* AlignFrame getSkippedFrame(Viewport view) { if (skipList==null) {
/**
* Check if the Jalview view contained in object should be skipped or not.
- *
+ *
* @param object
* @return true if view's sequenceSetId is a key in skipList
*/
}
/**
- *
+ *
* @param vamsasSeq
* sequence definition to create/merge dataset sequence for
* @param ds
jalview.datamodel.SequenceI dsq = null;
if (sq != null && sq.getDatasetSequence() != null)
{
- dsq = (jalview.datamodel.SequenceI) sq.getDatasetSequence();
+ dsq = sq.getDatasetSequence();
}
String sqid = vamsasSeq.getDsseqid();
/**
* make a new dataset ID for this jalview dataset alignment
- *
+ *
* @param dataset
* @return
*/
* flag indicating if hashtables should be cleared on finalization TODO this
* flag may not be necessary
*/
- private boolean _cleartables = true;
+ private final boolean _cleartables = true;
private Hashtable jvids2vobj;
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#finalize()
*/
+ @Override
protected void finalize() throws Throwable
{
// really make sure we have no buried refs left.
* finalize and clearSeqRefs will not clear the tables when the Jalview2XML
* object goes out of scope. - also populates the datasetIds hashtable with
* alignment objects containing dataset sequences
- *
+ *
* @param vobj2jv
* Map from ID strings to jalview datamodel
* @param jv2vobj
* Map from jalview datamodel to ID strings
- *
- *
+ *
+ *
*/
public void setObjectMappingTables(Hashtable vobj2jv,
IdentityHashMap jv2vobj)
* set the uniqueSetSuffix used to prefix/suffix object IDs for jalview
* objects created from the project archive. If string is null (default for
* construction) then suffix will be set automatically.
- *
+ *
* @param string
*/
public void setUniqueSetSuffix(String string)
/**
* uses skipList2 as the skipList for skipping views on sequence sets
* associated with keys in the skipList
- *
+ *
* @param skipList2
*/
public void setSkipList(Hashtable skipList2)
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.gui;
/**
* DOCUMENT ME!
- *
+ *
* @author $author$
* @version $Revision$
*/
/**
* DOCUMENT ME!
- *
+ *
* @param comp
* DOCUMENT ME!
* @param al
{
if (comps.elementAt(i) instanceof AlignmentPanel)
{
- tmp.addElement(((AlignmentPanel) comps.elementAt(i)));
+ tmp.addElement(comps.elementAt(i));
}
}
AlignmentPanel[] result = new AlignmentPanel[tmp.size()];
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.gui;
/**
* DOCUMENT ME!
- *
+ *
* @author $author$
* @version $Revision: 1.130 $
*/
/**
* Creates a new SeqPanel object.
- *
+ *
* @param avp
* DOCUMENT ME!
* @param p
void setCursorPosition()
{
- SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt(
+ SequenceI sequence = av.getAlignment().getSequenceAt(
seqCanvas.cursorY);
seqCanvas.cursorX = sequence.findIndex(getKeyboardNo1() - 1);
void setSelectionAreaAtCursor(boolean topLeft)
{
- SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt(
+ SequenceI sequence = av.getAlignment().getSequenceAt(
seqCanvas.cursorY);
if (av.getSelectionGroup() != null)
editSequence(false, false, seqCanvas.cursorX);
endEditing();
}
-
+
void insertNucAtCursor(boolean group,String nuc){
groupEditing = group;
startseq = seqCanvas.cursorY;
/**
* DOCUMENT ME!
- *
+ *
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void mouseReleased(MouseEvent evt)
{
mouseDragging = false;
/**
* DOCUMENT ME!
- *
+ *
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void mousePressed(MouseEvent evt)
{
lastMousePress = evt.getPoint();
String lastMessage;
+ @Override
public void mouseOverSequence(SequenceI sequence, int index, int pos)
{
String tmp = sequence.hashCode() + " " + index + " " + pos;
lastMessage = tmp;
}
+ @Override
public void highlightSequence(SearchResults results)
{
if (av.followHighlight)
seqCanvas.highlightSearchResults(results);
}
+ @Override
public void updateColours(SequenceI seq, int index)
{
System.out.println("update the seqPanel colours");
/**
* DOCUMENT ME!
- *
+ *
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void mouseMoved(MouseEvent evt)
{
if (editingSeqs)
/**
* appends the features at rpos to the given stringbuffer ready for display in
* a tooltip
- *
+ *
* @param tooltipText2
* @param linkImageURL
* @param rpos
/**
* Set status message in alignment panel
- *
+ *
* @param sequence
* aligned sequence object
* @param res
/**
* DOCUMENT ME!
- *
+ *
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void mouseDragged(MouseEvent evt)
{
if (mouseWheelPressed)
SequenceI[] groupSeqs = new SequenceI[groupSize];
for (g = 0; g < groupSeqs.length; g++)
{
- groupSeqs[g] = (SequenceI) vseqs.get(g);
+ groupSeqs[g] = vseqs.get(g);
}
// drag to right
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mouseEntered(MouseEvent e)
{
if (oldSeq < 0)
/**
* DOCUMENT ME!
- *
+ *
* @param e
* DOCUMENT ME!
*/
+ @Override
public void mouseExited(MouseEvent e)
{
if (av.getWrapAlignment())
}
}
+ @Override
public void mouseClicked(MouseEvent evt)
{
SequenceGroup sg = null;
}
}
+ @Override
public void mouseWheelMoved(MouseWheelEvent e)
{
e.consume();
/**
* DOCUMENT ME!
- *
+ *
* @param evt
* DOCUMENT ME!
*/
return;
}
- SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt(seq);
+ SequenceI sequence = av.getAlignment().getSequenceAt(seq);
if ((sequence == null) || (res > sequence.getLength()))
{
/**
* DOCUMENT ME!
- *
+ *
* @param evt
* DOCUMENT ME!
*/
/**
* DOCUMENT ME!
- *
+ *
* @param evt
* DOCUMENT ME!
*/
running = false;
}
+ @Override
public void run()
{
running = true;
/**
* modify current selection according to a received message.
*/
+ @Override
public void selection(SequenceGroup seqsel, ColumnSelection colsel,
SelectionSource source)
{
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.gui;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.MutableTreeNode;
-import javax.swing.tree.TreeModel;
-
import jalview.datamodel.*;
import jalview.io.*;
import jalview.util.DBRefUtils;
import jalview.ws.dbsources.das.api.DasSourceRegistryI;
import jalview.ws.seqfetcher.DbSourceProxy;
-import jalview.ws.seqfetcher.DbSourceProxyImpl;
-
import java.awt.BorderLayout;
public class SequenceFetcher extends JPanel implements Runnable
/**
* Blocking method that initialises and returns the shared instance of the
* SequenceFetcher client
- *
+ *
* @param guiWindow
* - where the initialisation delay message should be shown
* @return the singleton instance of the sequence fetcher client
Thread sf = new Thread(new Runnable()
{
+ @Override
public void run()
{
if (getSequenceFetcherSingleton(guiWindow) != null)
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
JOptionPane
/**
* called by thread spawned by constructor
- *
+ *
* @param guiWindow
*/
private void initGui(IProgressIndicator guiWindow)
ok.setText("OK");
ok.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
ok_actionPerformed();
clear.setText("Clear");
clear.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
clear_actionPerformed();
example.setText("Example");
example.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
example_actionPerformed();
close.setText("Close");
close.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
close_actionPerformed(e);
textArea.setLineWrap(true);
textArea.addKeyListener(new KeyAdapter()
{
+ @Override
public void keyPressed(KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_ENTER)
database.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
try
close.setEnabled(true);
}
+ @Override
public void run()
{
String error = "";
}
/**
- *
+ *
* @return a standard title for any results retrieved using the currently
* selected source and settings
*/
resetDialog();
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
JOptionPane.showInternalMessageDialog(Desktop.desktop, error,
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.io;
import jalview.bin.Cache;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.AlignmentView;
-import jalview.datamodel.DBRefEntry;
import jalview.datamodel.GraphLine;
-import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
import jalview.io.vamsas.DatastoreItem;
import jalview.io.vamsas.DatastoreRegistry;
import jalview.io.vamsas.Rangetype;
-import jalview.util.UrlLink;
-
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import uk.ac.vamsas.objects.utils.Properties;
/*
- *
+ *
* static {
* org.exolab.castor.util.LocalConfiguration.getInstance().getProperties().setProperty(
* "org.exolab.castor.serializer", "org.apache.xml.serialize.XMLSerilazizer"); }
- *
+ *
*/
/*
- * TODO: check/verify consistency for vamsas sync with group associated alignment annotation
+ * TODO: check/verify consistency for vamsas sync with group associated alignment annotation
*/
public class VamsasAppDatastore
{
}
/**
- *
+ *
* @param vobj
* @return Jalview datamodel object bound to the vamsas document object
*/
/**
* put the alignment viewed by AlignViewport into cdoc.
- *
+ *
* @param av
* alignViewport to be stored
* @param aFtitle
/*
* We do not put local Alignment Sequence Features into the vamsas
* document yet.
- *
- *
+ *
+ *
* jalview.datamodel.SequenceFeature[] features = alseq
* .getSequenceFeatures(); for (int f = 0; f < features.length; f++) {
* if (features[f] != null) { AlignmentSequenceAnnotation valseqf = (
* AlignmentSequenceAnnotation) getjv2vObj(features[i]); if (valseqf
* == null) {
- *
+ *
* valseqf = (AlignmentSequenceAnnotation) getDSAnnotationFromJalview(
* new AlignmentSequenceAnnotation(), features[i]);
* valseqf.setGraph(false);
* very quick test to see if the viewport would be stored in the vamsas
* document. Reasons for not storing include the unaligned flag being false
* (for all sequences, including the hidden ones!)
- *
+ *
* @param av
* @return true if alignment associated with this view will be stored in
* document.
/**
* remove docseqs from the given alignment marking provenance appropriately
* and removing any references to the sequences.
- *
+ *
* @param alignment
* @param docseqs
*/
* vamsas alignment sequence for jvalsq and adds it to the alignment if
* necessary. unbounddocseq is a duplicate of the vamsas alignment sequences
* and these are removed after being processed w.r.t a bound jvalsq
- *
+ *
*/
private boolean syncToAlignmentSequence(SequenceI jvalsq,
Alignment alignment, Vector unbounddocseq)
/**
* set vamsas annotation object type from jalview annotation
- *
+ *
* @param an
* @param alan
*/
/**
* get start<end range of segment, adjusting for inclusivity flag and
* polarity.
- *
+ *
* @param visSeg
* @param ensureDirection
* when true - always ensure start is less than end.
}
/**
- *
+ *
* @param annotation
* @return true if annotation is not to be stored in document
*/
/**
* list of alignment views created when updating Jalview from document.
*/
- private Vector newAlignmentViews = new Vector();
+ private final Vector newAlignmentViews = new Vector();
/**
* update local jalview view settings from the stored appdata (if any)
jalview.util.jarInputStreamProvider jprovider = new jalview.util.jarInputStreamProvider()
{
+ @Override
public String getFilename()
{
return "Jalview Vamsas Document Client Data";
}
+ @Override
public JarInputStream getJarInputStream() throws IOException
{
jalview.bin.Cache.log
jalview.util.jarInputStreamProvider jarstream = new jalview.util.jarInputStreamProvider()
{
+ @Override
public String getFilename()
{
return "Jalview Vamsas Document User Data";
}
+ @Override
public JarInputStream getJarInputStream() throws IOException
{
jalview.bin.Cache.log
/**
* replaces oldjvobject with newjvobject in the Jalview Object <> VorbaID
* binding tables
- *
+ *
* @param oldjvobject
* @param newjvobject
* (may be null)
/**
* translate the Vobject keys to strings for use in Jalview2XML
- *
+ *
* @param jv2vobj2
* @return
*/
/**
* translate the Vobject values to strings for use in Jalview2XML
- *
+ *
* @param vobj2jv2
* @return hashtable with string values
*/
/**
* synchronize Jalview from the vamsas document
- *
+ *
* @return number of new views from document
*/
public int updateToJalview()
* jalview.datamodel.Annotation[] rows Two annotation rows are made if there
* are distinct annotation for both at 'pos' and 'after pos' at any particular
* site.
- *
+ *
* @param annotation
* @return { boolean[static int constants ], int[ae.length] - map to annotated
* object frame, jalview.datamodel.Annotation[],
* get real bounds of a RangeType's specification. start and end are an
* inclusive range within which all segments and positions lie. TODO: refactor
* to vamsas utils
- *
+ *
* @param dseta
* @return int[] { start, end}
*/
/**
* map from a rangeType's internal frame to the referenced object's coordinate
* frame.
- *
+ *
* @param dseta
* @return int [] { ref(pos)...} for all pos in rangeType's frame.
*/
}
/**
- *
+ *
* @param maprange
* where the from range is the local mapped range, and the to range
* is the 'mapped' range in the MapRangeType
/**
* initialise a range type object from a set of start/end inclusive intervals
- *
+ *
* @param mrt
* @param range
*/
/**
* initialise a MapType object from a MapList object.
- *
+ *
* @param maprange
* @param ml
* @param setUnits
* App and Action here. Provenance prov = new Provenance();
* org.exolab.castor.types.Date date = new org.exolab.castor.types.Date( new
* java.util.Date()); Entry provEntry;
- *
+ *
* if (jprov != null) { entries = jprov.getEntries(); for (int i = 0; i <
* entries.length; i++) { provEntry = new Entry(); try { date = new
* org.exolab.castor.types.Date(entries[i].getDate()); } catch (Exception ex)
* { ex.printStackTrace();
- *
+ *
* date = new org.exolab.castor.types.Date(entries[i].getDate()); }
* provEntry.setDate(date); provEntry.setUser(entries[i].getUser());
* provEntry.setAction(entries[i].getAction()); prov.addEntry(provEntry); } }
* provEntry.setUser(System.getProperty("user.name")); // TODO: ext string
* provEntry.setApp("JVAPP"); // TODO: ext string provEntry.setAction(action);
* prov.addEntry(provEntry); }
- *
+ *
* return prov; }
*/
jalview.datamodel.Provenance getJalviewProvenance(Provenance prov)
}
/**
- *
+ *
* @return default initial provenance list for a Jalview created vamsas
* object.
*/
/*
* 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
- *
+ *
* 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
+ * 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
+ *
+ * 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.io.vamsas;
import java.util.Vector;
import jalview.analysis.NJTree;
-import jalview.analysis.SequenceIdMatcher;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.datamodel.SequenceNode;
-import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
import jalview.gui.TreePanel;
import jalview.io.NewickFile;
/*
* (non-Javadoc)
- *
+ *
* @see jalview.io.vamsas.DatastoreItem#addFromDocument()
*/
+ @Override
public void addFromDocument()
{
tree = (uk.ac.vamsas.objects.core.Tree) vobj; // vtree;
/*
* (non-Javadoc)
- *
+ *
* @see jalview.io.vamsas.DatastoreItem#conflict()
*/
+ @Override
public void conflict()
{
Cache.log
/*
* (non-Javadoc)
- *
+ *
* @see jalview.io.vamsas.DatastoreItem#update()
*/
+ @Override
public void updateToDoc()
{
if (isModifiable(tree.getModifiable()))
/*
* (non-Javadoc)
- *
+ *
* @see jalview.io.vamsas.DatastoreItem#updateFromDoc()
*/
+ @Override
public void updateFromDoc()
{
// should probably just open a new tree panel in the same place as the old
// TODO: Tree.updateFromDoc
/*
* TreePanel tp = (TreePanel) jvobj; // getvObj2jv(tree);
- *
+ *
* // make a new tree Object[] idata =
* recoverInputData(tree.getProvenance()); try { if (idata != null &&
* idata[0] != null) { inputData = (AlignmentView) idata[0]; } ntree =
/**
* correctly creates provenance for trees calculated on an alignment by
* jalview.
- *
+ *
* @param jal
* @param tp
* @return
/**
* look up SeqCigars in an existing alignment.
- *
+ *
* @param jal
* @param sequences
* @return vector of alignment sequences in order of SeqCigar array (but
alsq.add(asq);
}
}
- }
+ }}
if (alsq.size() < sequences.length)
Cache.log
.warn("Not recovered all alignment sequences for given set of input sequence CIGARS");
}
/**
- *
+ *
* Update jalview newick representation with TreeNode map
- *
+ *
* @param tp
* the treepanel that this tree is bound to.
*/
// / TODO: refactor to vamsas :start
/**
* construct treenode mappings for mapped sequences
- *
+ *
* @param ntree
* @param newick
* @return
/**
* call to match up Treenode specs to NJTree parsed from document object.
- *
+ *
* @param nodespec
* @param leaves
* as returned from NJTree.findLeaves( .., ..) ..
// todo: end refactor to vamsas library
/**
* add jalview object to vamsas document
- *
+ *
*/
+ @Override
public void addToDocument()
{
tree = new uk.ac.vamsas.objects.core.Tree();
/**
* note: this function assumes that all sequence and alignment objects
* referenced in input data has already been associated with jalview objects.
- *
+ *
* @param tp
* @param alignFrame
* @return Object[] { AlignmentView, AlignmentI - reference alignment for