- * 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!