From f52f7b378972cc884b5d3e5cc250f89667f558f7 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 13 Jun 2012 09:09:08 +0100 Subject: [PATCH] javatidy --- src/jalview/analysis/AlignmentSorter.java | 72 ++--- src/jalview/analysis/CrossRef.java | 36 +-- src/jalview/appletgui/AlignFrame.java | 129 +++++---- src/jalview/appletgui/AnnotationPanel.java | 40 +-- src/jalview/appletgui/PaintRefresher.java | 22 +- src/jalview/commands/EditCommand.java | 42 +-- src/jalview/datamodel/Alignment.java | 188 +++++++----- src/jalview/datamodel/AlignmentI.java | 123 ++++---- src/jalview/datamodel/HiddenSequences.java | 22 +- src/jalview/gui/AlignFrame.java | 431 +++++++++++++++++++--------- src/jalview/gui/IdPanel.java | 51 ++-- src/jalview/gui/Jalview2XML.java | 107 +++---- src/jalview/gui/PaintRefresher.java | 22 +- src/jalview/gui/SeqPanel.java | 65 +++-- src/jalview/gui/SequenceFetcher.java | 37 +-- src/jalview/io/VamsasAppDatastore.java | 84 +++--- src/jalview/io/vamsas/Tree.java | 51 ++-- 17 files changed, 896 insertions(+), 626 deletions(-) diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index 3c3feb3..881dc74 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.analysis; @@ -75,7 +75,7 @@ public class AlignmentSorter /** * Sort by Percentage Identity w.r.t. s - * + * * @param align * AlignmentI * @param s @@ -91,7 +91,7 @@ public class AlignmentSorter /** * Sort by Percentage Identity w.r.t. s - * + * * @param align * AlignmentI * @param s @@ -124,7 +124,7 @@ public class AlignmentSorter /** * Reverse the order of the sort - * + * * @param align * DOCUMENT ME! * @param seqs @@ -160,7 +160,7 @@ public class AlignmentSorter /** * Sets the Alignment object with the given sequences - * + * * @param align * Alignment object to be updated * @param tmp @@ -173,7 +173,7 @@ public class AlignmentSorter /** * Sets the Alignment object with the given sequences - * + * * @param align * DOCUMENT ME! * @param seqs @@ -206,7 +206,7 @@ public class AlignmentSorter /** * Sorts by ID. Numbers are sorted before letters. - * + * * @param align * The alignment object to sort */ @@ -239,7 +239,7 @@ public class AlignmentSorter /** * Sorts by sequence length - * + * * @param align * The alignment object to sort */ @@ -253,7 +253,7 @@ public class AlignmentSorter 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); @@ -274,7 +274,7 @@ public class AlignmentSorter * Sorts the alignment by size of group.
* Maintains the order of sequences in each group by order in given alignment * object. - * + * * @param align * sorts the given alignment object by group */ @@ -296,7 +296,7 @@ public class AlignmentSorter // SORTS GROUPS BY SIZE // //////////////////// - for (SequenceGroup sg:align.getGroups()) + for (SequenceGroup sg : align.getGroups()) { for (int j = 0; j < groups.size(); j++) { @@ -344,10 +344,10 @@ public class AlignmentSorter /** * 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) @@ -409,7 +409,7 @@ public class AlignmentSorter /** * Sorts by a given AlignmentOrder object - * + * * @param align * Alignment to order * @param order @@ -441,12 +441,12 @@ public class AlignmentSorter /** * DOCUMENT ME! - * + * * @param align * alignment to order * @param tree * tree which has - * + * * @return DOCUMENT ME! */ private static Vector getOrderByTree(AlignmentI align, NJTree tree) @@ -469,8 +469,12 @@ public class AlignmentSorter 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"); } } @@ -479,7 +483,7 @@ public class AlignmentSorter /** * Sorts the alignment by a given tree - * + * * @param align * alignment to order * @param tree @@ -512,7 +516,7 @@ public class AlignmentSorter /** * DOCUMENT ME! - * + * * @param align * DOCUMENT ME! * @param seqs @@ -539,14 +543,14 @@ public class AlignmentSorter /** * 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, @@ -566,9 +570,11 @@ public class AlignmentSorter { 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()); } } } @@ -609,7 +615,7 @@ public class AlignmentSorter /** * 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. @@ -697,7 +703,7 @@ public class AlignmentSorter /** * 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 diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index 34bfa61..94aa5c9 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.analysis; @@ -35,15 +35,15 @@ import jalview.ws.seqfetcher.ASequenceFetcher; /** * Functions for cross-referencing sequence databases. user must first specify * if cross-referencing from protein or dna (set dna==true) - * + * * @author JimP - * + * */ public class CrossRef { /** * get the DNA or protein references for a protein or dna sequence - * + * * @param dna * @param rfs * @return @@ -91,7 +91,7 @@ public class CrossRef /** * Indirect references are references from other sequences from the dataset to * any of the direct DBRefEntrys on the given sequences. - * + * * @param dna * true if seqs are DNA seqs * @param seqs @@ -202,7 +202,7 @@ public class CrossRef } /** - * + * * @param dna * @param seqs * @return @@ -214,7 +214,7 @@ public class CrossRef } /** - * + * * @param seqs * @param dna * @param source @@ -416,7 +416,7 @@ public class CrossRef * find references to lrfs in the cross-reference set of each sequence in * dataset (that is not equal to sequenceI) Identifies matching DBRefEntry * based on source and accession string only - Map and Version are nulled. - * + * * @param sequenceI * @param lrfs * @param dataset @@ -444,7 +444,7 @@ public class CrossRef /** * search a given sequence dataset for references matching cross-references to * the given sequence - * + * * @param sequenceI * @param xrf * @param dataset @@ -463,7 +463,7 @@ public class CrossRef * TODO: generalise to different protein classifications Search dataset for * DBRefEntrys matching the given one (xrf) and add the associated sequence to * rseq. - * + * * @param sequenceI * @param xrf * @param dataset @@ -567,7 +567,7 @@ public class CrossRef /** * precalculate different products that can be found for seqs in dataset and * return them. - * + * * @param dna * @param seqs * @param dataset diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 5a199bb..4948613 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.appletgui; @@ -103,7 +103,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis int DEFAULT_HEIGHT = 500; String jalviewServletURL; - + public AlignFrame(AlignmentI al, jalview.bin.JalviewLite applet, String title, boolean embedded) { @@ -233,7 +233,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * Load a features file onto the alignment - * + * * @param file file URL, content, or other resolvable path * @param type is protocol for accessing data referred to by file */ @@ -242,19 +242,19 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis { return parseFeaturesFile(file, type, true); } - + /** * Load a features file onto the alignment - * + * * @param file file URL, content, or other resolvable path * @param type is protocol for accessing data referred to by file * @param autoenabledisplay when true, display features flag will be automatically enabled if features are loaded * @return true if data parsed as a features file */ public boolean parseFeaturesFile(String file, String type, boolean autoenabledisplay) - { + { // TODO: test if importing a features file onto an alignment which already has features with links overwrites the original links. - + Hashtable featureLinks = new Hashtable(); boolean featuresFile = false; try @@ -289,6 +289,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis return featuresFile; } + @Override public void keyPressed(KeyEvent evt) { if (viewport.cursorMode @@ -302,8 +303,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis { case 27: // escape key deselectAllSequenceMenuItem_actionPerformed(); - - alignPanel.alabels.cancelDrag(); + + alignPanel.alabels.cancelDrag(); break; case KeyEvent.VK_X: if (evt.isControlDown() || evt.isMetaDown()) @@ -550,7 +551,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * called by key handler and the hide all/show all menu items - * + * * @param toggleSeqs * @param toggleCols */ @@ -615,14 +616,17 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis } } + @Override public void keyReleased(KeyEvent evt) { } + @Override public void keyTyped(KeyEvent evt) { } + @Override public void itemStateChanged(ItemEvent evt) { if (evt.getSource() == displayNonconservedMenuItem) @@ -739,6 +743,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis this.alignPanel.annotationPanel.repaint(); } + @Override public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); @@ -1112,7 +1117,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis jalview.bin.JalviewLite.addFrame(frame, "Paste Annotations ", 400, 300); } - + public String outputAnnotations(boolean displayTextbox) { String annotation = new AnnotationFile().printAnnotations( @@ -1174,7 +1179,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis features = "# No features visible - paste some and import them here."; frimport=true; } - + CutAndPasteTransfer cap = new CutAndPasteTransfer(frimport, this); if (frimport) { @@ -1353,7 +1358,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * TODO: JAL-1104 * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ @@ -1382,7 +1387,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * TODO: JAL-1104 * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ @@ -1494,7 +1499,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis SequenceI[] seqs2 = invertGroup.toArray(new SequenceI[invertGroup.size()]); for (int i = 0; i < invertGroup.size(); i++) - seqs2[i] = (SequenceI) invertGroup.elementAt(i); + seqs2[i] = invertGroup.elementAt(i); SlideSequencesCommand ssc; if (right) @@ -1786,7 +1791,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * group consensus toggled - * + * */ protected void showGroupConsensus_actionPerformed() { @@ -1806,7 +1811,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt * .event.ActionEvent) @@ -1818,7 +1823,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis } /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt * .event.ActionEvent) @@ -2069,7 +2074,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * create a new view derived from the current view - * + * * @param viewtitle * @return frame for the new view */ @@ -2142,7 +2147,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis } /** - * + * * @return list of feature groups on the view */ public String[] getFeatureGroups() @@ -2158,7 +2163,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * get sequence feature groups that are hidden or shown - * + * * @param visible * true is visible * @return list @@ -2176,7 +2181,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * Change the display state for the given feature groups - * + * * @param groups * list of group strings * @param state @@ -2247,6 +2252,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis final AlignmentPanel ap=alignPanel; frame.addWindowListener(new WindowAdapter() { + @Override public void windowClosing(WindowEvent e) { if (ap!=null) { @@ -2303,7 +2309,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis cs.setConsensus(viewport.getSequenceConsensusHash()); - } + } viewport.setGlobalColourScheme(cs); @@ -2530,7 +2536,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * sort the alignment using the given treePanel - * + * * @param treePanel * tree used to sort view * @param title @@ -2551,7 +2557,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * Do any automatic reordering of the alignment and add the necessary bits to * the menu structure for the new tree - * + * * @param treePanel * @param title */ @@ -2562,14 +2568,16 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis sortByTreeMenu.add(item); item.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { sortByTree(treePanel, title); // treePanel.getTitle()); } }); - + treePanel.addWindowListener(new WindowAdapter() { + @Override public void windowOpened(WindowEvent e) { if (viewport.sortByTree) @@ -2579,6 +2587,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis super.windowOpened(e); } + @Override public void windowClosing(WindowEvent e) { sortByTreeMenu.remove(item); @@ -2622,6 +2631,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis this.builddate = builddate; } + @Override public void paint(Graphics g) { g.setColor(Color.white); @@ -2691,7 +2701,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis MenuItem loadTree = new MenuItem("Load Associated Tree ..."); MenuItem loadAnnotations = new MenuItem("Load Features/Annotations ..."); - + MenuItem outputFeatures = new MenuItem("Export Features ..."); MenuItem outputAnnotations = new MenuItem("Export Annotations ..."); @@ -2766,13 +2776,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis MenuItem purinePyrimidineColour = new MenuItem(); MenuItem RNAHelixColour = new MenuItem(); - + MenuItem userDefinedColour = new MenuItem(); MenuItem PIDColour = new MenuItem(); MenuItem BLOSUM62Colour = new MenuItem(); - + MenuItem tcoffeeColour = new MenuItem(); MenuItem njTreeBlosumMenuItem = new MenuItem(); @@ -2860,7 +2870,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis CheckboxMenuItem seqLimits = new CheckboxMenuItem(); CheckboxMenuItem centreColumnLabelFlag = new CheckboxMenuItem(); - + CheckboxMenuItem followMouseOverFlag = new CheckboxMenuItem(); Menu autoAnnMenu=new Menu(); CheckboxMenuItem showSequenceLogo= new CheckboxMenuItem(); @@ -2885,6 +2895,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis item.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { outputText_actionPerformed(e); @@ -3085,7 +3096,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis applyAutoAnnotationSettings.setLabel("Apply to all groups"); applyAutoAnnotationSettings.setState(true); autoAnnMenu.setLabel("Autocalculated Annotation"); - + invertColSel.addActionListener(this); showColumns.addActionListener(this); showSeqs.addActionListener(this); @@ -3115,7 +3126,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis fileMenu.add(inputText); fileMenu.add(loadTree); fileMenu.add(loadAnnotations); - + fileMenu.addSeparator(); fileMenu.add(outputTextboxMenu); fileMenu.add(outputFeatures); @@ -3273,7 +3284,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis * Attach the alignFrame panels after embedding menus, if necessary. This used * to be called setEmbedded, but is now creates the dropdown menus in a * platform independent manner to avoid OSX/Mac menu appendage daftness. - * + * * @param reallyEmbedded * true to attach the view to the applet area on the page rather than * in a new window @@ -3301,14 +3312,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis final AlignFrame me = this; viewport.applet.addFocusListener(new FocusListener() { - + @Override public void focusLost(FocusEvent e) { if (me.viewport.applet.currentAlignFrame==me) { me.viewport.applet.currentAlignFrame = null; }} - + @Override public void focusGained(FocusEvent e) { @@ -3343,7 +3354,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis * structures in the original jmol window. Note This method doesn't work * without an additional javascript library to exchange messages between the * distinct applets. See http://issues.jalview.org/browse/JAL-621 - * + * * @param viewer * JmolViewer instance * @param sequenceIds @@ -3408,7 +3419,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis } /** * bind a pdb file to a sequence in the current view - * + * * @param sequenceId * - sequenceId within the dataset. * @param pdbEntryString @@ -3580,7 +3591,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis /** * modify the current selection, providing the user has not made a selection already. - * @param sel - sequences from this alignment + * @param sel - sequences from this alignment * @param csel - columns to be selected on the alignment */ public void select(SequenceGroup sel, ColumnSelection csel) @@ -3590,15 +3601,15 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis public void scrollTo(int row, int column) { - alignPanel.seqPanel.scrollTo(row, column); + alignPanel.seqPanel.scrollTo(row, column); } public void scrollToRow(int row) { - alignPanel.seqPanel.scrollToRow(row); + alignPanel.seqPanel.scrollToRow(row); } public void scrollToColumn(int column) { - alignPanel.seqPanel.scrollToColumn(column); + alignPanel.seqPanel.scrollToColumn(column); } /** * @return the alignments unique ID. @@ -3606,13 +3617,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis public String getSequenceSetId() { return viewport.getSequenceSetId(); } - - + + /** - * Load the (T-Coffee) score file from the specified url - * + * Load the (T-Coffee) score file from the specified url + * * @param source File/URL/T-COFFEE score file contents - * @throws IOException + * @throws IOException * @return true if alignment was annotated with data from source */ public boolean loadScoreFile( String source ) throws IOException { @@ -3624,17 +3635,17 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis System.err.println("Origin was:\n"+source); return false; } - + /* * check that the score matrix matches the alignment dimensions */ - AlignmentI aln; + AlignmentI aln; if( (aln=viewport.getAlignment()) != null && (aln.getHeight() != file.getHeight() || aln.getWidth() != file.getWidth()) ) { // TODO: raise a dialog box here rather than bomb out. System.err.println("The scores matrix does not match the alignment dimensions"); - + } - + // TODO add parameter to indicate if matching should be done if (file.annotateAlignment(alignPanel.getAlignment(), false)) { @@ -3651,6 +3662,6 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemLis } return false; } - - + + } diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index a941ef2..7e6e3a1 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.appletgui; @@ -21,14 +21,11 @@ import java.util.*; 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 @@ -44,7 +41,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen final String HELIX = "Helix"; final String SHEET = "Sheet"; - + /** * For RNA secondary structure "stems" aka helices */ @@ -106,16 +103,18 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen 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(); @@ -272,6 +271,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen return null; } + @Override public void mousePressed(MouseEvent evt) { AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); @@ -356,6 +356,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen ap.scalePanel.mousePressed(evt); } + @Override public void mouseReleased(MouseEvent evt) { graphStretch = -1; @@ -369,12 +370,14 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen ap.scalePanel.mouseReleased(evt); } + @Override public void mouseClicked(MouseEvent evt) { } boolean needValidating = false; + @Override public void mouseDragged(MouseEvent evt) { if (graphStretch > -1) @@ -396,6 +399,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen } } + @Override public void mouseMoved(MouseEvent evt) { AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation(); @@ -440,11 +444,13 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen } } + @Override public void mouseEntered(MouseEvent evt) { ap.scalePanel.mouseEntered(evt); } + @Override public void mouseExited(MouseEvent evt) { ap.scalePanel.mouseExited(evt); @@ -549,11 +555,13 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen activeRes.addElement(String.valueOf(i)); } + @Override public void update(Graphics g) { paint(g); } + @Override public void paint(Graphics g) { Dimension d = getSize(); @@ -621,7 +629,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen /** * DOCUMENT ME! - * + * * @param g * DOCUMENT ME! * @param startRes @@ -659,7 +667,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Adjustmen renderer.drawComponent(this, av, g, activeRow, startRes, endRes); g.translate(0, +scrollOffset); } - + int scrollOffset = 0; public void setScrollOffset(int value) diff --git a/src/jalview/appletgui/PaintRefresher.java b/src/jalview/appletgui/PaintRefresher.java index fbdea9d..4e1bfaf 100755 --- a/src/jalview/appletgui/PaintRefresher.java +++ b/src/jalview/appletgui/PaintRefresher.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.appletgui; @@ -26,7 +26,7 @@ import jalview.datamodel.*; /** * DOCUMENT ME! - * + * * @author $author$ * @version $Revision$ */ @@ -36,7 +36,7 @@ public class PaintRefresher /** * DOCUMENT ME! - * + * * @param comp * DOCUMENT ME! * @param al @@ -240,7 +240,7 @@ public class PaintRefresher { if (comps.elementAt(i) instanceof AlignmentPanel) { - tmp.addElement(((AlignmentPanel) comps.elementAt(i))); + tmp.addElement(comps.elementAt(i)); } } AlignmentPanel[] result = new AlignmentPanel[tmp.size()]; diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index a8aa886..9321524 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.commands; @@ -22,24 +22,24 @@ import java.util.*; import jalview.datamodel.*; /** - * + * *

