01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.impl.core.event.client2serv.dom.w3c;
15:
16: import org.itsnat.core.ItsNatException;
17: import org.itsnat.impl.core.ItsNatServletRequestImpl;
18: import org.itsnat.impl.core.listener.dom.DOMEventListenerWrapperImpl;
19: import org.itsnat.impl.core.event.client2serv.dom.NodeContainer;
20: import org.w3c.dom.events.EventTarget;
21: import org.w3c.dom.events.MouseEvent;
22: import org.w3c.dom.views.AbstractView;
23:
24: /**
25: *
26: * @author jmarranz
27: */
28: public class W3CMouseEventImpl extends W3CUIEventImpl implements
29: MouseEvent {
30: protected NodeContainer relatedTarget;
31:
32: /**
33: * Creates a new instance of W3CMouseEventImpl
34: */
35: public W3CMouseEventImpl(
36: DOMEventListenerWrapperImpl listenerWrapper,
37: ItsNatServletRequestImpl request) {
38: super (listenerWrapper, request);
39: }
40:
41: public void initMouseEvent(String typeArg, boolean canBubbleArg,
42: boolean cancelableArg, AbstractView viewArg, int detailArg,
43: int screenXArg, int screenYArg, int clientXArg,
44: int clientYArg, boolean ctrlKeyArg, boolean altKeyArg,
45: boolean shiftKeyArg, boolean metaKeyArg, short buttonArg,
46: EventTarget relatedTargetArg) {
47: throw new ItsNatException("Not implemented");
48: }
49:
50: public int getScreenX() {
51: return getDOMEventParamInt("screenX");
52: }
53:
54: public int getScreenY() {
55: return getDOMEventParamInt("screenY");
56: }
57:
58: public int getClientX() {
59: return getDOMEventParamInt("clientX");
60: }
61:
62: public int getClientY() {
63: return getDOMEventParamInt("clientY");
64: }
65:
66: public boolean getCtrlKey() {
67: return getDOMEventParamBoolean("ctrlKey");
68: }
69:
70: public boolean getShiftKey() {
71: return getDOMEventParamBoolean("shiftKey");
72: }
73:
74: public boolean getAltKey() {
75: return getDOMEventParamBoolean("altKey");
76: }
77:
78: public boolean getMetaKey() {
79: return getDOMEventParamBoolean("metaKey");
80: }
81:
82: public short getButton() {
83: return getDOMEventParamShort("button");
84: }
85:
86: public EventTarget getRelatedTarget() {
87: if (relatedTarget == null)
88: this .relatedTarget = new NodeContainer(
89: getDOMEventParamNode("relatedTarget"));
90: return (EventTarget) relatedTarget.get();
91: }
92:
93: }
|