1 /*
   2  * To change this template, choose Tools | Templates
   3  * and open the template in the editor.
   4  */
   5 
   6 package org.jemmy.browser;
   7 
   8 import java.awt.Color;
   9 import java.awt.Graphics;
  10 import javax.swing.JLabel;
  11 import org.jemmy.Rectangle;
  12 
  13 /**
  14  *
  15  * @author shura
  16  */
  17 public class ImageLabel extends JLabel {
  18 
  19     private org.jemmy.Rectangle bounds = new org.jemmy.Rectangle(100, 100, 100, 100);
  20 
  21     public ImageLabel() {
  22         super();
  23     }
  24 
  25     public void setBounds(Rectangle bounds) {
  26         this.bounds = bounds;
  27         repaint();
  28     }
  29 
  30     @Override
  31     public void paint(Graphics grphcs) {
  32         super.paint(grphcs);
  33         grphcs.setColor(Color.red);
  34         if(bounds != null) {
  35             grphcs.drawRect(bounds.x - 1, bounds.y - 1, bounds.width + 2, bounds.height + 2);
  36         }
  37     }
  38 
  39 }