}
else if (lastMiniMe != null)
{
- g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
- /* if (lastMiniMe != miniMe)
+ if ((getWidth() > 0) && (getHeight() > 0)
+ && ((getWidth() != od.getWidth())
+ || (getHeight() != od.getHeight())))
{
- g.setColor(TRANS_GREY);
- g.fillRect(0, 0, getWidth(), getHeight());
- }*/
+ // scale the alignment and annotation separately *** if there is
+ // annotation ***
+ if (od.getGraphHeight() > 0)
+ {
+ BufferedImage topImage = lastMiniMe.getSubimage(0, 0,
+ od.getWidth(), od.getSequencesHeight());
+ BufferedImage bottomImage = lastMiniMe.getSubimage(0,
+ od.getSequencesHeight(), od.getWidth(),
+ od.getGraphHeight());
+
+ od.setWidth(getWidth());
+ od.setHeight(getHeight());
+
+ // stick the images back together so lastMiniMe is consistent in the
+ // event
+ // of a repaint
+ lastMiniMe = new BufferedImage(od.getWidth(), od.getHeight(),
+ BufferedImage.TYPE_INT_RGB);
+ Graphics lg = lastMiniMe.getGraphics();
+ lg.drawImage(topImage, 0, 0, od.getWidth(),
+ od.getSequencesHeight(), null);
+ lg.drawImage(bottomImage, 0, od.getSequencesHeight(),
+ od.getWidth(), od.getGraphHeight(), this);
+ lg.dispose();
+ }
+
+ g.drawImage(lastMiniMe, 0, 0, od.getWidth(), od.getHeight(), null);
+ }
+ else
+ {
+ g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
+ if (lastMiniMe != miniMe)
+ {
+ g.setColor(TRANS_GREY);
+ g.fillRect(0, 0, getWidth(), getHeight());
+ }
+ }
+
}
g.setColor(Color.red);
+
+
+ od.setBoxPosition(av.getAlignment().getHiddenSequences(),
+ av.getAlignment().getHiddenColumns());
+
od.drawBox(g);
}
}