Merge branch 'develop' into releases/Release_2_10_2_Branch
[jalview.git] / src / jalview / gui / SeqCanvas.java
index a134afa..a052ae3 100755 (executable)
@@ -144,9 +144,9 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
         {
           g.drawString(mstring, mpos * charWidth, ypos - (charHeight / 2));
         }
-        g.drawLine((mpos * charWidth) + (charWidth / 2), (ypos + 2)
-                - (charHeight / 2), (mpos * charWidth) + (charWidth / 2),
-                ypos - 2);
+        g.drawLine((mpos * charWidth) + (charWidth / 2),
+                (ypos + 2) - (charHeight / 2),
+                (mpos * charWidth) + (charWidth / 2), ypos - 2);
       }
     }
   }
@@ -208,8 +208,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
       {
         int x = LABEL_WEST - fm.stringWidth(String.valueOf(value))
                 - charWidth / 2;
-        g.drawString(value + "", x, (ypos + (i * charHeight))
-                - (charHeight / 5));
+        g.drawString(value + "", x,
+                (ypos + (i * charHeight)) - (charHeight / 5));
       }
     }
   }
@@ -260,8 +260,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
 
       if (value != -1)
       {
-        g.drawString(String.valueOf(value), 0, (ypos + (i * charHeight))
-                - (charHeight / 5));
+        g.drawString(String.valueOf(value), 0,
+                (ypos + (i * charHeight)) - (charHeight / 5));
       }
     }
   }
@@ -356,10 +356,9 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
     // img and call later.
     super.paintComponent(g);
 
-    if (lcimg != null
-            && (fastPaint
-                    || (getVisibleRect().width != g.getClipBounds().width) || (getVisibleRect().height != g
-                    .getClipBounds().height)))
+    if (lcimg != null && (fastPaint
+            || (getVisibleRect().width != g.getClipBounds().width)
+            || (getVisibleRect().height != g.getClipBounds().height)))
     {
       g.drawImage(lcimg, 0, 0, this);
       fastPaint = false;
@@ -578,10 +577,12 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
           }
 
           gg.fillPolygon(
-                  new int[] { res * charWidth - charHeight / 4,
+                  new int[]
+                  { res * charWidth - charHeight / 4,
                       res * charWidth + charHeight / 4, res * charWidth },
-                  new int[] { ypos - (charHeight / 2),
-                      ypos - (charHeight / 2), ypos - (charHeight / 2) + 8 },
+                  new int[]
+                  { ypos - (charHeight / 2), ypos - (charHeight / 2),
+                      ypos - (charHeight / 2) + 8 },
                   3);
 
         }
@@ -611,8 +612,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
           annotations = new AnnotationPanel(av);
         }
 
-        annotations.renderer.drawComponent(annotations, av, g, -1,
-                startRes, endx + 1);
+        annotations.renderer.drawComponent(annotations, av, g, -1, startRes,
+                endx + 1);
         g.translate(0, -cHeight - ypos - 3);
       }
       g.setClip(clip);
@@ -657,8 +658,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
    * @param offset
    *          DOCUMENT ME!
    */
-  public void drawPanel(Graphics g1, int startRes, int endRes,
-          int startSeq, int endSeq, int offset)
+  public void drawPanel(Graphics g1, int startRes, int endRes, int startSeq,
+          int endSeq, int offset)
   {
     updateViewport();
     if (!av.hasHiddenColumns())
@@ -748,8 +749,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
 
       if (av.isShowSequenceFeatures())
       {
-        fr.drawSequence(g, nextSeq, startRes, endRes, offset
-                + ((i - startSeq) * charHeight), false);
+        fr.drawSequence(g, nextSeq, startRes, endRes,
+                offset + ((i - startSeq) * charHeight), false);
       }
 
       // / Highlight search Results once all sequences have been drawn
@@ -763,9 +764,9 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
           for (int r = 0; r < visibleResults.length; r += 2)
           {
             sr.drawHighlightedText(nextSeq, visibleResults[r],
-                    visibleResults[r + 1], (visibleResults[r] - startRes)
-                            * charWidth, offset
-                            + ((i - startSeq) * charHeight));
+                    visibleResults[r + 1],
+                    (visibleResults[r] - startRes) * charWidth,
+                    offset + ((i - startSeq) * charHeight));
           }
         }
       }
@@ -822,7 +823,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
         {
           sx = (group.getStartRes() - startRes) * charWidth;
           sy = offset + ((i - startSeq) * charHeight);
-          ex = (((group.getEndRes() + 1) - group.getStartRes()) * charWidth) - 1;
+          ex = (((group.getEndRes() + 1) - group.getStartRes()) * charWidth)
+                  - 1;
 
           if (sx + ex < 0 || sx > visWidth)
           {
@@ -830,21 +832,19 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
           }
 
           if ((sx <= (endRes - startRes) * charWidth)
-                  && group.getSequences(null).contains(
-                          av.getAlignment().getSequenceAt(i)))
+                  && group.getSequences(null)
+                          .contains(av.getAlignment().getSequenceAt(i)))
           {
-            if ((bottom == -1)
-                    && !group.getSequences(null).contains(
-                            av.getAlignment().getSequenceAt(i + 1)))
+            if ((bottom == -1) && !group.getSequences(null)
+                    .contains(av.getAlignment().getSequenceAt(i + 1)))
             {
               bottom = sy + charHeight;
             }
 
             if (!inGroup)
             {
-              if (((top == -1) && (i == 0))
-                      || !group.getSequences(null).contains(
-                              av.getAlignment().getSequenceAt(i - 1)))
+              if (((top == -1) && (i == 0)) || !group.getSequences(null)
+                      .contains(av.getAlignment().getSequenceAt(i - 1)))
               {
                 top = sy;
               }
@@ -855,8 +855,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
               if (group == av.getSelectionGroup())
               {
                 g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT,
-                        BasicStroke.JOIN_ROUND, 3f, new float[] { 5f, 3f },
-                        0f));
+                        BasicStroke.JOIN_ROUND, 3f, new float[]
+                        { 5f, 3f }, 0f));
                 g.setColor(Color.RED);
               }
               else