+ g.fillPolygon(xPoints, yPoints, 3);
+ }
+ }
+
+ private final static BasicStroke dottedStroke = new BasicStroke(1,
+ BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 3f, new float[]
+ { 5f, 3f }, 0f);
+
+ private final static BasicStroke basicStroke = new BasicStroke();
+ /*
+ * Draw a selection group over a wrapped alignment
+ */
+ private void drawWrappedSelection(Graphics2D g, SequenceGroup group,
+ int canvasWidth, int canvasHeight, int startRes)
+ {
+ // chop the wrapped alignment extent up into panel-sized blocks and treat
+ // each block as if it were a block from an unwrapped alignment
+ g.setStroke(dottedStroke);
+ g.setColor(Color.RED);
+
+ int charWidth = av.getCharWidth();
+ int cWidth = (canvasWidth - labelWidthEast - labelWidthWest)
+ / charWidth;
+ int startx = startRes;
+ int maxwidth = av.getAlignment().getVisibleWidth();
+ // JAL-3253-applet had this:
+ // // height gap above each panel
+ // int charHeight = av.getCharHeight();
+ // int hgap = charHeight;
+ // if (av.getScaleAboveWrapped())
+ // {
+ // hgap += charHeight;
+ // }
+ // int dy = getAnnotationHeight() + hgap
+ // + av.getAlignment().getHeight() * charHeight;
+ // int ypos = hgap; // vertical offset
+
+ // this is from 0b573ed (gmungoc)
+ int dy = wrappedRepeatHeightPx;
+ int ypos = wrappedSpaceAboveAlignment;
+
+ while ((ypos <= canvasHeight) && (startx < maxwidth))
+ {
+ // set end value to be start + width, or maxwidth, whichever is smaller
+ int endx = startx + cWidth - 1;
+
+ if (endx > maxwidth)
+ {
+ endx = maxwidth;
+ }
+
+ g.translate(labelWidthWest, 0);
+ drawUnwrappedSelection(g, group, startx, endx, 0,
+ av.getAlignment().getHeight() - 1, ypos);
+ g.translate(-labelWidthWest, 0);
+
+ // update vertical offset
+ ypos += dy;
+
+ // update horizontal offset
+ startx += cWidth;