1 18 package org.apache.batik.dom.events; 19 20 import org.w3c.dom.events.EventTarget ; 21 import org.w3c.dom.events.MouseEvent ; 22 import org.w3c.dom.views.AbstractView; 23 24 30 public class DOMMouseEvent extends DOMUIEvent implements MouseEvent { 31 32 private int screenX; 33 private int screenY; 34 private int clientX; 35 private int clientY; 36 private boolean ctrlKey; 37 private boolean altKey; 38 private boolean shiftKey; 39 private boolean metaKey; 40 private short button; 41 private EventTarget relatedTarget; 42 43 48 public int getScreenX() { 49 return screenX; 50 } 51 52 57 public int getScreenY() { 58 return screenY; 59 } 60 61 66 public int getClientX() { 67 return clientX; 68 } 69 70 75 public int getClientY() { 76 return clientY; 77 } 78 79 83 public boolean getCtrlKey() { 84 return ctrlKey; 85 } 86 87 91 public boolean getShiftKey() { 92 return shiftKey; 93 } 94 95 100 public boolean getAltKey() { 101 return altKey; 102 } 103 104 109 public boolean getMetaKey() { 110 return metaKey; 111 } 112 113 123 public short getButton() { 124 return button; 125 } 126 127 135 public EventTarget getRelatedTarget() { 136 return relatedTarget; 137 } 138 139 172 public void initMouseEvent(String typeArg, 173 boolean canBubbleArg, 174 boolean cancelableArg, 175 AbstractView viewArg, 176 int detailArg, 177 int screenXArg, 178 int screenYArg, 179 int clientXArg, 180 int clientYArg, 181 boolean ctrlKeyArg, 182 boolean altKeyArg, 183 boolean shiftKeyArg, 184 boolean metaKeyArg, 185 short buttonArg, 186 EventTarget relatedTargetArg) { 187 initUIEvent(typeArg, canBubbleArg, cancelableArg, 188 viewArg, detailArg); 189 this.screenX = screenXArg; 190 this.screenY = screenYArg; 191 this.clientX = clientXArg; 192 this.clientY = clientYArg; 193 this.ctrlKey = ctrlKeyArg; 194 this.altKey = altKeyArg; 195 this.shiftKey = shiftKeyArg; 196 this.metaKey = metaKeyArg; 197 this.button = buttonArg; 198 this.relatedTarget = relatedTargetArg; 199 } 200 } 201 | Popular Tags |