KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > gvt > event > GraphicsNodeEvent


1 /*
2
3    Copyright 2000-2001,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.gvt.event;
19
20 import java.util.EventObject JavaDoc;
21
22 import org.apache.batik.gvt.GraphicsNode;
23
24 /**
25  * A low-level event for GraphicsNode.
26  *
27  * @author <a HREF="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
28  * @version $Id: GraphicsNodeEvent.java,v 1.6 2004/08/18 07:14:30 vhardy Exp $
29  */

30 public class GraphicsNodeEvent extends EventObject JavaDoc {
31
32     /** Indicates whether or not this event is consumed. */
33     private boolean consumed = false;
34
35     /** The ID of this event. */
36     protected int id;
37
38     /**
39      * Constructs a new graphics node event with the specified source and ID.
40      * @param source the graphics node where the event originated
41      * @param id the id of this event
42      */

43     public GraphicsNodeEvent(GraphicsNode source, int id) {
44         super(source);
45         this.id = id;
46     }
47
48     /**
49      * Returns the ID of this event.
50      */

51     public int getID() {
52         return id;
53     }
54
55     /**
56      * Returns the graphics node where the event is originated.
57      */

58     public GraphicsNode getGraphicsNode() {
59         return (GraphicsNode) source;
60     }
61
62     /**
63      * Consumes this event so that it will not be processed
64      * in the default manner by the source which originated it.
65      */

66     public void consume() {
67         consumed = true;
68     }
69
70     /**
71      * Returns whether or not this event has been consumed.
72      */

73     public boolean isConsumed() {
74         return consumed;
75     }
76 }
77
Popular Tags