+ public void drawWrappedSelection(Graphics2D g, SequenceGroup group,
+ int canvasWidth,
+ int canvasHeight, int startRes)
+ {
+ int hgap = charHeight;
+ if (av.getScaleAboveWrapped())
+ {
+ hgap += charHeight;
+ }
+
+ int cWidth = (canvasWidth - LABEL_EAST - LABEL_WEST) / charWidth;
+ int cHeight = av.getAlignment().getHeight() * charHeight;
+
+ int endx;
+ int ypos = hgap;
+ int maxwidth = av.getAlignment().getWidth();
+
+ if (av.hasHiddenColumns())
+ {
+ maxwidth = av.getAlignment().getHiddenColumns()
+ .findColumnPosition(maxwidth);
+ }
+
+ while ((ypos <= canvasHeight) && (startRes < maxwidth))
+ {
+ endx = startRes + cWidth - 1;
+
+ if (endx > maxwidth)
+ {
+ endx = maxwidth;
+ }
+
+ g.translate(LABEL_WEST, 0);
+
+ drawUnwrappedSelection(g, group, startRes, endx, 0,
+ av.getAlignment().getHeight() - 1,
+ ypos);
+
+ g.translate(-LABEL_WEST, 0);
+
+ ypos += cHeight + getAnnotationHeight() + hgap;
+
+ startRes += cWidth;
+ }
+ }
+