import java.io.PrintWriter;
import java.util.List;
+import javax.swing.BoundedRangeModel;
import javax.swing.SwingUtilities;
import jalview.analysis.AnnotationSorter;
// Also check annotation label widths
if (includeAnnotations && al.getAlignmentAnnotation() != null)
{
- fm = c.getFontMetrics(getAlabels().getFont());
+ if (legacy)
+ {
+ fm = c.getFontMetrics(getAlabels().getFont());
+ }
if (!legacy || Jalview.isHeadlessMode())
{
}
/**
+ * Answers true if the panel has no horizontal scrollbar, or the scrollbar is
+ * at its rightmost position, else false.
+ *
+ * @return
+ */
+ boolean isScrolledFullyRight()
+ {
+ if (hscroll == null)
+ {
+ return true;
+ }
+ BoundedRangeModel model = hscroll.getModel();
+ return (model.getExtent() + model.getValue() >= model.getMaximum());
+ }
+
+ /**
* Respond to adjustment event when horizontal or vertical scrollbar is
* changed
*
return idwidth.intValue() + ID_WIDTH_PADDING;
}
- int w = getIdPanel().getWidth();
- w = calculateIdWidth(-1, true, true).width;
+ // int w = getIdPanel().getWidth();
+ // w = calculateIdWidth(-1, true, true).width;
+ int w = calculateIdWidth(-1, true, true).width;
return (w > 0 ? w : calculateIdWidth().width);
}
// need to obtain default alignment width and then add in any
// additional allowance for id margin
// this duplicates the calculation in getWrappedHeight but adjusts for
- // offscreen idWith
+ // offscreen idWidth
width = alignFrame.getWidth() - vscroll.getPreferredSize().width
- alignFrame.getInsets().left - alignFrame.getInsets().right
- getVisibleIdWidth() + getVisibleIdWidth(false);