resizing = false;
- setBoxPosition();
-
if (resizeAgain)
{
resizeAgain = false;
updateOverviewImage();
}
+ else
+ {
+ lastMiniMe = miniMe;
+ }
+
+ setBoxPosition();
}
/**
repaint();
}
+ private BufferedImage lastMiniMe = null;
/**
* DOCUMENT ME!
*
@Override
public void paintComponent(Graphics g)
{
- if (resizing)
+ if (resizing || resizeAgain)
{
- g.setColor(Color.white);
+ if (lastMiniMe == null)
+ {
+ g.setColor(Color.white);
+ g.fillRect(0, 0, getWidth(), getHeight());
+ }
+ else
+ {
+ g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
+ }
+ g.setColor(new Color(100, 100, 100, 25));
g.fillRect(0, 0, getWidth(), getHeight());
}
- else if (miniMe != null)
+ else if (lastMiniMe != null)
{
- g.drawImage(miniMe, 0, 0, this);
+ g.drawImage(lastMiniMe, 0, 0, this);
+ if (lastMiniMe != miniMe)
+ {
+ g.setColor(new Color(100, 100, 100, 25));
+ g.fillRect(0, 0, getWidth(), getHeight());
+ }
}
-
+ // TODO: render selected regions
g.setColor(Color.red);
g.drawRect(boxX, boxY, boxWidth, boxHeight);
g.drawRect(boxX + 1, boxY + 1, boxWidth - 2, boxHeight - 2);
-
}
}