X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentView.java;h=efb7c4ac1553193ea364dc4e1982abcbfb94cbc0;hb=50ff87bdae1829a7a7471ec393142ae659b40a11;hp=37f5e5c5b80e95c6f8ade149b3d048880d64b1bc;hpb=59d682209891099d46b960509907c79e3fb276fe;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index 37f5e5c..efb7c4a 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -1,22 +1,26 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) - * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * 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 * 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 . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.datamodel; +import jalview.util.MessageManager; import jalview.util.ShiftList; import java.io.PrintStream; @@ -45,6 +49,18 @@ public class AlignmentView */ private Vector scGroups; + private boolean isNa = false; + + /** + * false if the view concerns peptides + * + * @return + */ + public boolean isNa() + { + return isNa; + } + /** * Group defined over SeqCigars. Unlike AlignmentI associated groups, each * SequenceGroup hold just the essential properties for the group, but no @@ -98,6 +114,7 @@ public class AlignmentView (selectedRegionOnly ? selection : null)), (selectedRegionOnly && selection != null) ? selection .getStartRes() : 0); + isNa = alignment.isNucleotide(); // walk down SeqCigar array and Alignment Array - optionally restricted by // selected region. // test group membership for each sequence in each group, store membership @@ -225,8 +242,7 @@ public class AlignmentView { if (!seqcigararray.isSeqCigarArray()) { - throw new Error( - "Implementation Error - can only make an alignment view from a CigarArray of sequences."); + throw new Error(MessageManager.getString("error.implementation_error_can_only_make_alignmnet_from_cigararray")); } // contigs = seqcigararray.applyDeletions(); contigs = seqcigararray.getDeletedRegions(); @@ -636,7 +652,7 @@ public class AlignmentView { if (sequences == null || width <= 0) { - throw new Error("empty view cannot be updated."); + throw new Error(MessageManager.getString("error.empty_view_cannot_be_updated")); } if (nvismsa == null) { @@ -666,11 +682,7 @@ public class AlignmentView j++; if (mseq.length != sequences.length) { - throw new Error( - "Mismatch between number of sequences in block " - + j + " (" + mseq.length - + ") and the original view (" - + sequences.length + ")"); + throw new Error(MessageManager.formatMessage("error.mismatch_between_number_of_sequences_in_block", new String[]{Integer.valueOf(j).toString(),Integer.valueOf(mseq.length).toString(),Integer.valueOf(sequences.length).toString() })); } swidth = mseq[0].getLength(); // JBPNote: could ensure padded // here. @@ -823,7 +835,7 @@ public class AlignmentView else { // place gaps. - throw new Error("Padding not yet implemented."); + throw new Error(MessageManager.getString("error.padding_not_yet_implemented")); } } } @@ -836,9 +848,7 @@ public class AlignmentView { if (nvismsa.length != 1) { - throw new Error( - "Mismatch between visible blocks to update and number of contigs in view (contigs=0,blocks=" - + nvismsa.length); + throw new Error(MessageManager.formatMessage("error.mismatch_between_visible_blocks_to_update_and_number_of_contigs_in_view", new String[]{Integer.valueOf(nvismsa.length).toString()})); } if (nvismsa[0] != null) {