- int ph = (progressPanel.getParent() == null ? 0
- : progressPanel.getHeight());
- // Resize is called on the initial display of the overview.
- // This code adjusts sizes to account for the progress bar if it has not
- // already been accounted for, which triggers another resize call for
- // the correct sizing, at which point the overview image is updated.
- // (This avoids a double recalculation of the image.)
- if (getWidth() == od.getWidth()
- && getHeight() == od.getHeight() + ph)
- {
- // BH: resizing is now exceptionally fast.
- updateOverviewImage();
- }
- else
- {
- int w = getWidth();
- int h = getHeight();
- if ((w > 0) && (h > 0))
- {
- if (dim != null)
- {
- dim.setSize(w, h - ph);
- }
- od.setWidth(w);
- od.setHeight(h - ph);
- updateOverviewImage();
- // repaint();
- }
- // BH 2019.07.29 this is unnecessary -- it is what layout managers are
- // for:
- // setPreferredSize(new Dimension(od.getWidth(), od.getHeight() +
- // ph));
- }