KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > dom > events > DOMUIEvent


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

18 package org.apache.batik.dom.events;
19
20 import org.w3c.dom.events.UIEvent JavaDoc;
21 import org.w3c.dom.views.AbstractView;
22
23 /**
24  * The UIEvent class provides specific contextual information
25  * associated with User Interface events.
26  *
27  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
28  */

29 public class DOMUIEvent extends AbstractEvent implements UIEvent JavaDoc {
30
31     private AbstractView view;
32     private int detail;
33
34     /**
35      * DOM: The <code>view</code> attribute identifies the
36      * <code>AbstractView</code> from which the event was generated.
37      */

38     public AbstractView getView() {
39     return view;
40     }
41
42     /**
43      * DOM: Specifies some detail information about the
44      * <code>Event</code>, depending on the type of event.
45      */

46     public int getDetail() {
47     return detail;
48     }
49
50     /**
51      * DOM: The <code>initUIEvent</code> method is used to initialize
52      * the value of a <code>UIEvent</code> created through the
53      * <code>DocumentEvent</code> interface. This method may only be
54      * called before the <code>UIEvent</code> has been dispatched via
55      * the <code>dispatchEvent</code> method, though it may be called
56      * multiple times during that phase if necessary. If called
57      * multiple times, the final invocation takes precedence.
58      *
59      * @param typeArg Specifies the event type.
60      * @param canBubbleArg Specifies whether or not the event can bubble.
61      * @param cancelableArg Specifies whether or not the event's default
62      * action can be prevented.
63      * @param viewArg Specifies the <code>Event</code>'s
64      * <code>AbstractView</code>.
65      * @param detailArg Specifies the <code>Event</code>'s detail.
66      */

67     public void initUIEvent(String JavaDoc typeArg,
68                 boolean canBubbleArg,
69                 boolean cancelableArg,
70                 AbstractView viewArg,
71                 int detailArg) {
72     initEvent(typeArg, canBubbleArg, cancelableArg);
73     this.view = viewArg;
74     this.detail = detailArg;
75     }
76 }
77
Popular Tags