{
updaterunning = false;
lastMiniMe = miniMe;
+ alpha = 1f;
timer.start();
}
}
&& ((getWidth() != od.getWidth())
|| (getHeight() != od.getHeight())))
{
- resize = true;
-
// scale the alignment and annotation separately *** if there is
// annotation ***
if (od.getGraphHeight() > 0)
}
else
{
-
- if (lastMiniMe != miniMe && !resize)
- {
- g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
- g.setColor(TRANS_GREY);
- g.fillRect(0, 0, getWidth(), getHeight());
- }
- else if (veryLastMiniMe != null)
+ if (alpha != 0) // this is a timer triggered dissolve
{
Graphics2D g2d = (Graphics2D) g.create();
- g2d.setComposite(AlphaComposite.SrcOver.derive(alpha));
+ // draw the original image
g2d.drawImage(veryLastMiniMe, 0, 0, getWidth(), getHeight(),
this);
+ // draw the new image on top with varying degrees of transparency
g2d.setComposite(AlphaComposite.SrcOver.derive(1f - alpha));
g2d.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
g2d.dispose();
}
+ else if (lastMiniMe != miniMe)
+ {
+ g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
+ g.setColor(TRANS_GREY);
+ g.fillRect(0, 0, getWidth(), getHeight());
+ }
else
{
- // fall back if everything goes wrong somehow
+ // fall back to normal behaviour
g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
}
- resize = false;
+
}
}