+ 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
+ * @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);
+ }
+
+ /**
+ * legacy mode or post 2.11.3 ID width calculation
+ *
+ * @param legacy
+ * - uses annotation labels, not rendered label width (excludes
+ * additional decorators)
+ * @param maxwidth
+ * @param includeAnnotations
+ * @param visibleOnly
+ * @return
+ */
+ private Dimension calculateIdWidthOrLegacy(boolean legacy, int maxwidth,
+ boolean includeAnnotations, boolean visibleOnly)
+ {