}
/**
- * DOCUMENT ME!
+ * Calculate the width of the alignment labels based on the displayed names and any bounds on label width set in preferences.
*
- * @return DOCUMENT ME!
+ * @return Dimension giving the maximum width of the alignment label panel that should be used.
*/
public Dimension calculateIdWidth()
{
new Font(av.font.getName(), Font.ITALIC, av.font.getSize()));
AlignmentI al = av.getAlignment();
-
+ int afwidth = (alignFrame!=null ? alignFrame.getWidth() : 300);
+ int maxwidth = Math.max(20,Math.min(afwidth-200,(int) 2*afwidth/3));
int i = 0;
int idWidth = 0;
String id;
}
}
- return new Dimension(idWidth, 12);
+ return new Dimension(Math.min(maxwidth, idWidth), 12);
}
/**