+ public Dimension calculateDefaultAlignmentIdWidth()
+ {
+ return calculateIdWidth(-1, false, false);
+ }
+
+ /**
+ * pre 2.11.3 Id width calculation - used when importing old projects only
+ *
+ * @return
+ */
+ public int getLegacyIdWidth()
+ {
+ int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
+ int idWidth = Math.min(afwidth - 200, 2 * afwidth / 3);
+ int maxwidth = Math.max(IdwidthAdjuster.MIN_ID_WIDTH, idWidth);
+ Dimension w = calculateIdWidthOrLegacy(true, maxwidth, false, false);
+ return w.width;
+ }
+
+ /**
+ * Calculate the width of the alignment labels based on the displayed names
+ * and any bounds on label width set in preferences. Also includes annotations
+ * not actually visible.
+ *
+ * FIXME JAL-244 JAL-4091 - doesn't include sequence associated annotation
+ * label decorators and only called during tests
+ *
+ * @param maxwidth
+ * -1 or maximum width allowed for IdWidth
+ * @return Dimension giving the maximum width of the alignment label panel
+ * that should be used.
+ */
+ protected Dimension calculateIdWidth(int maxwidth)
+ {
+ return calculateIdWidth(maxwidth, true, false);
+ }
+