X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppVarna.java;fp=src%2Fjalview%2Fgui%2FAppVarna.java;h=ea16f2352e47138066e26be45d45b19003f3e124;hb=2dd39c36211f947fda099c550e711ef5905efefd;hp=a50de77ae95ed0b247af8b94a86d52623ccc20b3;hpb=4dd40d33a5becefd51c31a426f2501b21029f82c;p=jalview.git diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index a50de77..ea16f23 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -61,9 +61,9 @@ import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.RNA; -public class AppVarna extends JInternalFrame implements SelectionListener, - SecondaryStructureListener, InterfaceVARNASelectionListener, - VamsasSource +public class AppVarna extends JInternalFrame + implements SelectionListener, SecondaryStructureListener, + InterfaceVARNASelectionListener, VamsasSource { private static final byte[] PAIRS = new byte[] { '(', ')', '[', ']', '{', '}', '<', '>' }; @@ -177,12 +177,15 @@ public class AppVarna extends JInternalFrame implements SelectionListener, { this(ap); - String sname = aa.sequenceRef == null ? "secondary structure (alignment)" + String sname = aa.sequenceRef == null + ? "secondary structure (alignment)" : seq.getName() + " structure"; String theTitle = sname - + (aa.sequenceRef == null ? " trimmed to " + seq.getName() : ""); + + (aa.sequenceRef == null ? " trimmed to " + seq.getName() + : ""); theTitle = MessageManager.formatMessage("label.varna_params", - new String[] { theTitle }); + new String[] + { theTitle }); setTitle(theTitle); String gappedTitle = sname + " (with gaps)"; @@ -190,7 +193,8 @@ public class AppVarna extends JInternalFrame implements SelectionListener, addModel(gappedModel, gappedTitle); String trimmedTitle = "trimmed " + sname; - RnaModel trimmedModel = new RnaModel(trimmedTitle, aa, seq, null, false); + RnaModel trimmedModel = new RnaModel(trimmedTitle, aa, seq, null, + false); addModel(trimmedModel, trimmedTitle); vab.setSelectedIndex(0); } @@ -424,8 +428,8 @@ public class AppVarna extends JInternalFrame implements SelectionListener, end = shift.shift(end); } selectionHighlighter.highlightRegion(rna, start, end); - selectionHighlighter.getLastHighlight().setOutlineColor( - seqsel.getOutlineColour()); + selectionHighlighter.getLastHighlight() + .setOutlineColor(seqsel.getOutlineColour()); // TODO - translate column markings to positions on structure if present. vab.updateSelectedRNA(rna); } @@ -460,7 +464,8 @@ public class AppVarna extends JInternalFrame implements SelectionListener, } @Override - public void onSelectionChanged(BaseList arg0, BaseList arg1, BaseList arg2) + public void onSelectionChanged(BaseList arg0, BaseList arg1, + BaseList arg2) { // TODO translate selected regions in VARNA to a selection on the // alignpanel. @@ -577,7 +582,8 @@ public class AppVarna extends JInternalFrame implements SelectionListener, { if (!model.ann.isValidStruc()) { - throw new IllegalArgumentException("Invalid RNA structure annotation"); + throw new IllegalArgumentException( + "Invalid RNA structure annotation"); } /* @@ -622,11 +628,10 @@ public class AppVarna extends JInternalFrame implements SelectionListener, ShiftList offset = new ShiftList(); int ofstart = -1; int sleng = seq.getLength(); - char[] seqChars = seq.getSequence(); for (int i = 0; i < sleng; i++) { - if (Comparison.isGap(seqChars[i])) + if (Comparison.isGap(seq.getCharAt(i))) { if (ofstart == -1) { @@ -687,7 +692,8 @@ public class AppVarna extends JInternalFrame implements SelectionListener, { if (!model.ann.isValidStruc()) { - throw new IllegalArgumentException("Invalid RNA structure annotation"); + throw new IllegalArgumentException( + "Invalid RNA structure annotation"); } try