@Override
  public void paint(Graphics g) {
    super.paint(g);

    if (zoomBoxStartX != -1 && zoomBoxStartY != -1 && zoomBoxWidth != -1 && zoomBoxHeight != -1) {
      Graphics2D g2 = (Graphics2D) g.create();

      Composite old = g2.getComposite();
      g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
      g2.setColor(Color.BLUE);

      // g2.drawRect(zoomBoxStartX, zoomBoxStartY, zoomBoxWidth, zoomBoxHeight);
      // g2.setBackground(Color.BLUE);
      g2.fillRect(getBoxX(), getBoxY(), getBoxWidth(), getBoxHeight());
      g2.setComposite(old);
    }
  }
Created by IntelliJ IDEA. User: dan Date: Oct 28, 2010 Time: 10:30:40 PM To change this template
use File | Settings | File Templates.
geode-core/src/test/java/org/apache/geode/sequence/ZoomingPanel.java