1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package org.vectomatic.dom.svg;
31
32 import org.vectomatic.dom.svg.events.ActivateEvent;
33 import org.vectomatic.dom.svg.events.ActivateHandler;
34 import org.vectomatic.dom.svg.events.FocusInEvent;
35 import org.vectomatic.dom.svg.events.FocusInHandler;
36 import org.vectomatic.dom.svg.events.FocusOutEvent;
37 import org.vectomatic.dom.svg.events.FocusOutHandler;
38 import org.vectomatic.dom.svg.events.HasGraphicalHandlers;
39 import org.vectomatic.dom.svg.impl.SVGElement;
40 import org.vectomatic.dom.svg.impl.SVGImageElement;
41 import org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired;
42 import org.vectomatic.dom.svg.itf.ISVGGraphicsElement;
43 import org.vectomatic.dom.svg.itf.ISVGLangSpace;
44 import org.vectomatic.dom.svg.itf.ISVGStylable;
45 import org.vectomatic.dom.svg.itf.ISVGTests;
46 import org.vectomatic.dom.svg.itf.ISVGTransformable;
47 import org.vectomatic.dom.svg.itf.ISVGURIReference;
48 import org.vectomatic.dom.svg.utils.DOMHelper;
49 import org.vectomatic.dom.svg.utils.SVGConstants;
50
51 import com.google.gwt.core.client.JavaScriptException;
52 import com.google.gwt.dom.client.TagName;
53 import com.google.gwt.event.dom.client.ClickEvent;
54 import com.google.gwt.event.dom.client.ClickHandler;
55 import com.google.gwt.event.dom.client.DragEndEvent;
56 import com.google.gwt.event.dom.client.DragEndHandler;
57 import com.google.gwt.event.dom.client.DragEnterEvent;
58 import com.google.gwt.event.dom.client.DragEnterHandler;
59 import com.google.gwt.event.dom.client.DragEvent;
60 import com.google.gwt.event.dom.client.DragHandler;
61 import com.google.gwt.event.dom.client.DragLeaveEvent;
62 import com.google.gwt.event.dom.client.DragLeaveHandler;
63 import com.google.gwt.event.dom.client.DragOverEvent;
64 import com.google.gwt.event.dom.client.DragOverHandler;
65 import com.google.gwt.event.dom.client.DragStartEvent;
66 import com.google.gwt.event.dom.client.DragStartHandler;
67 import com.google.gwt.event.dom.client.DropEvent;
68 import com.google.gwt.event.dom.client.DropHandler;
69 import com.google.gwt.event.dom.client.LoadEvent;
70 import com.google.gwt.event.dom.client.LoadHandler;
71 import com.google.gwt.event.dom.client.MouseDownEvent;
72 import com.google.gwt.event.dom.client.MouseDownHandler;
73 import com.google.gwt.event.dom.client.MouseMoveEvent;
74 import com.google.gwt.event.dom.client.MouseMoveHandler;
75 import com.google.gwt.event.dom.client.MouseOutEvent;
76 import com.google.gwt.event.dom.client.MouseOutHandler;
77 import com.google.gwt.event.dom.client.MouseOverEvent;
78 import com.google.gwt.event.dom.client.MouseOverHandler;
79 import com.google.gwt.event.dom.client.MouseUpEvent;
80 import com.google.gwt.event.dom.client.MouseUpHandler;
81 import com.google.gwt.event.dom.client.TouchCancelEvent;
82 import com.google.gwt.event.dom.client.TouchCancelHandler;
83 import com.google.gwt.event.dom.client.TouchEndEvent;
84 import com.google.gwt.event.dom.client.TouchEndHandler;
85 import com.google.gwt.event.dom.client.TouchMoveEvent;
86 import com.google.gwt.event.dom.client.TouchMoveHandler;
87 import com.google.gwt.event.dom.client.TouchStartEvent;
88 import com.google.gwt.event.dom.client.TouchStartHandler;
89 import com.google.gwt.event.shared.HandlerRegistration;
90
91
92
93
94
95
96 @TagName("image")
97 public class OMSVGImageElement extends OMSVGElement implements HasGraphicalHandlers, ISVGURIReference, ISVGTests, ISVGLangSpace, ISVGExternalResourcesRequired, ISVGStylable, ISVGTransformable, ISVGGraphicsElement {
98 public OMSVGImageElement() {
99 this((SVGImageElement)DOMHelper.createElementNS(DOMHelper.getCurrentDocument(), SVGConstants.SVG_NAMESPACE_URI, SVGConstants.SVG_IMAGE_TAG).cast());
100 }
101
102 protected OMSVGImageElement(SVGImageElement ot) {
103 super(ot);
104 }
105
106
107
108
109
110
111
112 public final OMSVGAnimatedLength getX() {
113 return ((SVGImageElement)ot).getX();
114 }
115
116
117
118
119
120 public final OMSVGAnimatedLength getY() {
121 return ((SVGImageElement)ot).getY();
122 }
123
124
125
126
127
128 public final OMSVGAnimatedLength getWidth() {
129 return ((SVGImageElement)ot).getWidth();
130 }
131
132
133
134
135
136 public final OMSVGAnimatedLength getHeight() {
137 return ((SVGImageElement)ot).getHeight();
138 }
139
140
141
142
143
144 public final OMSVGAnimatedPreserveAspectRatio getPreserveAspectRatio() {
145 return ((SVGImageElement)ot).getPreserveAspectRatio();
146 }
147
148
149
150
151
152
153
154
155
156
157
158
159
160 public final OMSVGAnimatedBoolean getExternalResourcesRequired() {
161 return ((SVGImageElement)ot).getExternalResourcesRequired();
162 }
163
164
165
166
167
168 public final String getXmllang() {
169 return ((SVGImageElement)ot).getXmllang();
170 }
171
172
173
174
175
176
177 public final void setXmllang(java.lang.String value) throws JavaScriptException {
178 ((SVGImageElement)ot).setXmllang(value);
179 }
180
181
182
183 public final String getXmlspace() {
184 return ((SVGImageElement)ot).getXmlspace();
185 }
186
187
188
189
190
191
192 public final void setXmlspace(java.lang.String value) throws JavaScriptException {
193 ((SVGImageElement)ot).setXmlspace(value);
194 }
195
196
197
198
199
200
201
202
203
204 public final OMSVGElement getNearestViewportElement() {
205 SVGElement elt = ((SVGImageElement)ot).getNearestViewportElement();
206 return elt != null ? (OMSVGElement)convert(elt) : null;
207 }
208
209
210
211
212
213
214 public final OMSVGElement getFarthestViewportElement() {
215 SVGElement elt = ((SVGImageElement)ot).getFarthestViewportElement();
216 return elt != null ? (OMSVGElement)convert(elt) : null;
217 }
218
219
220
221
222
223
224
225
226
227
228 public final OMSVGRect getBBox() {
229 return ((SVGImageElement)ot).getBBox();
230 }
231
232
233
234
235
236
237
238 public final OMSVGMatrix getCTM() {
239 return ((SVGImageElement)ot).getCTM();
240 }
241
242
243
244
245
246
247
248
249
250
251
252
253
254 public final OMSVGMatrix getScreenCTM() {
255 return ((SVGImageElement)ot).getScreenCTM();
256 }
257
258
259
260
261
262
263
264
265
266
267
268
269 public final OMSVGMatrix getTransformToElement(OMSVGElement element) throws JavaScriptException {
270 return ((SVGImageElement)ot).getTransformToElement(((SVGElement)element.ot));
271 }
272
273
274
275
276
277
278 public final OMSVGStringList getRequiredFeatures() {
279 return ((SVGImageElement)ot).getRequiredFeatures();
280 }
281
282
283
284
285 public final OMSVGStringList getRequiredExtensions() {
286 return ((SVGImageElement)ot).getRequiredExtensions();
287 }
288
289
290
291
292 public final OMSVGStringList getSystemLanguage() {
293 return ((SVGImageElement)ot).getSystemLanguage();
294 }
295
296
297
298
299
300
301 public final boolean hasExtension(String extension) {
302 return ((SVGImageElement)ot).hasExtension(extension);
303 }
304
305
306
307
308
309
310 public final OMSVGAnimatedTransformList getTransform() {
311 return ((SVGImageElement)ot).getTransform();
312 }
313
314
315
316
317
318
319 public final OMSVGAnimatedString getHref() {
320 return ((SVGImageElement)ot).getHref();
321 }
322
323 @Override
324 public final HandlerRegistration addClickHandler(ClickHandler handler) {
325 return addDomHandler(handler, ClickEvent.getType());
326 }
327 @Override
328 public final HandlerRegistration addDragEndHandler(DragEndHandler handler) {
329 return addDomHandler(handler, DragEndEvent.getType());
330 }
331 @Override
332 public final HandlerRegistration addDragEnterHandler(DragEnterHandler handler) {
333 return addDomHandler(handler, DragEnterEvent.getType());
334 }
335 @Override
336 public final HandlerRegistration addDragHandler(DragHandler handler) {
337 return addDomHandler(handler, DragEvent.getType());
338 }
339 @Override
340 public final HandlerRegistration addDragLeaveHandler(DragLeaveHandler handler) {
341 return addDomHandler(handler, DragLeaveEvent.getType());
342 }
343 @Override
344 public final HandlerRegistration addDragOverHandler(DragOverHandler handler) {
345 return addDomHandler(handler, DragOverEvent.getType());
346 }
347 @Override
348 public final HandlerRegistration addDragStartHandler(DragStartHandler handler) {
349 return addDomHandler(handler, DragStartEvent.getType());
350 }
351 @Override
352 public final HandlerRegistration addDropHandler(DropHandler handler) {
353 return addDomHandler(handler, DropEvent.getType());
354 }
355 @Override
356 public final HandlerRegistration addLoadHandler(LoadHandler handler) {
357 return addDomHandler(handler, LoadEvent.getType());
358 }
359 @Override
360 public final HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
361 return addDomHandler(handler, MouseDownEvent.getType());
362 }
363 @Override
364 public final HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
365 return addDomHandler(handler, MouseMoveEvent.getType());
366 }
367 @Override
368 public final HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
369 return addDomHandler(handler, MouseOutEvent.getType());
370 }
371 @Override
372 public final HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
373 return addDomHandler(handler, MouseOverEvent.getType());
374 }
375 @Override
376 public final HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
377 return addDomHandler(handler, MouseUpEvent.getType());
378 }
379 @Override
380 public final HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
381 return addDomHandler(handler, TouchCancelEvent.getType());
382 }
383 @Override
384 public final HandlerRegistration addTouchEndHandler(TouchEndHandler handler) {
385 return addDomHandler(handler, TouchEndEvent.getType());
386 }
387 @Override
388 public final HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
389 return addDomHandler(handler, TouchMoveEvent.getType());
390 }
391 @Override
392 public final HandlerRegistration addTouchStartHandler(TouchStartHandler handler) {
393 return addDomHandler(handler, TouchStartEvent.getType());
394 }
395 @Override
396 public final HandlerRegistration addActivateHandler(ActivateHandler handler) {
397 return addDomHandler(handler, ActivateEvent.getType());
398 }
399 @Override
400 public final HandlerRegistration addFocusInHandler(FocusInHandler handler) {
401 return addDomHandler(handler, FocusInEvent.getType());
402 }
403 @Override
404 public final HandlerRegistration addFocusOutHandler(FocusOutHandler handler) {
405 return addDomHandler(handler, FocusOutEvent.getType());
406 }
407
408
409
410
411
412
413
414
415
416 public OMSVGImageElement(float x, float y, float width, float height, String href) {
417 this();
418 getX().getBaseVal().setValue(x);
419 getY().getBaseVal().setValue(y);
420 getWidth().getBaseVal().setValue(width);
421 getHeight().getBaseVal().setValue(height);
422 getHref().setBaseVal(href);
423 }
424 }