JAL-4090 JAL-1551 spotlessApply
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index fe6477e..d3f80ce 100644 (file)
@@ -298,8 +298,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
   {
     return calculateIdWidth(-1, false, false);
   }
+
   /**
    * pre 2.11.3 Id width calculation - used when importing old projects only
+   * 
    * @return
    */
   public int getLegacyIdWidth()
@@ -328,26 +330,34 @@ public class AlignmentPanel extends GAlignmentPanel implements
   {
     return calculateIdWidth(maxwidth, true, false);
   }
+
   /**
    * Calculate the width of the alignment labels based on the displayed names
    * and any bounds on label width set in preferences.
    * 
    * @param maxwidth
    *          -1 or maximum width allowed for IdWidth
-   * @param includeAnnotations - when true includes width of any additional marks in annotation id panel 
-   * @param visibleOnly - when true, ignore label widths for hidden annotation rows 
+   * @param includeAnnotations
+   *          - when true includes width of any additional marks in annotation
+   *          id panel
+   * @param visibleOnly
+   *          - when true, ignore label widths for hidden annotation rows
    * @return Dimension giving the maximum width of the alignment label panel
    *         that should be used.
    */
   public Dimension calculateIdWidth(int maxwidth,
           boolean includeAnnotations, boolean visibleOnly)
   {
-    return calculateIdWidthOrLegacy(false, maxwidth, includeAnnotations, visibleOnly);
+    return calculateIdWidthOrLegacy(false, maxwidth, includeAnnotations,
+            visibleOnly);
   }
-  
+
   /**
    * legacy mode or post 2.11.3 ID width calculation
-   * @param legacy - uses annotation labels, not rendered label width (excludes additional decorators)
+   * 
+   * @param legacy
+   *          - uses annotation labels, not rendered label width (excludes
+   *          additional decorators)
    * @param maxwidth
    * @param includeAnnotations
    * @param visibleOnly
@@ -606,7 +616,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
     // this is called after loading new annotation onto alignment
     if (alignFrame.getHeight() == 0)
     {
-      jalview.bin.Console.error("adjustAnnotationHeight called with zero height alignment window");
+      jalview.bin.Console.error(
+              "adjustAnnotationHeight called with zero height alignment window");
     }
     validateAnnotationDimensions(true);
     addNotify();
@@ -1040,13 +1051,13 @@ public class AlignmentPanel extends GAlignmentPanel implements
     final int idWidth, idWidthForGui;
     // otherwise calculate it
     idWidth = getVisibleIdWidth(false);
-//    if (getIdPanel()!=null && getIdPanel().getWidth()>0)
-//    {
-//      // use the current IdPanel's width, if its set and non-zero
-//      idWidthForGui = getIdPanel().getWidth();
-//    } else {
-//      idWidthForGui=0;
-//    }
+    // if (getIdPanel()!=null && getIdPanel().getWidth()>0)
+    // {
+    // // use the current IdPanel's width, if its set and non-zero
+    // idWidthForGui = getIdPanel().getWidth();
+    // } else {
+    // idWidthForGui=0;
+    // }
     /*
      * Get the horizontal offset to where we draw the sequences.
      * This is idWidth if using a single Graphics context, else zero.
@@ -1096,7 +1107,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     final int alignmentDrawnHeight = (endSeq - startSeq) * charHeight + 3;
 
     alignmentGraphics.setColor(Color.white);
-    alignmentGraphics.fillRect(0, 0, pageWidth, pageHeight+scaleHeight);
+    alignmentGraphics.fillRect(0, 0, pageWidth, pageHeight + scaleHeight);
 
     /*
      * draw the Scale at horizontal offset, then reset to top left (0, 0)
@@ -1114,9 +1125,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
     IdCanvas idCanvas = getIdPanel().getIdCanvas();
     List<SequenceI> selection = av.getSelectionGroup() == null ? null
             : av.getSelectionGroup().getSequences(null);
-    
+
     idCanvas.drawIds((Graphics2D) idGraphics, av, startSeq, endSeq - 1,
-            selection, false,idWidth);
+            selection, false, idWidth);
 
     idGraphics.setFont(av.getFont());
     idGraphics.translate(0, -scaleHeight);
@@ -1263,7 +1274,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     // see if rendering offscreen - check preferences and calc width accordingly
     if (!onscreen && Cache.getDefault("FIGURE_AUTOIDWIDTH", false))
     {
-      return calculateIdWidth(-1,true,true).width;
+      return calculateIdWidth(-1, true, true).width;
     }
     Integer idwidth = onscreen ? null
             : Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH");