- /*
- * Javascript does not call componentResized on initial display,
- * so do the update here
- */
- boolean doUpdate = /** @j2sNative true || */ false;
- if (doUpdate)
- updateOverviewImage();
+ /***
+ * 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.)
+ */
+ protected void resizePanel()
+ {
+ int ph = (progressPanel.getParent() == null ? 0
+ : progressPanel.getHeight());
+ if (getWidth() == od.getWidth() && getHeight() == od.getHeight() + ph)
+ {
+ if (canvas.lastMiniMe == null)
+ {
+ 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();
+ }
+ }
+ }
+
+ /**
+ * Creates the appropriate type of OverviewDimensions, with the desired size
+ */
+ private void createOverviewDimensions()
+ {
+ boolean showAnnotation = (av.isShowAnnotation()
+ && av.getAlignmentConservationAnnotation() != null);
+ if (showHidden)
+ {
+ od = new OverviewDimensionsShowHidden(av.getRanges(), showAnnotation,
+ dim);
+ }
+ else
+ {
+ od = new OverviewDimensionsHideHidden(av.getRanges(), showAnnotation,
+ dim);
+ }