1 7 8 package java.awt.event; 9 10 import java.awt.Component ; 11 import java.awt.Event ; 12 import java.awt.Rectangle ; 13 14 27 public class PaintEvent extends ComponentEvent { 28 29 32 public static final int PAINT_FIRST = 800; 33 34 37 public static final int PAINT_LAST = 801; 38 39 42 public static final int PAINT = PAINT_FIRST; 43 44 47 public static final int UPDATE = PAINT_FIRST + 1; 49 59 Rectangle updateRect; 60 61 64 private static final long serialVersionUID = 1267492026433337593L; 65 66 79 public PaintEvent(Component source, int id, Rectangle updateRect) { 80 super(source, id); 81 this.updateRect = updateRect; 82 } 83 84 88 public Rectangle getUpdateRect() { 89 return updateRect; 90 } 91 92 97 public void setUpdateRect(Rectangle updateRect) { 98 this.updateRect = updateRect; 99 } 100 101 public String paramString() { 102 String typeStr; 103 switch(id) { 104 case PAINT: 105 typeStr = "PAINT"; 106 break; 107 case UPDATE: 108 typeStr = "UPDATE"; 109 break; 110 default: 111 typeStr = "unknown type"; 112 } 113 return typeStr + ",updateRect="+(updateRect != null ? updateRect.toString() : "null"); 114 } 115 } 116 | Popular Tags |