KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > awt > event > ComponentEvent


1 /*
2    SwingWT
3    Copyright(c)2003-2004, Tomer Bartletz
4  
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7  
8    Contact me by electronic mail: tomerb@users.sourceforge.net
9
10    $Log: ComponentEvent.java,v $
11    Revision 1.3 2004/04/16 10:19:06 dannaab
12    Misc bug fixes, InputMap implementation, preliminary undo support
13
14    Revision 1.2 2003/12/22 08:48:17 bobintetley
15    Fixed up DnD to build temporarily
16
17
18  */

19 package swingwt.awt.event;
20
21 import swingwt.awt.AWTEvent;
22 import swingwt.awt.Component;
23
24 /**
25  * An event that indicates a component movement/resizing/visibility etc.
26  *
27  * @author Tomer Barletz, tomerb@users.sourceforge.net
28  * @version 0.1
29  */

30 public class ComponentEvent extends AWTEvent {
31     public static final int COMPONENT_FIRST=100;
32     public static final int COMPONENT_LAST=103;
33     public static final int COMPONENT_MOVED=COMPONENT_FIRST;
34     public static final int COMPONENT_RESIZED=1+COMPONENT_FIRST;
35     public static final int COMPONENT_SHOWN=2+COMPONENT_FIRST;
36     public static final int COMPONENT_HIDDEN=3+COMPONENT_FIRST;
37
38     public ComponentEvent(Component source) {
39         super(source);
40     }
41
42     /**
43      *
44      * @param the component that originated the event
45      * @param id an integer indicating the type of event
46      */

47     public ComponentEvent(Component source, int id) {
48         super(source, id);
49     }
50
51     /**
52      *
53      * @return the Component that originated the event
54      */

55     public Component getComponent() {
56         return (source instanceof Component) ? (Component)source : null;
57     }
58
59 }
60
Popular Tags