* Title: EditCommmand *

- * + * *

* Description: Essential information for performing undo and redo for cut/paste * insert/delete gap which can be stored in the HistoryList *

- * + * *

* Copyright: Copyright (c) 2006 *

- * + * *

* Company: Dundee University *

- * + * * @author not attributable * @version 1.0 */ @@ -54,7 +54,7 @@ public class EditCommand implements CommandI public static final int PASTE = 3; public static final int REPLACE = 4; - + public static final int INSERT_NUC=5; Edit[] edits; @@ -96,11 +96,13 @@ public class EditCommand implements CommandI performEdit(0, null); } + @Override final public String getDescription() { return description; } + @Override public int getSize() { return edits == null ? 0 : edits.length; @@ -116,7 +118,7 @@ public class EditCommand implements CommandI * 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 @@ -133,7 +135,7 @@ public class EditCommand implements CommandI /** * append a new edit command with a set of alignment views that may be * operated on - * + * * @param command * @param seqs * @param position @@ -202,11 +204,13 @@ public class EditCommand implements CommandI } } + @Override final public void doCommand(AlignmentI[] views) { performEdit(0, views); } + @Override final public void undoCommand(AlignmentI[] views) { int e = 0, eSize = edits.length; @@ -245,7 +249,7 @@ public class EditCommand implements CommandI adjustAnnotations(command, true, false, null); } -// +// // final void insertNuc(Edit command) // { // @@ -452,12 +456,12 @@ public class EditCommand implements CommandI * 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)); diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 5a49540..6c11936 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1,32 +1,30 @@ /* * 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 . */ 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 { @@ -44,7 +42,7 @@ public class Alignment implements AlignmentI public static final int PROTEIN = 0; public static final int NUCLEOTIDE = 1; - + public boolean hasRNAStructure = false; /** DOCUMENT ME!! */ @@ -79,7 +77,7 @@ public class Alignment implements AlignmentI /** * Make an alignment from an array of Sequences. - * + * * @param sequences */ public Alignment(SequenceI[] seqs) @@ -89,7 +87,7 @@ public class Alignment implements AlignmentI /** * Make a new alignment from an array of SeqCigars - * + * * @param seqs * SeqCigar[] */ @@ -105,7 +103,7 @@ public class Alignment implements AlignmentI * 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 */ @@ -117,7 +115,7 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @return DOCUMENT ME! */ @Override @@ -125,14 +123,17 @@ public class Alignment implements AlignmentI { return sequences; } + @Override public List getSequences( Map 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) @@ -145,12 +146,13 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @param i * DOCUMENT ME! - * + * * @return DOCUMENT ME! */ + @Override public SequenceI getSequenceAt(int i) { synchronized (sequences) @@ -165,9 +167,10 @@ public class Alignment implements AlignmentI /** * Adds a sequence to the alignment. Recalculates maxLength and size. - * + * * @param snew */ + @Override public void addSequence(SequenceI snew) { if (dataset != null) @@ -203,9 +206,10 @@ public class Alignment implements AlignmentI /** * Adds a sequence to the alignment. Recalculates maxLength and size. - * + * * @param snew */ + @Override public void setSequenceAt(int i, SequenceI snew) { SequenceI oldseq = getSequenceAt(i); @@ -218,14 +222,16 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @return DOCUMENT ME! */ - public Vector getGroups() + @Override + public List getGroups() { return groups; } + @Override public void finalize() { if (getDataset() != null) @@ -252,10 +258,11 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @param s * DOCUMENT ME! */ + @Override public void deleteSequence(SequenceI s) { deleteSequence(findIndex(s)); @@ -263,10 +270,11 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @param i * DOCUMENT ME! */ + @Override public void deleteSequence(int i) { if (i > -1 && i < getHeight()) @@ -302,14 +310,13 @@ public class Alignment implements AlignmentI 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 temp = new ArrayList(); @@ -338,6 +345,7 @@ public class Alignment implements AlignmentI } /** */ + @Override public void addGroup(SequenceGroup sg) { synchronized (groups) @@ -370,7 +378,7 @@ public class Alignment implements AlignmentI /** * remove any annotation that references gp - * + * * @param gp * (if null, removes all group associated annotation) */ @@ -428,6 +436,7 @@ public class Alignment implements AlignmentI } } + @Override public void deleteAllGroups() { synchronized (groups) @@ -441,6 +450,7 @@ public class Alignment implements AlignmentI } /** */ + @Override public void deleteGroup(SequenceGroup g) { synchronized (groups) @@ -454,6 +464,7 @@ public class Alignment implements AlignmentI } /** */ + @Override public SequenceI findName(String name) { return findName(name, false); @@ -461,9 +472,10 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see jalview.datamodel.AlignmentI#findName(java.lang.String, boolean) */ + @Override public SequenceI findName(String token, boolean b) { return findName(null, token, b); @@ -471,10 +483,11 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see jalview.datamodel.AlignmentI#findName(SequenceI, java.lang.String, * boolean) */ + @Override public SequenceI findName(SequenceI startAfter, String token, boolean b) { @@ -515,6 +528,7 @@ public class Alignment implements AlignmentI return null; } + @Override public SequenceI[] findSequenceMatch(String name) { Vector matches = new Vector(); @@ -541,9 +555,10 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SequenceI) */ + @Override public int findIndex(SequenceI s) { int i = 0; @@ -563,10 +578,11 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see * jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SearchResults) */ + @Override public int findIndex(SearchResults results) { int i = 0; @@ -584,9 +600,10 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @return DOCUMENT ME! */ + @Override public int getHeight() { return sequences.size(); @@ -594,9 +611,10 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @return DOCUMENT ME! */ + @Override public int getWidth() { int maxLength = -1; @@ -614,10 +632,11 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @param gc * DOCUMENT ME! */ + @Override public void setGapCharacter(char gc) { gapCharacter = gc; @@ -633,9 +652,10 @@ public class Alignment implements AlignmentI /** * DOCUMENT ME! - * + * * @return DOCUMENT ME! */ + @Override public char getGapCharacter() { return gapCharacter; @@ -643,9 +663,10 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see jalview.datamodel.AlignmentI#isAligned() */ + @Override public boolean isAligned() { return isAligned(false); @@ -653,9 +674,10 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see jalview.datamodel.AlignmentI#isAligned(boolean) */ + @Override public boolean isAligned(boolean includeHidden) { int width = getWidth(); @@ -679,15 +701,17 @@ public class Alignment implements AlignmentI /* * (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; @@ -721,7 +745,8 @@ public class Alignment implements AlignmentI if (swap) { annotations = temp; - if (unhook) { + if (unhook) + { unhookAnnotation(aa); } } @@ -730,7 +755,7 @@ public class Alignment implements AlignmentI /** * remove any object references associated with this annotation - * + * * @param aa */ private void unhookAnnotation(AlignmentAnnotation aa) @@ -748,10 +773,11 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @seejalview.datamodel.AlignmentI#addAnnotation(jalview.datamodel. * AlignmentAnnotation) */ + @Override public void addAnnotation(AlignmentAnnotation aa) { addAnnotation(aa, -1); @@ -759,16 +785,18 @@ public class Alignment implements AlignmentI /* * (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) { @@ -804,6 +832,7 @@ public class Alignment implements AlignmentI annotations = temp; } + @Override public void setAnnotationIndex(AlignmentAnnotation aa, int index) { if (aa == null || annotations == null || annotations.length - 1 < index) @@ -845,6 +874,7 @@ public class Alignment implements AlignmentI return annotations; } + @Override public void setNucleotide(boolean b) { if (b) @@ -857,6 +887,7 @@ public class Alignment implements AlignmentI } } + @Override public boolean isNucleotide() { if (type == NUCLEOTIDE) @@ -868,12 +899,15 @@ public class Alignment implements AlignmentI 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) @@ -888,7 +922,7 @@ public class Alignment implements AlignmentI currentSeq = getSequenceAt(i); if (currentSeq.getDatasetSequence() != null) { - seqs[i] = (Sequence) currentSeq.getDatasetSequence(); + seqs[i] = currentSeq.getDatasetSequence(); } else { @@ -918,11 +952,13 @@ public class Alignment implements AlignmentI alignmentRefs++; } + @Override public Alignment getDataset() { return dataset; } + @Override public boolean padGaps() { boolean modified = false; @@ -969,11 +1005,12 @@ public class Alignment implements AlignmentI /** * 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; @@ -1071,11 +1108,13 @@ public class Alignment implements AlignmentI return modified; } + @Override public HiddenSequences getHiddenSequences() { return hiddenSequences; } + @Override public CigarArray getCompactAlignment() { synchronized (sequences) @@ -1101,6 +1140,7 @@ public class Alignment implements AlignmentI alignmentProperties.put(key, value); } + @Override public Object getProperty(Object key) { if (alignmentProperties != null) @@ -1109,6 +1149,7 @@ public class Alignment implements AlignmentI return null; } + @Override public Hashtable getProperties() { return alignmentProperties; @@ -1118,11 +1159,12 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see * jalview.datamodel.AlignmentI#addCodonFrame(jalview.datamodel.AlignedCodonFrame * ) */ + @Override public void addCodonFrame(AlignedCodonFrame codons) { if (codons == null) @@ -1141,9 +1183,10 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see jalview.datamodel.AlignmentI#getCodonFrame(int) */ + @Override public AlignedCodonFrame getCodonFrame(int index) { return codonFrameList[index]; @@ -1151,10 +1194,11 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see * jalview.datamodel.AlignmentI#getCodonFrame(jalview.datamodel.SequenceI) */ + @Override public AlignedCodonFrame[] getCodonFrame(SequenceI seq) { if (seq == null || codonFrameList == null) @@ -1174,9 +1218,10 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @see jalview.datamodel.AlignmentI#getCodonFrames() */ + @Override public AlignedCodonFrame[] getCodonFrames() { return codonFrameList; @@ -1184,10 +1229,11 @@ public class Alignment implements AlignmentI /* * (non-Javadoc) - * + * * @seejalview.datamodel.AlignmentI#removeCodonFrame(jalview.datamodel. * AlignedCodonFrame) */ + @Override public boolean removeCodonFrame(AlignedCodonFrame codons) { if (codons == null || codonFrameList == null) @@ -1214,6 +1260,7 @@ public class Alignment implements AlignmentI return removed; } + @Override public void append(AlignmentI toappend) { if (toappend == this) @@ -1263,7 +1310,7 @@ public class Alignment implements AlignmentI List sg = toappend.getGroups(); if (sg != null) { - for (SequenceGroup _sg:sg) + for (SequenceGroup _sg : sg) { addGroup(_sg); } @@ -1333,11 +1380,10 @@ public class Alignment implements AlignmentI } @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) @@ -1364,10 +1410,12 @@ public class Alignment implements AlignmentI @Override public Iterable findAnnotation(String calcId) { - ArrayList aa=new ArrayList(); - for (AlignmentAnnotation a:getAlignmentAnnotation()) + ArrayList aa = new ArrayList(); + 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); } diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java index 3d61037..d09c41d 100755 --- a/src/jalview/datamodel/AlignmentI.java +++ b/src/jalview/datamodel/AlignmentI.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.datamodel; @@ -26,29 +26,30 @@ public interface AlignmentI extends AnnotatedCollectionI { /** * 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 @@ -65,32 +66,33 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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 @@ -100,7 +102,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * Deletes a sequence from the alignment - * + * * @param s * Sequence to be deleted. */ @@ -108,7 +110,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * Deletes a sequence from the alignment. - * + * * @param i * Index of sequence to be deleted. */ @@ -116,10 +118,10 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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); @@ -128,20 +130,20 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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. */ @@ -149,17 +151,17 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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. */ @@ -167,7 +169,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * Deletes a specific SequenceGroup - * + * * @param g * Group will be deleted from alignment. */ @@ -175,7 +177,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * Get all the groups associated with this alignment. - * + * * @return All groups as a list. */ public List getGroups(); @@ -187,7 +189,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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. */ @@ -195,7 +197,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * moves annotation to a specified index in alignment annotation display stack - * + * * @param aa * the annotation object to be moved * @param index @@ -208,7 +210,7 @@ public interface AlignmentI extends AnnotatedCollectionI * 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. @@ -220,7 +222,7 @@ public interface AlignmentI extends AnnotatedCollectionI * 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 @@ -234,14 +236,15 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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. */ @@ -249,34 +252,34 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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. */ @@ -284,7 +287,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * Set the associated dataset for the alignment, or create one. - * + * * @param dataset * The dataset alignment or null to construct one. */ @@ -292,7 +295,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * pads sequences with gaps (to ensure the set looks like an alignment) - * + * * @return boolean true if alignment was modified */ public boolean padGaps(); @@ -301,7 +304,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * Compact representation of alignment - * + * * @return CigarArray */ public CigarArray getCompactAlignment(); @@ -309,7 +312,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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 */ @@ -317,7 +320,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * Get a named property from the alignment. - * + * * @param key * @return value of property */ @@ -325,21 +328,21 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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. */ @@ -347,14 +350,14 @@ public interface AlignmentI extends AnnotatedCollectionI /** * get all codon frames associated with this alignment - * + * * @return */ public AlignedCodonFrame[] getCodonFrames(); /** * get a particular codon frame - * + * * @param index * @return */ @@ -367,7 +370,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * find sequence with given name in alignment - * + * * @param token * name to find * @param b @@ -380,7 +383,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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) @@ -396,7 +399,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * find first sequence in alignment which is involved in the given search * result object - * + * * @param results * @return -1 or index of sequence in alignment */ @@ -409,7 +412,7 @@ public interface AlignmentI extends AnnotatedCollectionI * 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. */ @@ -418,7 +421,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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 @@ -427,7 +430,7 @@ public interface AlignmentI extends AnnotatedCollectionI /** * add given annotation row at given position (0 is start, -1 is end) - * + * * @param consensus * @param i */ @@ -435,12 +438,12 @@ public interface AlignmentI extends AnnotatedCollectionI /** * 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); diff --git a/src/jalview/datamodel/HiddenSequences.java b/src/jalview/datamodel/HiddenSequences.java index e9f6d1f..2a6b601 100755 --- a/src/jalview/datamodel/HiddenSequences.java +++ b/src/jalview/datamodel/HiddenSequences.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.datamodel; @@ -140,7 +140,8 @@ public class HiddenSequences alignment.deleteSequence(sequence); } - public Vector showAll(Map hiddenRepSequences) + public Vector showAll( + Map hiddenRepSequences) { Vector revealedSeqs = new Vector(); for (int i = 0; i < hiddenSequences.length; i++) @@ -157,7 +158,8 @@ public class HiddenSequences return revealedSeqs; } - public Vector showSequence(int alignmentIndex, Map hiddenRepSequences) + public Vector showSequence(int alignmentIndex, + Map hiddenRepSequences) { Vector revealedSeqs = new Vector(); SequenceI repSequence = alignment.getSequenceAt(alignmentIndex); diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index d8157c0..304cfb7 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.gui; @@ -127,7 +127,7 @@ import javax.swing.SwingUtilities; /** * DOCUMENT ME! - * + * * @author $author$ * @version $Revision$ */ @@ -146,7 +146,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, AlignViewport viewport; Vector alignPanels = new Vector(); - + /** * Last format used to load or save alignments in this window */ @@ -159,7 +159,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Creates a new AlignFrame object with specific width and height. - * + * * @param al * @param width * @param height @@ -172,7 +172,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Creates a new AlignFrame object with specific width, height and * sequenceSetId - * + * * @param al * @param width * @param height @@ -187,7 +187,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Creates a new AlignFrame object with specific width, height and * sequenceSetId - * + * * @param al * @param width * @param height @@ -202,7 +202,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * new alignment window with hidden columns - * + * * @param al * AlignmentI * @param hiddenColumns @@ -221,7 +221,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Create alignment frame for al with hiddenColumns, a specific width and * height, and specific sequenceId - * + * * @param al * @param hiddenColumns * @param width @@ -238,7 +238,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Create alignment frame for al with hiddenColumns, a specific width and * height, and specific sequenceId - * + * * @param al * @param hiddenColumns * @param width @@ -267,7 +267,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Make a new AlignFrame from exisiting alignmentPanels - * + * * @param ap * AlignmentPanel * @param av @@ -335,7 +335,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Change the filename and format for the alignment, and enable the 'reload' * button functionality. - * + * * @param file * valid filename * @param format @@ -352,6 +352,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { addKeyListener(new KeyAdapter() { + @Override public void keyPressed(KeyEvent evt) { if (viewport.cursorMode @@ -532,6 +533,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } + @Override public void keyReleased(KeyEvent evt) { switch (evt.getKeyCode()) @@ -616,6 +618,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, Desktop.instance.addJalviewPropertyChangeListener("services", thisListener = new java.beans.PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent evt) { // // System.out.println("Discoverer property change."); @@ -624,6 +627,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { System.err @@ -637,6 +641,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, }); addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { + @Override public void internalFrameClosed( javax.swing.event.InternalFrameEvent evt) { @@ -649,6 +654,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // Finally, build the menu once to get current service state new Thread(new Runnable() { + @Override public void run() { BuildWebServiceMenu(); @@ -685,7 +691,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Need to call this method when tabs are selected for multiple views, or when * loading from Jalview2XML.java - * + * * @param av * AlignViewport */ @@ -736,9 +742,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long) */ + @Override public void setProgressBar(String message, long id) { if (progressBars == null) @@ -786,6 +793,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, validate(); } + @Override public void registerHandler(final long id, final IProgressIndicatorHandler handler) { @@ -803,6 +811,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, cancel.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { handler.cancelActivity(id); @@ -817,7 +826,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } /** - * + * * @return true if any progress bars are still active */ public boolean operationInProgress() @@ -842,16 +851,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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) @@ -903,6 +915,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, final FeatureSettings nfs = newframe.featureSettings; SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { nfs.frame.setBounds(fspos); @@ -916,16 +929,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } + @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 @@ -943,10 +959,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void saveAs_actionPerformed(ActionEvent e) { JalviewFileChooser chooser = new JalviewFileChooser( @@ -1040,7 +1057,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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()); @@ -1095,10 +1112,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void outputText_actionPerformed(ActionEvent e) { String[] omitHidden = null; @@ -1140,10 +1158,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void htmlMenuItem_actionPerformed(ActionEvent e) { new HTMLOutput(alignPanel, @@ -1158,10 +1177,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void createPNG(File f) { alignPanel.makePNG(f); @@ -1169,15 +1189,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * 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(); @@ -1186,10 +1208,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void printMenuItem_actionPerformed(ActionEvent e) { // Putting in a thread avoids Swing painting problems @@ -1197,11 +1220,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, thread.start(); } + @Override public void exportFeatures_actionPerformed(ActionEvent e) { new AnnotationExporter().exportFeatures(alignPanel); } + @Override public void exportAnnotations_actionPerformed(ActionEvent e) { new AnnotationExporter().exportAnnotations(alignPanel, @@ -1211,6 +1236,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, .getAlignment()).alignmentProperties); } + @Override public void associatedData_actionPerformed(ActionEvent e) { // Pick the tree file @@ -1234,9 +1260,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * 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) @@ -1279,7 +1306,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * close alignPanel2 and shuffle tabs appropriately. - * + * * @param alignPanel2 */ public void closeView(AlignmentPanel alignPanel2) @@ -1355,7 +1382,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } /** - * + * * @return alignment objects for all views */ AlignmentI[] getViewAlignments() @@ -1380,10 +1407,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void undoMenuItem_actionPerformed(ActionEvent e) { if (viewport.historyList.empty()) @@ -1415,10 +1443,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void redoMenuItem_actionPerformed(ActionEvent e) { if (viewport.redoList.size() < 1) @@ -1496,7 +1525,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param up * DOCUMENT ME! */ @@ -1542,7 +1571,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } 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); @@ -1596,10 +1625,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void copy_actionPerformed(ActionEvent e) { System.gc(); @@ -1664,10 +1694,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void pasteNew_actionPerformed(ActionEvent e) { paste(true); @@ -1675,10 +1706,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void pasteThis_actionPerformed(ActionEvent e) { paste(false); @@ -1686,7 +1718,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Paste contents of Jalview clipboard - * + * * @param newAlignment * true to paste to a new alignment, otherwise add to this. */ @@ -1955,10 +1987,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void cut_actionPerformed(ActionEvent e) { copy_actionPerformed(null); @@ -1967,10 +2000,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void delete_actionPerformed(ActionEvent evt) { @@ -2027,10 +2061,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void deleteGroups_actionPerformed(ActionEvent e) { viewport.getAlignment().deleteAllGroups(); @@ -2043,10 +2078,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void selectAllSequenceMenuItem_actionPerformed(ActionEvent e) { SequenceGroup sg = new SequenceGroup(); @@ -2065,10 +2101,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e) { if (viewport.cursorMode) @@ -2088,10 +2125,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void invertSequenceMenuItem_actionPerformed(ActionEvent e) { SequenceGroup sg = viewport.getSelectionGroup(); @@ -2113,6 +2151,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewport.sendSelection(); } + @Override public void invertColSel_actionPerformed(ActionEvent e) { viewport.invertColumnSelection(); @@ -2122,10 +2161,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void remove2LeftMenuItem_actionPerformed(ActionEvent e) { trimAlignment(true); @@ -2133,10 +2173,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void remove2RightMenuItem_actionPerformed(ActionEvent e) { trimAlignment(false); @@ -2206,10 +2247,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void removeGappedColumnMenuItem_actionPerformed(ActionEvent e) { int start = 0, end = viewport.getAlignment().getWidth() - 1; @@ -2253,10 +2295,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void removeAllGapsMenuItem_actionPerformed(ActionEvent e) { int start = 0, end = viewport.getAlignment().getWidth() - 1; @@ -2291,10 +2334,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void padGapsMenuitem_actionPerformed(ActionEvent e) { viewport.setPadGaps(padGapsMenuitem.isSelected()); @@ -2314,22 +2358,24 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * 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. @@ -2340,7 +2386,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } /** - * + * * @param viewTitle * title of newly created view * @return new alignment panel, already displayed. @@ -2351,7 +2397,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } /** - * + * * @param viewTitle * title of newly created view * @param copyAnnotation @@ -2433,11 +2479,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, return newap; } + @Override public void expandViews_actionPerformed(ActionEvent e) { Desktop.instance.explodeViews(this); } + @Override public void gatherViews_actionPerformed(ActionEvent e) { Desktop.instance.gatherViews(this); @@ -2445,10 +2493,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void font_actionPerformed(ActionEvent e) { new FontChooser(alignPanel); @@ -2456,10 +2505,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void seqLimit_actionPerformed(ActionEvent e) { viewport.setShowJVSuffix(seqLimits.isSelected()); @@ -2469,12 +2519,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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(); @@ -2483,9 +2535,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see jalview.jbgui.GAlignFrame#followHighlight_actionPerformed() */ + @Override protected void followHighlight_actionPerformed() { if (viewport.followHighlight = this.followHighlightMenuItem.getState()) @@ -2497,10 +2550,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void colourTextMenuItem_actionPerformed(ActionEvent e) { viewport.setColourText(colourTextMenuItem.isSelected()); @@ -2509,10 +2563,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void wrapMenuItem_actionPerformed(ActionEvent e) { scaleAbove.setVisible(wrapMenuItem.isSelected()); @@ -2522,17 +2577,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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(); @@ -2541,7 +2599,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * called by key handler and the hide all/show all menu items - * + * * @param toggleSeqs * @param toggleCols */ @@ -2611,11 +2669,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#hideAllButSelection_actionPerformed(java.awt. * event.ActionEvent) */ + @Override public void hideAllButSelection_actionPerformed(ActionEvent e) { toggleHiddenRegions(false, false); @@ -2623,11 +2682,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#hideAllSelection_actionPerformed(java.awt.event * .ActionEvent) */ + @Override public void hideAllSelection_actionPerformed(ActionEvent e) { SequenceGroup sg = viewport.getSelectionGroup(); @@ -2639,11 +2699,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#showAllhidden_actionPerformed(java.awt.event. * ActionEvent) */ + @Override public void showAllhidden_actionPerformed(ActionEvent e) { viewport.showAllHiddenColumns(); @@ -2651,12 +2712,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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()); @@ -2665,10 +2728,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void scaleAbove_actionPerformed(ActionEvent e) { viewport.setScaleAboveWrapped(scaleAbove.isSelected()); @@ -2677,10 +2741,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void scaleLeft_actionPerformed(ActionEvent e) { viewport.setScaleLeftWrapped(scaleLeft.isSelected()); @@ -2689,10 +2754,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void scaleRight_actionPerformed(ActionEvent e) { viewport.setScaleRightWrapped(scaleRight.isSelected()); @@ -2701,10 +2767,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void viewBoxesMenuItem_actionPerformed(ActionEvent e) { viewport.setShowBoxes(viewBoxesMenuItem.isSelected()); @@ -2713,10 +2780,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void viewTextMenuItem_actionPerformed(ActionEvent e) { viewport.setShowText(viewTextMenuItem.isSelected()); @@ -2725,10 +2793,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void renderGapsMenuItem_actionPerformed(ActionEvent e) { viewport.setRenderGaps(renderGapsMenuItem.isSelected()); @@ -2737,6 +2806,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, public FeatureSettings featureSettings; + @Override public void featureSettings_actionPerformed(ActionEvent e) { if (featureSettings != null) @@ -2755,10 +2825,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Set or clear 'Show Sequence Features' - * + * * @param evt * DOCUMENT ME! */ + @Override public void showSeqFeatures_actionPerformed(ActionEvent evt) { viewport.setShowSequenceFeatures(showSeqFeatures.isSelected()); @@ -2771,10 +2842,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Set or clear 'Show Sequence Features' - * + * * @param evt * DOCUMENT ME! */ + @Override public void showSeqFeaturesHeight_actionPerformed(ActionEvent evt) { viewport.setShowSequenceFeaturesHeight(showSeqFeaturesHeight @@ -2794,16 +2866,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * 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", ""); @@ -2820,10 +2894,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void overviewMenuItem_actionPerformed(ActionEvent e) { if (alignPanel.overviewPanel != null) @@ -2840,6 +2915,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, frame.setLayer(JLayeredPane.PALETTE_LAYER); frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { + @Override public void internalFrameClosed( javax.swing.event.InternalFrameEvent evt) { @@ -2850,6 +2926,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, alignPanel.setOverviewPanel(overview); } + @Override public void textColour_actionPerformed(ActionEvent e) { new TextColourChooser().chooseColour(alignPanel, null); @@ -2857,10 +2934,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void noColourmenuItem_actionPerformed(ActionEvent e) { changeColour(null); @@ -2868,10 +2946,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void clustalColour_actionPerformed(ActionEvent e) { changeColour(new ClustalxColourScheme(viewport.getAlignment(), viewport.getHiddenRepSequences())); @@ -2879,10 +2958,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void zappoColour_actionPerformed(ActionEvent e) { changeColour(new ZappoColourScheme()); @@ -2890,10 +2970,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void taylorColour_actionPerformed(ActionEvent e) { changeColour(new TaylorColourScheme()); @@ -2901,10 +2982,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void hydrophobicityColour_actionPerformed(ActionEvent e) { changeColour(new HydrophobicColourScheme()); @@ -2912,10 +2994,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void helixColour_actionPerformed(ActionEvent e) { changeColour(new HelixColourScheme()); @@ -2923,10 +3006,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void strandColour_actionPerformed(ActionEvent e) { changeColour(new StrandColourScheme()); @@ -2934,10 +3018,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void turnColour_actionPerformed(ActionEvent e) { changeColour(new TurnColourScheme()); @@ -2945,10 +3030,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void buriedColour_actionPerformed(ActionEvent e) { changeColour(new BuriedColourScheme()); @@ -2956,15 +3042,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * 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()); @@ -2976,11 +3064,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * 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); @@ -2988,10 +3078,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void applyToAllGroups_actionPerformed(ActionEvent e) { viewport.setColourAppliesToAllGroups(applyToAllGroups.isSelected()); @@ -2999,7 +3090,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param cs * DOCUMENT ME! */ @@ -3123,10 +3214,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void modifyPID_actionPerformed(ActionEvent e) { if (viewport.getAbovePIDThreshold() @@ -3140,10 +3232,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void modifyConservation_actionPerformed(ActionEvent e) { if (viewport.getConservationSelected() @@ -3157,10 +3250,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void conservationMenuItem_actionPerformed(ActionEvent e) { viewport.setConservationSelected(conservationMenuItem.isSelected()); @@ -3175,10 +3269,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void abovePIDThreshold_actionPerformed(ActionEvent e) { viewport.setAbovePIDThreshold(abovePIDThreshold.isSelected()); @@ -3193,10 +3288,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void userDefinedColour_actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("User Defined...")) @@ -3238,6 +3334,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, radioItem.setName("USER_DEFINED"); radioItem.addMouseListener(new MouseAdapter() { + @Override public void mousePressed(MouseEvent evt) { if (evt.isControlDown() @@ -3260,6 +3357,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { radioItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { userDefinedColour_actionPerformed(evt); @@ -3271,6 +3369,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, }); radioItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { userDefinedColour_actionPerformed(evt); @@ -3285,10 +3384,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void PIDColour_actionPerformed(ActionEvent e) { changeColour(new PIDColourScheme()); @@ -3296,10 +3396,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void BLOSUM62Colour_actionPerformed(ActionEvent e) { changeColour(new Blosum62ColourScheme()); @@ -3307,10 +3408,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void sortPairwiseMenuItem_actionPerformed(ActionEvent e) { SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray(); @@ -3323,10 +3425,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void sortIDMenuItem_actionPerformed(ActionEvent e) { SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray(); @@ -3338,10 +3441,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void sortLengthMenuItem_actionPerformed(ActionEvent e) { SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray(); @@ -3353,10 +3457,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void sortGroupMenuItem_actionPerformed(ActionEvent e) { SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray(); @@ -3369,10 +3474,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void removeRedundancyMenuItem_actionPerformed(ActionEvent e) { new RedundancyPanel(alignPanel, this); @@ -3380,10 +3486,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e) { if ((viewport.getSelectionGroup() == null) @@ -3403,10 +3510,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void PCAMenuItem_actionPerformed(ActionEvent e) { if (((viewport.getSelectionGroup() != null) @@ -3426,6 +3534,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, new PCAPanel(alignPanel); } + @Override public void autoCalculate_actionPerformed(ActionEvent e) { viewport.autoCalculateConsensus = autoCalculate.isSelected(); @@ -3436,6 +3545,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } + @Override public void sortByTreeOption_actionPerformed(ActionEvent e) { viewport.sortByTree = sortByTree.isSelected(); @@ -3449,10 +3559,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void averageDistanceTreeMenuItem_actionPerformed(ActionEvent e) { NewTreePanel("AV", "PID", "Average distance tree using PID"); @@ -3460,10 +3571,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void neighbourTreeMenuItem_actionPerformed(ActionEvent e) { NewTreePanel("NJ", "PID", "Neighbour joining tree using PID"); @@ -3471,10 +3583,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void njTreeBlosumMenuItem_actionPerformed(ActionEvent e) { NewTreePanel("NJ", "BL", "Neighbour joining tree using BLOSUM62"); @@ -3482,10 +3595,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void avTreeBlosumMenuItem_actionPerformed(ActionEvent e) { NewTreePanel("AV", "BL", "Average distance tree using BLOSUM62"); @@ -3493,7 +3607,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param type * DOCUMENT ME! * @param pwType @@ -3580,7 +3694,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param title * DOCUMENT ME! * @param order @@ -3593,6 +3707,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, sort.add(item); item.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray(); @@ -3611,7 +3726,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Add a new sort by annotation score menu item - * + * * @param sort * the menu to add the option to * @param scoreLabel @@ -3625,6 +3740,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, sort.add(item); item.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray(); @@ -3647,8 +3763,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * 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) @@ -3693,12 +3810,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * 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(); @@ -3732,6 +3850,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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); @@ -3760,7 +3879,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Work out whether the whole set of sequences or just the selected set will * be submitted for multiple alignment. - * + * */ public jalview.datamodel.AlignmentView gatherSequencesForAlignment() { @@ -3775,7 +3894,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * 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); } */ @@ -3785,9 +3904,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { /* * 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); } } */ @@ -3833,10 +3952,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override protected void LoadtreeMenuItem_actionPerformed(ActionEvent e) { // Pick the tree file @@ -3898,7 +4018,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Add a treeviewer for the tree extracted from a newick file object to the * current alignment view - * + * * @param nf * the tree * @param title @@ -3949,7 +4069,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Generates menu items and listener event actions for web service clients - * + * */ public void BuildWebServiceMenu() { @@ -3968,6 +4088,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, buildingMenu = true; new Thread(new Runnable() { + @Override public void run() { try @@ -4066,6 +4187,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { try @@ -4076,7 +4198,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { for (int i = 0, j = wsmenu.size(); i < j; i++) { - webService.add((JMenu) wsmenu.get(i)); + webService.add(wsmenu.get(i)); } } else @@ -4135,7 +4257,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * construct any groupURL type service menu entries. - * + * * @param webService */ private void build_urlServiceMenu(JMenu webService) @@ -4145,12 +4267,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * 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 @@ -4177,12 +4299,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * 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( @@ -4190,7 +4312,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, */ /** * prototype of an automatically enabled/disabled analysis function - * + * */ protected void setShowProductsEnabled() { @@ -4210,7 +4332,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * search selection for sequence xRef products and build the show products * menu. - * + * * @param selection * @param dataset * @return true if showProducts menu should be enabled. @@ -4240,6 +4362,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, xtype.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { // TODO: new thread for this call with vis-delay @@ -4273,6 +4396,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, Runnable foo = new Runnable() { + @Override public void run() { final long sttime = System.currentTimeMillis(); @@ -4356,6 +4480,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } + @Override public void showProducts_actionPerformed(ActionEvent e) { // ///////////////////////////// @@ -4389,6 +4514,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } + @Override public void showTranslation_actionPerformed(ActionEvent e) { // ///////////////////////////// @@ -4427,7 +4553,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Try to load a features file onto the alignment. - * + * * @param file * contents or path to retrieve file * @param type @@ -4467,22 +4593,27 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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(); @@ -4671,7 +4802,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * 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. */ @@ -4749,7 +4880,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { /* * 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 == @@ -4797,6 +4928,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } + @Override public void tabSelectionChanged(int index) { if (index > -1) @@ -4807,6 +4939,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } + @Override public void tabbedPane_mousePressed(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) @@ -4831,6 +4964,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Open the dialog for regex description parsing. */ + @Override protected void extractScores_actionPerformed(ActionEvent e) { ParseProperties pp = new jalview.analysis.ParseProperties( @@ -4848,11 +4982,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#showDbRefs_actionPerformed(java.awt.event.ActionEvent * ) */ + @Override protected void showDbRefs_actionPerformed(ActionEvent e) { viewport.setShowDbRefs(showDbRefsMenuitem.isSelected()); @@ -4860,10 +4995,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @seejalview.jbgui.GAlignFrame#showNpFeats_actionPerformed(java.awt.event. * ActionEvent) */ + @Override protected void showNpFeats_actionPerformed(ActionEvent e) { viewport.setShowNpFeats(showNpFeatsMenuitem.isSelected()); @@ -4872,7 +5008,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * find the viewport amongst the tabs in this alignment frame and close that * tab - * + * * @param av */ public boolean closeView(AlignViewport av) @@ -4913,11 +5049,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, fetchr.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { new Thread(new Runnable() { + @Override public void run() { new jalview.ws.DBRefFetcher(alignPanel.av @@ -4933,12 +5071,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 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(); @@ -4979,11 +5119,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, fetchr.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { new Thread(new Runnable() { + @Override public void run() { new jalview.ws.DBRefFetcher(alignPanel.av @@ -5011,11 +5153,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, + "'"); fetchr.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { new Thread(new Runnable() { + @Override public void run() { new jalview.ws.DBRefFetcher(alignPanel.av @@ -5056,11 +5200,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, fetchr.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { new Thread(new Runnable() { + @Override public void run() { new jalview.ws.DBRefFetcher(alignPanel.av @@ -5108,6 +5254,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Left justify the whole alignment. */ + @Override protected void justifyLeftMenuItem_actionPerformed(ActionEvent e) { AlignmentI al = viewport.getAlignment(); @@ -5118,6 +5265,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * Right justify the whole alignment. */ + @Override protected void justifyRightMenuItem_actionPerformed(ActionEvent e) { AlignmentI al = viewport.getAlignment(); @@ -5133,11 +5281,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#showUnconservedMenuItem_actionPerformed(java. * awt.event.ActionEvent) */ + @Override protected void showUnconservedMenuItem_actionPerformed(ActionEvent e) { viewport.setShowUnconserved(showNonconservedMenuItem.getState()); @@ -5146,11 +5295,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#showGroupConsensus_actionPerformed(java.awt.event * .ActionEvent) */ + @Override protected void showGroupConsensus_actionPerformed(ActionEvent e) { viewport.setShowGroupConsensus(showGroupConsensus.getState()); @@ -5160,11 +5310,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#showGroupConservation_actionPerformed(java.awt * .event.ActionEvent) */ + @Override protected void showGroupConservation_actionPerformed(ActionEvent e) { viewport.setShowGroupConservation(showGroupConservation.getState()); @@ -5173,11 +5324,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt * .event.ActionEvent) */ + @Override protected void showConsensusHistogram_actionPerformed(ActionEvent e) { viewport.setShowConsensusHistogram(showConsensusHistogram.getState()); @@ -5186,23 +5338,26 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (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()); @@ -5210,11 +5365,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * (non-Javadoc) - * + * * @see * jalview.jbgui.GAlignFrame#makeGrpsFromSelection_actionPerformed(java.awt * .event.ActionEvent) */ + @Override protected void makeGrpsFromSelection_actionPerformed(ActionEvent e) { if (viewport.getSelectionGroup() != null) @@ -5249,7 +5405,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /** * make the given alignmentPanel the currently selected tab - * + * * @param alignmentPanel */ public void setDisplayedView(AlignmentPanel alignmentPanel) @@ -5280,6 +5436,7 @@ class PrintThread extends Thread static PageFormat pf; + @Override public void run() { PrinterJob printJob = PrinterJob.getPrinterJob(); diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index fa97215..0480ffa 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.gui; @@ -29,7 +29,7 @@ import jalview.util.UrlLink; /** * DOCUMENT ME! - * + * * @author $author$ * @version $Revision$ */ @@ -55,7 +55,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * Creates a new IdPanel object. - * + * * @param av * DOCUMENT ME! * @param parent @@ -77,10 +77,11 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mouseMoved(MouseEvent e) { SeqPanel sp = alignPanel.seqPanel; @@ -147,10 +148,11 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mouseDragged(MouseEvent e) { mouseDragging = true; @@ -170,6 +172,7 @@ public class IdPanel extends JPanel implements MouseListener, alignPanel.paintAlignment(true); } + @Override public void mouseWheelMoved(MouseWheelEvent e) { e.consume(); @@ -185,10 +188,11 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() < 2) @@ -257,10 +261,11 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mouseEntered(MouseEvent e) { if (scrollThread != null) @@ -271,10 +276,11 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mouseExited(MouseEvent e) { if (av.getWrapAlignment()) @@ -296,10 +302,11 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mousePressed(MouseEvent e) { if (e.getClickCount() == 2) @@ -359,7 +366,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param seq * DOCUMENT ME! */ @@ -373,7 +380,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param start * DOCUMENT ME! * @param end @@ -410,10 +417,11 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mouseReleased(MouseEvent e) { if (scrollThread != null) @@ -429,7 +437,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param list * DOCUMENT ME! */ @@ -442,7 +450,7 @@ public class IdPanel extends JPanel implements MouseListener, 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)) @@ -469,6 +477,7 @@ public class IdPanel extends JPanel implements MouseListener, running = false; } + @Override public void run() { running = true; diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 39bd626..9f109ee 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.gui; @@ -29,7 +29,6 @@ import javax.swing.*; import org.exolab.castor.xml.*; -import uk.ac.vamsas.objects.utils.MapList; import jalview.bin.Cache; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; @@ -37,17 +36,16 @@ import jalview.datamodel.AlignmentI; 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 $ */ @@ -55,7 +53,7 @@ public class Jalview2XML { /** * create/return unique hash string for sq - * + * * @param sq * @return new or existing unique string for sq */ @@ -261,7 +259,7 @@ public class Jalview2XML /** * Writes a jalview project archive to the given Jar output stream. - * + * * @param jout */ public void SaveState(JarOutputStream jout) @@ -402,7 +400,7 @@ public class Jalview2XML /** * create a JalviewModel from an algnment view and marshall it to a * JarOutputStream - * + * * @param ap * panel to create jalview model for * @param fileName @@ -811,13 +809,13 @@ public class Jalview2XML { 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 @@ -1272,7 +1270,7 @@ public class Jalview2XML /** * 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 @@ -1303,7 +1301,7 @@ public class Jalview2XML /** * return local jalview object mapped to ID, if it exists - * + * * @param idcode * (may be null) * @return null or object bound to idcode @@ -1539,7 +1537,7 @@ public class Jalview2XML /** * Load a jalview project archive from a jar file - * + * * @param file * - HTTP URL or filename */ @@ -1583,6 +1581,7 @@ public class Jalview2XML return new jarInputStreamProvider() { + @Override public JarInputStream getJarInputStream() throws IOException { if (_url != null) @@ -1595,6 +1594,7 @@ public class Jalview2XML } } + @Override public String getFilename() { return file; @@ -1607,7 +1607,7 @@ public class Jalview2XML * 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 */ @@ -1759,6 +1759,7 @@ public class Jalview2XML { javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { JOptionPane.showInternalMessageDialog(Desktop.desktop, @@ -1783,7 +1784,7 @@ public class Jalview2XML * 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) { @@ -1864,7 +1865,7 @@ public class Jalview2XML /** * Load alignment frame from jalview XML DOM object - * + * * @param object * DOM * @param file @@ -1902,7 +1903,7 @@ public class Jalview2XML if (seqRefIds.get(seqId) != null) { - tmpseqs.add((jalview.datamodel.Sequence) seqRefIds.get(seqId)); + tmpseqs.add(seqRefIds.get(seqId)); multipleView = true; } else @@ -1925,7 +1926,7 @@ public class Jalview2XML hiddenSeqs = new Vector(); } - hiddenSeqs.addElement((jalview.datamodel.Sequence) seqRefIds + hiddenSeqs.addElement(seqRefIds .get(seqId)); } @@ -2273,7 +2274,7 @@ public class Jalview2XML jaa.belowAlignment=an[i].isBelowAlignment(); } jaa.setCalcId(an[i].getCalcId()); - + if (jaa.autoCalculated) { autoAlan.add(new JvAnnotRow(i, jaa)); @@ -2614,7 +2615,7 @@ public class Jalview2XML // 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; @@ -2753,7 +2754,7 @@ public class Jalview2XML newFileLoc.append(Platform.escapeString((String) filedat[0])); pdbfilenames.addElement((String) filedat[0]); pdbids.addElement((String) filedat[1]); - seqmaps.addElement((SequenceI[]) ((Vector) filedat[2]) + seqmaps.addElement(((Vector) filedat[2]) .toArray(new SequenceI[0])); newFileLoc.append("\""); cp = ecp + 1; // advance beyond last \" and set cursor so we can @@ -2780,7 +2781,7 @@ public class Jalview2XML newFileLoc.append(((String) filedat[0])); pdbfilenames.addElement((String) filedat[0]); pdbids.addElement((String) filedat[1]); - seqmaps.addElement((SequenceI[]) ((Vector) filedat[2]) + seqmaps.addElement(((Vector) filedat[2]) .toArray(new SequenceI[0])); newFileLoc.append(" \""); newFileLoc.append((String) filedat[0]); @@ -2816,10 +2817,10 @@ public class Jalview2XML // 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; @@ -2829,6 +2830,7 @@ public class Jalview2XML { javax.swing.SwingUtilities.invokeAndWait(new Runnable() { + @Override public void run() { AppJmol sview = null; @@ -2875,30 +2877,30 @@ public class Jalview2XML // viewer Object[] filedat = oldFiles.get(id); String pdbFile = (String) filedat[0]; - SequenceI[] seq = (SequenceI[]) ((Vector) filedat[2]) + SequenceI[] seq = ((Vector) 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); } } } @@ -3358,7 +3360,7 @@ public class Jalview2XML /** * TODO remove this method - * + * * @param view * @return AlignFrame bound to sequenceSetId from view, if one exists. private * AlignFrame getSkippedFrame(Viewport view) { if (skipList==null) { @@ -3369,7 +3371,7 @@ public class Jalview2XML /** * 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 */ @@ -3442,7 +3444,7 @@ public class Jalview2XML } /** - * + * * @param vamsasSeq * sequence definition to create/merge dataset sequence for * @param ds @@ -3460,7 +3462,7 @@ public class Jalview2XML jalview.datamodel.SequenceI dsq = null; if (sq != null && sq.getDatasetSequence() != null) { - dsq = (jalview.datamodel.SequenceI) sq.getDatasetSequence(); + dsq = sq.getDatasetSequence(); } String sqid = vamsasSeq.getDsseqid(); @@ -3566,7 +3568,7 @@ public class Jalview2XML /** * make a new dataset ID for this jalview dataset alignment - * + * * @param dataset * @return */ @@ -3747,15 +3749,16 @@ public class Jalview2XML * 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. @@ -3830,13 +3833,13 @@ public class Jalview2XML * 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) @@ -3908,7 +3911,7 @@ public class Jalview2XML * 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) @@ -3920,7 +3923,7 @@ public class Jalview2XML /** * uses skipList2 as the skipList for skipping views on sequence sets * associated with keys in the skipList - * + * * @param skipList2 */ public void setSkipList(Hashtable skipList2) diff --git a/src/jalview/gui/PaintRefresher.java b/src/jalview/gui/PaintRefresher.java index 219fbf8..91a0978 100755 --- a/src/jalview/gui/PaintRefresher.java +++ b/src/jalview/gui/PaintRefresher.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.gui; @@ -26,7 +26,7 @@ import jalview.datamodel.*; /** * DOCUMENT ME! - * + * * @author $author$ * @version $Revision$ */ @@ -36,7 +36,7 @@ public class PaintRefresher /** * DOCUMENT ME! - * + * * @param comp * DOCUMENT ME! * @param al @@ -243,7 +243,7 @@ public class PaintRefresher { if (comps.elementAt(i) instanceof AlignmentPanel) { - tmp.addElement(((AlignmentPanel) comps.elementAt(i))); + tmp.addElement(comps.elementAt(i)); } } AlignmentPanel[] result = new AlignmentPanel[tmp.size()]; diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 13527d0..cdaa5b9 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.gui; @@ -32,7 +32,7 @@ import jalview.structure.*; /** * DOCUMENT ME! - * + * * @author $author$ * @version $Revision: 1.130 $ */ @@ -98,7 +98,7 @@ public class SeqPanel extends JPanel implements MouseListener, /** * Creates a new SeqPanel object. - * + * * @param avp * DOCUMENT ME! * @param p @@ -298,7 +298,7 @@ public class SeqPanel extends JPanel implements MouseListener, void setCursorPosition() { - SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt( + SequenceI sequence = av.getAlignment().getSequenceAt( seqCanvas.cursorY); seqCanvas.cursorX = sequence.findIndex(getKeyboardNo1() - 1); @@ -393,7 +393,7 @@ public class SeqPanel extends JPanel implements MouseListener, void setSelectionAreaAtCursor(boolean topLeft) { - SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt( + SequenceI sequence = av.getAlignment().getSequenceAt( seqCanvas.cursorY); if (av.getSelectionGroup() != null) @@ -483,7 +483,7 @@ public class SeqPanel extends JPanel implements MouseListener, editSequence(false, false, seqCanvas.cursorX); endEditing(); } - + void insertNucAtCursor(boolean group,String nuc){ groupEditing = group; startseq = seqCanvas.cursorY; @@ -535,10 +535,11 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param evt * DOCUMENT ME! */ + @Override public void mouseReleased(MouseEvent evt) { mouseDragging = false; @@ -555,10 +556,11 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param evt * DOCUMENT ME! */ + @Override public void mousePressed(MouseEvent evt) { lastMousePress = evt.getPoint(); @@ -608,6 +610,7 @@ public class SeqPanel extends JPanel implements MouseListener, String lastMessage; + @Override public void mouseOverSequence(SequenceI sequence, int index, int pos) { String tmp = sequence.hashCode() + " " + index + " " + pos; @@ -620,6 +623,7 @@ public class SeqPanel extends JPanel implements MouseListener, lastMessage = tmp; } + @Override public void highlightSequence(SearchResults results) { if (av.followHighlight) @@ -632,6 +636,7 @@ public class SeqPanel extends JPanel implements MouseListener, seqCanvas.highlightSearchResults(results); } + @Override public void updateColours(SequenceI seq, int index) { System.out.println("update the seqPanel colours"); @@ -640,10 +645,11 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param evt * DOCUMENT ME! */ + @Override public void mouseMoved(MouseEvent evt) { if (editingSeqs) @@ -756,7 +762,7 @@ public class SeqPanel extends JPanel implements MouseListener, /** * appends the features at rpos to the given stringbuffer ready for display in * a tooltip - * + * * @param tooltipText2 * @param linkImageURL * @param rpos @@ -897,7 +903,7 @@ public class SeqPanel extends JPanel implements MouseListener, /** * Set status message in alignment panel - * + * * @param sequence * aligned sequence object * @param res @@ -945,10 +951,11 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param evt * DOCUMENT ME! */ + @Override public void mouseDragged(MouseEvent evt) { if (mouseWheelPressed) @@ -1169,7 +1176,7 @@ public class SeqPanel extends JPanel implements MouseListener, 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 @@ -1425,10 +1432,11 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mouseEntered(MouseEvent e) { if (oldSeq < 0) @@ -1445,10 +1453,11 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ + @Override public void mouseExited(MouseEvent e) { if (av.getWrapAlignment()) @@ -1462,6 +1471,7 @@ public class SeqPanel extends JPanel implements MouseListener, } } + @Override public void mouseClicked(MouseEvent evt) { SequenceGroup sg = null; @@ -1496,6 +1506,7 @@ public class SeqPanel extends JPanel implements MouseListener, } } + @Override public void mouseWheelMoved(MouseWheelEvent e) { e.consume(); @@ -1512,7 +1523,7 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param evt * DOCUMENT ME! */ @@ -1537,7 +1548,7 @@ public class SeqPanel extends JPanel implements MouseListener, return; } - SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt(seq); + SequenceI sequence = av.getAlignment().getSequenceAt(seq); if ((sequence == null) || (res > sequence.getLength())) { @@ -1657,7 +1668,7 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param evt * DOCUMENT ME! */ @@ -1700,7 +1711,7 @@ public class SeqPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param evt * DOCUMENT ME! */ @@ -1857,6 +1868,7 @@ public class SeqPanel extends JPanel implements MouseListener, running = false; } + @Override public void run() { running = true; @@ -1899,6 +1911,7 @@ public class SeqPanel extends JPanel implements MouseListener, /** * modify current selection according to a received message. */ + @Override public void selection(SequenceGroup seqsel, ColumnSelection colsel, SelectionSource source) { diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index e43f82c..9c51409 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.gui; @@ -25,16 +25,11 @@ import java.awt.event.*; 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 @@ -63,7 +58,7 @@ 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 @@ -142,6 +137,7 @@ public class SequenceFetcher extends JPanel implements Runnable Thread sf = new Thread(new Runnable() { + @Override public void run() { if (getSequenceFetcherSingleton(guiWindow) != null) @@ -152,6 +148,7 @@ public class SequenceFetcher extends JPanel implements Runnable { javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { JOptionPane @@ -182,7 +179,7 @@ public class SequenceFetcher extends JPanel implements Runnable /** * called by thread spawned by constructor - * + * * @param guiWindow */ private void initGui(IProgressIndicator guiWindow) @@ -236,6 +233,7 @@ public class SequenceFetcher extends JPanel implements Runnable ok.setText("OK"); ok.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { ok_actionPerformed(); @@ -244,6 +242,7 @@ public class SequenceFetcher extends JPanel implements Runnable clear.setText("Clear"); clear.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { clear_actionPerformed(); @@ -253,6 +252,7 @@ public class SequenceFetcher extends JPanel implements Runnable example.setText("Example"); example.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { example_actionPerformed(); @@ -261,6 +261,7 @@ public class SequenceFetcher extends JPanel implements Runnable close.setText("Close"); close.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { close_actionPerformed(e); @@ -270,6 +271,7 @@ public class SequenceFetcher extends JPanel implements Runnable textArea.setLineWrap(true); textArea.addKeyListener(new KeyAdapter() { + @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) @@ -289,6 +291,7 @@ public class SequenceFetcher extends JPanel implements Runnable database.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { try @@ -416,6 +419,7 @@ public class SequenceFetcher extends JPanel implements Runnable close.setEnabled(true); } + @Override public void run() { String error = ""; @@ -721,7 +725,7 @@ public class SequenceFetcher extends JPanel implements Runnable } /** - * + * * @return a standard title for any results retrieved using the currently * selected source and settings */ @@ -809,6 +813,7 @@ public class SequenceFetcher extends JPanel implements Runnable resetDialog(); javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { JOptionPane.showInternalMessageDialog(Desktop.desktop, error, diff --git a/src/jalview/io/VamsasAppDatastore.java b/src/jalview/io/VamsasAppDatastore.java index 93460e3..a2bf424 100644 --- a/src/jalview/io/VamsasAppDatastore.java +++ b/src/jalview/io/VamsasAppDatastore.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.io; @@ -20,11 +20,7 @@ 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; @@ -34,8 +30,6 @@ import jalview.io.vamsas.Datasetsequence; 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; @@ -52,14 +46,14 @@ import uk.ac.vamsas.objects.core.*; 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 { @@ -184,7 +178,7 @@ public class VamsasAppDatastore } /** - * + * * @param vobj * @return Jalview datamodel object bound to the vamsas document object */ @@ -251,7 +245,7 @@ public class VamsasAppDatastore /** * put the alignment viewed by AlignViewport into cdoc. - * + * * @param av * alignViewport to be stored * @param aFtitle @@ -492,14 +486,14 @@ public class VamsasAppDatastore /* * 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); @@ -725,7 +719,7 @@ public class VamsasAppDatastore * 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. @@ -747,7 +741,7 @@ public class VamsasAppDatastore /** * remove docseqs from the given alignment marking provenance appropriately * and removing any references to the sequences. - * + * * @param alignment * @param docseqs */ @@ -815,7 +809,7 @@ public class VamsasAppDatastore * 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) @@ -1164,7 +1158,7 @@ public class VamsasAppDatastore /** * set vamsas annotation object type from jalview annotation - * + * * @param an * @param alan */ @@ -1212,7 +1206,7 @@ public class VamsasAppDatastore /** * get start VorbaID * binding tables - * + * * @param oldjvobject * @param newjvobject * (may be null) @@ -1516,7 +1514,7 @@ public class VamsasAppDatastore /** * translate the Vobject keys to strings for use in Jalview2XML - * + * * @param jv2vobj2 * @return */ @@ -1534,7 +1532,7 @@ public class VamsasAppDatastore /** * translate the Vobject values to strings for use in Jalview2XML - * + * * @param vobj2jv2 * @return hashtable with string values */ @@ -1552,7 +1550,7 @@ public class VamsasAppDatastore /** * synchronize Jalview from the vamsas document - * + * * @return number of new views from document */ public int updateToJalview() @@ -1983,7 +1981,7 @@ public class VamsasAppDatastore * 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[], @@ -2401,7 +2399,7 @@ public class VamsasAppDatastore * 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} */ @@ -2459,7 +2457,7 @@ public class VamsasAppDatastore /** * 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. */ @@ -2511,7 +2509,7 @@ public class VamsasAppDatastore } /** - * + * * @param maprange * where the from range is the local mapped range, and the to range * is the 'mapped' range in the MapRangeType @@ -2536,7 +2534,7 @@ public class VamsasAppDatastore /** * initialise a range type object from a set of start/end inclusive intervals - * + * * @param mrt * @param range */ @@ -2553,7 +2551,7 @@ public class VamsasAppDatastore /** * initialise a MapType object from a MapList object. - * + * * @param maprange * @param ml * @param setUnits @@ -2578,12 +2576,12 @@ public class VamsasAppDatastore * 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); } } @@ -2591,7 +2589,7 @@ public class VamsasAppDatastore * 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) @@ -2609,7 +2607,7 @@ public class VamsasAppDatastore } /** - * + * * @return default initial provenance list for a Jalview created vamsas * object. */ diff --git a/src/jalview/io/vamsas/Tree.java b/src/jalview/io/vamsas/Tree.java index ae53074..5caded1 100644 --- a/src/jalview/io/vamsas/Tree.java +++ b/src/jalview/io/vamsas/Tree.java @@ -1,18 +1,18 @@ /* * 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 . */ package jalview.io.vamsas; @@ -24,7 +24,6 @@ import java.util.List; import java.util.Vector; import jalview.analysis.NJTree; -import jalview.analysis.SequenceIdMatcher; import jalview.bin.Cache; import jalview.datamodel.AlignmentI; import jalview.datamodel.AlignmentView; @@ -33,7 +32,6 @@ import jalview.datamodel.SeqCigar; 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; @@ -101,9 +99,10 @@ public class Tree extends DatastoreItem /* * (non-Javadoc) - * + * * @see jalview.io.vamsas.DatastoreItem#addFromDocument() */ + @Override public void addFromDocument() { tree = (uk.ac.vamsas.objects.core.Tree) vobj; // vtree; @@ -131,9 +130,10 @@ public class Tree extends DatastoreItem /* * (non-Javadoc) - * + * * @see jalview.io.vamsas.DatastoreItem#conflict() */ + @Override public void conflict() { Cache.log @@ -142,9 +142,10 @@ public class Tree extends DatastoreItem /* * (non-Javadoc) - * + * * @see jalview.io.vamsas.DatastoreItem#update() */ + @Override public void updateToDoc() { if (isModifiable(tree.getModifiable())) @@ -162,9 +163,10 @@ public class Tree extends DatastoreItem /* * (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 @@ -172,7 +174,7 @@ public class Tree extends DatastoreItem // 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 = @@ -199,7 +201,7 @@ public class Tree extends DatastoreItem /** * correctly creates provenance for trees calculated on an alignment by * jalview. - * + * * @param jal * @param tp * @return @@ -254,7 +256,7 @@ public class Tree extends DatastoreItem /** * look up SeqCigars in an existing alignment. - * + * * @param jal * @param sequences * @return vector of alignment sequences in order of SeqCigar array (but @@ -281,7 +283,7 @@ public class Tree extends DatastoreItem alsq.add(asq); } } - } + }} if (alsq.size() < sequences.length) Cache.log .warn("Not recovered all alignment sequences for given set of input sequence CIGARS"); @@ -289,9 +291,9 @@ public class Tree extends DatastoreItem } /** - * + * * Update jalview newick representation with TreeNode map - * + * * @param tp * the treepanel that this tree is bound to. */ @@ -356,7 +358,7 @@ public class Tree extends DatastoreItem // / TODO: refactor to vamsas :start /** * construct treenode mappings for mapped sequences - * + * * @param ntree * @param newick * @return @@ -433,7 +435,7 @@ public class Tree extends DatastoreItem /** * call to match up Treenode specs to NJTree parsed from document object. - * + * * @param nodespec * @param leaves * as returned from NJTree.findLeaves( .., ..) .. @@ -474,8 +476,9 @@ public class Tree extends DatastoreItem // todo: end refactor to vamsas library /** * add jalview object to vamsas document - * + * */ + @Override public void addToDocument() { tree = new uk.ac.vamsas.objects.core.Tree(); @@ -494,7 +497,7 @@ public class Tree extends DatastoreItem /** * 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 -- 1.7.10.2