- });
-
- updateOverviewImage();
- }
-
- /**
- * DOCUMENT ME!
- */
- void checkValid()
- {
- if (boxY < 0)
- {
- boxY = 0;
- }
-
- if (boxY > (sequencesHeight - boxHeight))
- {
- boxY = sequencesHeight - boxHeight + 1;
- }
-
- if (boxX < 0)
- {
- boxX = 0;
- }
-
- if (boxX > (width - boxWidth))
- {
- if (av.hasHiddenColumns())
- {
- // Try smallest possible box
- boxWidth = (int) ((av.endRes - av.startRes + 1) * av.getCharWidth() * scalew);
- }
- boxX = width - boxWidth;
- }
-
- int col = (int) (boxX / scalew / av.getCharWidth());
- int row = (int) (boxY / scaleh / av.getCharHeight());
-
- if (av.hasHiddenColumns())
- {
- if (!av.getColumnSelection().isVisible(col))
- {
- return;
- }
-
- col = av.getColumnSelection().findColumnPosition(col);
- }
-
- if (av.hasHiddenRows())
- {
- row = av.getAlignment().getHiddenSequences()
- .findIndexWithoutHiddenSeqs(row);
- }
-
- ap.setScrollValues(col, row);
-
- }
-
- /**
- * DOCUMENT ME!
- */
- public void updateOverviewImage()
- {
- if (resizing)
- {
- resizeAgain = true;
- return;
- }
-
- resizing = true;
-
- if ((getWidth() > 0) && (getHeight() > 0))
- {
- width = getWidth();
- sequencesHeight = getHeight() - graphHeight;
- }
-
- setPreferredSize(new Dimension(width, sequencesHeight + graphHeight));
-
- Thread thread = new Thread(this);
- thread.start();
- repaint();
- }
-
- // This is set true if the user resizes whilst
- // the overview is being calculated
- boolean resizeAgain = false;
-
- /**
- * DOCUMENT ME!
- */
- @Override
- public void run()
- {
- miniMe = null;
-
- if (av.isShowSequenceFeatures())
- {
- fr.transferSettings(ap.getSeqPanel().seqCanvas.getFeatureRenderer());
- }
-
- int alwidth = av.getAlignment().getWidth();
- int alheight = av.getAlignment().getHeight()
- + av.getAlignment().getHiddenSequences().getSize();
-
- setPreferredSize(new Dimension(width, sequencesHeight + graphHeight));
-
- int fullsizeWidth = alwidth * av.getCharWidth();
- int fullsizeHeight = alheight * av.getCharHeight();
-
- scalew = (float) width / (float) fullsizeWidth;
- scaleh = (float) sequencesHeight / (float) fullsizeHeight;
-
- miniMe = new BufferedImage(width, sequencesHeight + graphHeight,
- BufferedImage.TYPE_INT_RGB);