KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > event > SInternalFrameEvent


1 /*
2  * $Id: SInternalFrameEvent.java,v 1.3 2004/12/01 07:54:07 hengels Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.event;
15
16 import org.wings.SInternalFrame;
17
18 import java.awt.*;
19
20 /**
21  * SInternalFrameEvent: an AWTEvent which adds support for
22  * SInternalFrame objects as the event source.
23  *
24  * @author Holger Engels
25  * @version $Revision: 1.3 $
26  */

27 public class SInternalFrameEvent extends AWTEvent {
28     /**
29      * The first number in the range of ids used for window events.
30      */

31     public static final int INTERNAL_FRAME_FIRST = 12000;
32
33     /**
34      * The window opened event. This event is delivered only
35      * the first time a window is made visible.
36      */

37     public static final int INTERNAL_FRAME_OPENED = INTERNAL_FRAME_FIRST;
38
39     /**
40      * The window closed event. This event is delivered after
41      * the window has been closed as the result of a call to hide or
42      * destroy.
43      */

44     public static final int INTERNAL_FRAME_CLOSED = 1 + INTERNAL_FRAME_FIRST;
45
46     /**
47      * The window iconified event. This event indicates that the window
48      * was shrunk down to a small icon.
49      */

50     public static final int INTERNAL_FRAME_ICONIFIED = 2 + INTERNAL_FRAME_FIRST;
51
52     /**
53      * The window deiconified event type. This event indicates that the
54      * window has been restored to its normal size.
55      */

56     public static final int INTERNAL_FRAME_DEICONIFIED = 3 + INTERNAL_FRAME_FIRST;
57
58     /**
59      * The window maximized event type. This event indicates that keystrokes
60      * and mouse clicks are directed towards this window.
61      */

62     public static final int INTERNAL_FRAME_MAXIMIZED = 4 + INTERNAL_FRAME_FIRST;
63
64     /**
65      * The window unmaximized event type. This event indicates that keystrokes
66      * and mouse clicks are no longer directed to the window.
67      */

68     public static final int INTERNAL_FRAME_UNMAXIMIZED = 5 + INTERNAL_FRAME_FIRST;
69
70     /**
71      * The last number in the range of ids used for window events.
72      */

73     public static final int INTERNAL_FRAME_LAST = INTERNAL_FRAME_UNMAXIMIZED;
74
75     /**
76      * Constructs a SInternalFrameEvent object.
77      *
78      * @param source the SInternalFrame object that originated the event
79      * @param id an integer indicating the type of event
80      */

81     public SInternalFrameEvent(SInternalFrame source, int id) {
82         super(source, id);
83     }
84
85     /**
86      * Returns a parameter string identifying this event.
87      * This method is useful for event-logging and for debugging.
88      *
89      * @return a string identifying the event and its attributes
90      */

91     public String JavaDoc paramString() {
92         String JavaDoc typeStr;
93         switch (id) {
94             case INTERNAL_FRAME_OPENED:
95                 typeStr = "INTERNAL_FRAME_OPENED";
96                 break;
97             case INTERNAL_FRAME_CLOSED:
98                 typeStr = "INTERNAL_FRAME_CLOSED";
99                 break;
100             case INTERNAL_FRAME_ICONIFIED:
101                 typeStr = "INTERNAL_FRAME_ICONIFIED";
102                 break;
103             case INTERNAL_FRAME_DEICONIFIED:
104                 typeStr = "INTERNAL_FRAME_DEICONIFIED";
105                 break;
106             case INTERNAL_FRAME_MAXIMIZED:
107                 typeStr = "INTERNAL_FRAME_MAXIMIZED";
108                 break;
109             case INTERNAL_FRAME_UNMAXIMIZED:
110                 typeStr = "INTERNAL_FRAME_UNMAXIMIZED";
111                 break;
112             default:
113                 typeStr = "unknown type";
114         }
115         return typeStr;
116     }
117
118
119     /**
120      * Returns the originator of the event.
121      *
122      * @return the SInternalFrame object that originated the event
123      * @since 1.3
124      */

125     public SInternalFrame getInternalFrame() {
126         return (source instanceof SInternalFrame) ? (SInternalFrame) source : null;
127     }
128
129 }
130
131
132
Popular Tags