Merge branch 'develop' into features/JAL-2446NCList
[jalview.git] / src / jalview / gui / AppVarna.java
index f4a4f4d..ea16f23 100644 (file)
@@ -23,6 +23,7 @@ package jalview.gui;
 import jalview.analysis.AlignSeq;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.RnaViewerModel;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
@@ -60,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[] { '(', ')', '[', ']', '{',
       '}', '<', '>' };
@@ -176,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)";
@@ -189,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);
   }
@@ -400,7 +405,7 @@ public class AppVarna extends JInternalFrame implements SelectionListener,
 
   @Override
   public void selection(SequenceGroup seqsel, ColumnSelection colsel,
-          SelectionSource source)
+          HiddenColumns hidden, SelectionSource source)
   {
     if (source != ap.av)
     {
@@ -423,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);
     }
@@ -459,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.
@@ -576,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");
     }
 
     /*
@@ -621,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)
         {
@@ -686,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