001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.xerces.dom.events;
019:
020: import org.w3c.dom.events.EventTarget;
021: import org.w3c.dom.events.MouseEvent;
022: import org.w3c.dom.views.AbstractView;
023:
024: /**
025: * An implementation of the DOM Level 2 <code>MouseEvent</code> interface.
026: *
027: * @xerces.internal
028: *
029: * @version $Id: MouseEventImpl.java 533574 2007-04-30 00:29:47Z mrglavas $
030: */
031: public class MouseEventImpl extends UIEventImpl implements MouseEvent {
032:
033: private int fScreenX;
034: private int fScreenY;
035: private int fClientX;
036: private int fClientY;
037: private boolean fCtrlKey;
038: private boolean fAltKey;
039: private boolean fShiftKey;
040: private boolean fMetaKey;
041: private short fButton;
042: private EventTarget fRelatedTarget;
043:
044: public int getScreenX() {
045: return fScreenX;
046: }
047:
048: public int getScreenY() {
049: return fScreenY;
050: }
051:
052: public int getClientX() {
053: return fClientX;
054: }
055:
056: public int getClientY() {
057: return fClientY;
058: }
059:
060: public boolean getCtrlKey() {
061: return fCtrlKey;
062: }
063:
064: public boolean getAltKey() {
065: return fAltKey;
066: }
067:
068: public boolean getShiftKey() {
069: return fShiftKey;
070: }
071:
072: public boolean getMetaKey() {
073: return fMetaKey;
074: }
075:
076: public short getButton() {
077: return fButton;
078: }
079:
080: public EventTarget getRelatedTarget() {
081: return fRelatedTarget;
082: }
083:
084: public void initMouseEvent(String typeArg, boolean canBubbleArg,
085: boolean cancelableArg, AbstractView viewArg, int detailArg,
086: int screenXArg, int screenYArg, int clientXArg,
087: int clientYArg, boolean ctrlKeyArg, boolean altKeyArg,
088: boolean shiftKeyArg, boolean metaKeyArg, short buttonArg,
089: EventTarget relatedTargetArg) {
090: fScreenX = screenXArg;
091: fScreenY = screenYArg;
092: fClientX = clientXArg;
093: fClientY = clientYArg;
094: fCtrlKey = ctrlKeyArg;
095: fAltKey = altKeyArg;
096: fShiftKey = shiftKeyArg;
097: fMetaKey = metaKeyArg;
098: fButton = buttonArg;
099: fRelatedTarget = relatedTargetArg;
100: super.initUIEvent(typeArg, canBubbleArg, cancelableArg,
101: viewArg, detailArg);
102: }
103: }
|