KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > buchuki > ensmer > input > event > EnsmerInputEvent


1 /*
2  * Copyright 2004 Dusty Phillips
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.buchuki.ensmer.input.event;
17
18 import java.awt.event.InputEvent JavaDoc;
19
20 /**
21  * Abstract class for EnsmerInputEvents. Implementing classes will be specific
22  * events that have occured or can occur. Information for distinguishing
23  * events (such as which mouse button was pressed, but not the location of the
24  * click) for a command map should be available to EnsmerInputEvent so they
25  * can be compared based on a equals() comparison. This allows an actual event
26  * to be compared to a possible event to determine if it has occured.
27  *
28  * See the other classes in the com.buchuki.ensmer.input.event package for
29  * more information.
30  *
31  * @author Dusty Phillips [dusty@buchuki.com]
32  */

33 public abstract class EnsmerInputEvent {
34
35     /**
36      * Create an EnsmerInputEvent with no actual InputEvent. This reflects an
37      * event that can occur and might be compared to actual events to see if
38      * they match.
39      */

40     public EnsmerInputEvent() {
41     }
42
43     /**
44      * Create an EnsmerInputEvent with a reference to the InputEvent that
45      * occured. This reflects an event that has occured, and might be compared
46      * to comparison events to see if they match.
47      *
48      * @param event the InputEvent that occured
49      */

50     public EnsmerInputEvent(InputEvent JavaDoc event) {
51         this.event = event;
52     }
53
54     /**
55      * Get a reference to the InputEvent that occured
56      *
57      * @return the InputEvent that occured, or null if no actual event is
58      * represented
59      */

60     public InputEvent JavaDoc getInputEvent() {
61         return event;
62     }
63
64     /**
65      * The InputEvent that occured, or null if this doesn't represent an
66      * actual event.
67      */

68     private InputEvent JavaDoc event;
69
70 }
71
Popular Tags