+ overlayHiddenRegions(rows, cols);
+ // final update to progress bar if present
+ if (redraw)
+ {
+ sendProgressUpdate(pixelRow - 1, alignmentHeight, 0, 0);
+ }
+ else
+ {
+ sendProgressUpdate(alignmentHeight, miniMe.getHeight(), 0, 0);
+ }
+ return miniMe;
+ }
+
+ /*
+ * Calculate progress update value and fire event
+ * @param rowOffset number of rows to offset calculation by
+ * @return new rowOffset - return value only to be used when at end of a row
+ */
+ private int sendProgressUpdate(int position, int maximum, int rowOffset,
+ int lastUpdate)
+ {
+ int newUpdate = rowOffset
+ + Math.round(MAX_PROGRESS * ((float) position / maximum));
+ if (newUpdate > lastUpdate)
+ {
+ changeSupport.firePropertyChange(UPDATE, rowOffset, newUpdate);
+ return newUpdate;
+ }
+ return newUpdate;