+ if (av.getSelectionGroup() != null
+ || av.getAlignment().getGroups().size() > 0)
+ {
+ drawGroupsBoundaries(g, startRes, endRes, startSeq, endSeq, offset);
+ }
+
+ }
+
+ void drawGroupsBoundaries(Graphics g1, int startRes, int endRes,
+ int startSeq, int endSeq, int offset)
+ {
+ Graphics2D g = (Graphics2D) g1;
+ //
+ // ///////////////////////////////////
+ // Now outline any areas if necessary
+ // ///////////////////////////////////
+
+ SequenceGroup group = null;
+ int groupIndex = -1;
+
+ if (av.getAlignment().getGroups().size() > 0)
+ {
+ group = av.getAlignment().getGroups().get(0);
+ groupIndex = 0;
+ }
+
+ if (group != null)
+ {
+ g.setStroke(new BasicStroke());
+ g.setColor(group.getOutlineColour());
+
+ do
+ {
+ drawPartialGroupOutline(g, group, startRes, endRes, startSeq,
+ endSeq, offset);
+
+ groupIndex++;
+
+ g.setStroke(new BasicStroke());
+
+ if (groupIndex >= av.getAlignment().getGroups().size())
+ {
+ break;
+ }
+
+ group = av.getAlignment().getGroups().get(groupIndex);
+
+ } while (groupIndex < av.getAlignment().getGroups().size());
+
+ }
+
+ }
+
+
+ /*
+ * Draw the selection group as a separate image and overlay
+ */
+ private BufferedImage drawSelectionGroup(int startRes, int endRes,
+ int startSeq, int endSeq)
+ {
+ // get a new image of the correct size
+ BufferedImage selectionImage = setupImage();
+
+ if (selectionImage == null)
+ {
+ return null;
+ }
+
+ SequenceGroup group = av.getSelectionGroup();
+ if (group == null)