Source Code Cross Referenced for GraphicsNodeInputEvent.java in  » Graphic-Library » batik » org » apache » batik » gvt » event » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Graphic Library » batik » org.apache.batik.gvt.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Licensed to the Apache Software Foundation (ASF) under one or more
004:           contributor license agreements.  See the NOTICE file distributed with
005:           this work for additional information regarding copyright ownership.
006:           The ASF licenses this file to You under the Apache License, Version 2.0
007:           (the "License"); you may not use this file except in compliance with
008:           the License.  You may obtain a copy of the License at
009:
010:               http://www.apache.org/licenses/LICENSE-2.0
011:
012:           Unless required by applicable law or agreed to in writing, software
013:           distributed under the License is distributed on an "AS IS" BASIS,
014:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:           See the License for the specific language governing permissions and
016:           limitations under the License.
017:
018:         */
019:        package org.apache.batik.gvt.event;
020:
021:        import java.awt.event.InputEvent;
022:
023:        import org.apache.batik.gvt.GraphicsNode;
024:
025:        /**
026:         * The root event class for all graphics node-level input events.
027:         *
028:         * @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
029:         * @version $Id: GraphicsNodeInputEvent.java 498514 2007-01-22 03:03:41Z cam $
030:         */
031:        public abstract class GraphicsNodeInputEvent extends GraphicsNodeEvent {
032:
033:            /**
034:             * The shift key modifier constant.
035:             */
036:            public static final int SHIFT_MASK = InputEvent.SHIFT_MASK;
037:
038:            /**
039:             * The control key modifier constant.
040:             */
041:            public static final int CTRL_MASK = InputEvent.CTRL_MASK;
042:
043:            /**
044:             * The meta key modifier constant.
045:             */
046:            public static final int META_MASK = InputEvent.META_MASK;
047:
048:            /**
049:             * The alt key modifier constant.
050:             */
051:            public static final int ALT_MASK = InputEvent.ALT_MASK;
052:
053:            /**
054:             * The alt-graph key modifier constant.
055:             */
056:            public static final int ALT_GRAPH_MASK = InputEvent.ALT_GRAPH_MASK;
057:
058:            /**
059:             * The mouse button1 modifier constant.
060:             */
061:            public static final int BUTTON1_MASK = InputEvent.BUTTON1_MASK;
062:
063:            /**
064:             * The mouse button2 modifier constant.
065:             */
066:            public static final int BUTTON2_MASK = InputEvent.ALT_MASK;
067:
068:            /**
069:             * The mouse button3 modifier constant.
070:             */
071:            public static final int BUTTON3_MASK = InputEvent.META_MASK;
072:
073:            /**
074:             * The caps lock constant.
075:             */
076:            public static final int CAPS_LOCK_MASK = 0x01;
077:
078:            /**
079:             * The num lock constant.
080:             */
081:            public static final int NUM_LOCK_MASK = 0x02;
082:
083:            /**
084:             * The scroll lock constant.
085:             */
086:            public static final int SCROLL_LOCK_MASK = 0x04;
087:
088:            /**
089:             * The kana lock constant.
090:             */
091:            public static final int KANA_LOCK_MASK = 0x08;
092:
093:            /**
094:             * The graphics node input events Time stamp. The time stamp is in
095:             * UTC format that indicates when the input event was
096:             * created.
097:             */
098:            long when;
099:
100:            /**
101:             * The state of the modifier key at the time the graphics node
102:             * input event was fired.
103:             */
104:            int modifiers;
105:
106:            /**
107:             * The state of the key locks at the time the graphics node input
108:             * event was fired.
109:             */
110:            int lockState;
111:
112:            /**
113:             * Constructs a new graphics node input event.
114:             * @param source the graphics node where the event originated
115:             * @param id the id of this event
116:             * @param when the time the event occurred
117:             * @param modifiers the modifier keys down while event occurred
118:             */
119:            protected GraphicsNodeInputEvent(GraphicsNode source, int id,
120:                    long when, int modifiers, int lockState) {
121:                super (source, id);
122:                this .when = when;
123:                this .modifiers = modifiers;
124:                this .lockState = lockState;
125:            }
126:
127:            /**
128:             * Constructs a new graphics node input event from an AWT InputEvent.
129:             * @param source the graphics node where the event originated
130:             * @param evt the AWT InputEvent triggering this event's creation
131:             */
132:            protected GraphicsNodeInputEvent(GraphicsNode source,
133:                    InputEvent evt, int lockState) {
134:                super (source, evt.getID());
135:                this .when = evt.getWhen();
136:                this .modifiers = evt.getModifiers();
137:                this .lockState = lockState;
138:            }
139:
140:            /**
141:             * Returns whether or not the Shift modifier is down on this event.
142:             */
143:            public boolean isShiftDown() {
144:                return (modifiers & SHIFT_MASK) != 0;
145:            }
146:
147:            /**
148:             * Returns whether or not the Control modifier is down on this event.
149:             */
150:            public boolean isControlDown() {
151:                return (modifiers & CTRL_MASK) != 0;
152:            }
153:
154:            /**
155:             * Returns whether or not the Meta modifier is down on this event.
156:             */
157:            public boolean isMetaDown() {
158:                return AWTEventDispatcher.isMetaDown(modifiers);
159:            }
160:
161:            /**
162:             * Returns whether or not the Alt modifier is down on this event.
163:             */
164:            public boolean isAltDown() {
165:                return (modifiers & ALT_MASK) != 0;
166:            }
167:
168:            /**
169:             * Returns whether or not the Alt-Graph modifier is down on this event.
170:             */
171:            public boolean isAltGraphDown() {
172:                return (modifiers & ALT_GRAPH_MASK) != 0;
173:            }
174:
175:            /**
176:             * Returns the timestamp of when this event occurred.
177:             */
178:            public long getWhen() {
179:                return when;
180:            }
181:
182:            /**
183:             * Returns the modifiers flag for this event.
184:             */
185:            public int getModifiers() {
186:                return modifiers;
187:            }
188:
189:            /**
190:             * Returns the lock state flags for this event.
191:             */
192:            public int getLockState() {
193:                return lockState;
194:            }
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.