001 
002 /*
003  *  JScripter Standard 1.0 - To Script In Java
004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
005  *  
006  *  This program is free software: you can redistribute it and/or modify
007  *  it under the terms of the GNU Affero General Public License as published by
008  *  the Free Software Foundation, either version 3 of the License, or
009  *  (at your option) any later version.
010  *  
011  *  This program is distributed in the hope that it will be useful,
012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014  *  GNU Affero General Public License for more details.
015  *  
016  *  You should have received a copy of the GNU Affero General Public License
017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
018  */
019 
020 package js.user;
021 
022 import js.*;
023 import js.core.*;
024 
025 /**
026  * <p>An <b>opaque</b> class representing JavaScript client-side objects of the global 
027  * {@link JsClient#HTMLImageElement} class.</p>
028  * <p>This class represents an image embedded 
029  * in an HTML page, or a {@link JsHTMLElement} object created with the HTML 
030  * <tt>&lt;img&gt;</tt> tag.</p>
031  * <p>An input element of this class created with the HTML <tt>&lt;input&gt;</tt> tag 
032  * with {@link JsHTMLInputElement#type} of "image" is a form submit button that displays 
033  * an image, specified by the {@link JsHTMLInputElement#src} property, instead of displaying 
034  * a textual label. The {@link JsHTMLInputElement#value} property is unused. See the 
035  * {@link JsHTMLSubmitElement} for further details.</p> 
036  * <p>An object of this class created with the HTML <tt>&lt;img&gt;</tt> tag represents 
037  * an image embedded in an HTML document. The images that appear in a document are 
038  * collected in the {@link JsHTMLDocument#images} array. Images that have {@link JsHTMLImageElement#name} 
039  * attributes can also be accessed through named properties of the {@link JsHTMLDocument} 
040  * object.</p>
041  * <p>When you set the {@link JsHTMLImageElement#src} property of a {@link JsHTMLImageElement} 
042  * object, the browser loads and displays the image specified by the new value. This 
043  * allows visual effects such as image roll-overs and animations.</p>
044  * <p>You can create offscreen {@link JsHTMLImageElement} objects dynamically using the 
045  * constructor function of {@link JsWindow#Image}. Note that this constructor method 
046  * does not have an argument to specify the image to be loaded. As with images created 
047  * from HTML, you tell the browser to load an image by setting the <tt>src</tt> property 
048  * of any images you create explicitly. There is no way to display a {@link JsHTMLImageElement} 
049  * object created in this way. All you can do is force the {@link JsHTMLImageElement} 
050  * object to download an image by setting the {@link JsHTMLImageElement#src} property. 
051  * This is useful, however, because it loads an image into the browser's cache; if that 
052  * same image URL is used later with an actual <tt>&lt;img&gt;</tt> tag, it will display 
053  * quickly since it has already been loaded.</p>
054  *
055  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
056  *
057  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
058  * generated into the target codes. Re-compilers must exit with error on the operations of
059  * accessing that kind of class objects.
060  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
061  * and <tt>instanceof</tt> to it always <tt>true</tt>.
062  */
063 public class JsHTMLImageElement extends JsClient.HTMLImageElement.Prototype
064 {
065     /**
066      * <p>An <b>internal</b> class containing membership data for its enclosing
067      * opaque class.</p>
068      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
069      * class members.</p>
070      *
071      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
072      * 
073      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
074      */
075     protected static abstract class Members extends JsClient.HTMLImageElement.Prototype.Members
076     {
077         /**
078          * <p>An <b>internal</b> static field defining a member ID of the field name and
079          * used internally to define a member of the same name.</p>
080          * @since 1.0
081          * @see JsHTMLImageElement#name
082          * @see JsHTMLImageElement.Member#name
083          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
084          */
085         public final static Mid name     = id("name"    );
086         /**
087          * <p>An <b>internal</b> static field defining a member ID of the field name and
088          * used internally to define a member of the same name.</p>
089          * @since 1.0
090          * @see JsHTMLImageElement#src
091          * @see JsHTMLImageElement.Member#src
092          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
093          */
094         public final static Mid src      = id("src"     );
095         /**
096          * <p>An <b>internal</b> static field defining a member ID of the field name and
097          * used internally to define a member of the same name.</p>
098          * @since 1.0
099          * @see JsHTMLImageElement#align
100          * @see JsHTMLImageElement.Member#align
101          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
102          */
103         public final static Mid align    = id("align"   );
104         /**
105          * <p>An <b>internal</b> static field defining a member ID of the field name and
106          * used internally to define a member of the same name.</p>
107          * @since 1.0
108          * @see JsHTMLImageElement#alt
109          * @see JsHTMLImageElement.Member#alt
110          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
111          */
112         public final static Mid alt      = id("alt"     );
113         /**
114          * <p>An <b>internal</b> static field defining a member ID of the field name and
115          * used internally to define a member of the same name.</p>
116          * @since 1.0
117          * @see JsHTMLImageElement#border
118          * @see JsHTMLImageElement.Member#border
119          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
120          */
121         public final static Mid border   = id("border"  );
122         /**
123          * <p>An <b>internal</b> static field defining a member ID of the field name and
124          * used internally to define a member of the same name.</p>
125          * @since 1.0
126          * @see JsHTMLImageElement#height
127          * @see JsHTMLImageElement.Member#height
128          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
129          */
130         public final static Mid height   = id("height"  );
131         /**
132          * <p>An <b>internal</b> static field defining a member ID of the field name and
133          * used internally to define a member of the same name.</p>
134          * @since 1.0
135          * @see JsHTMLImageElement#hspace
136          * @see JsHTMLImageElement.Member#hspace
137          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
138          */
139         public final static Mid hspace   = id("hspace"  );
140         /**
141          * <p>An <b>internal</b> static field defining a member ID of the field name and
142          * used internally to define a member of the same name.</p>
143          * @since 1.0
144          * @see JsHTMLImageElement#isMap
145          * @see JsHTMLImageElement.Member#isMap
146          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
147          */
148         public final static Mid isMap    = id("isMap"   );
149         /**
150          * <p>An <b>internal</b> static field defining a member ID of the field name and
151          * used internally to define a member of the same name.</p>
152          * @since 1.0
153          * @see JsHTMLImageElement#longDesc
154          * @see JsHTMLImageElement.Member#longDesc
155          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
156          */
157         public final static Mid longDesc = id("longDesc");
158         /**
159          * <p>An <b>internal</b> static field defining a member ID of the field name and
160          * used internally to define a member of the same name.</p>
161          * @since 1.0
162          * @see JsHTMLImageElement#useMap
163          * @see JsHTMLImageElement.Member#useMap
164          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
165          */
166         public final static Mid useMap   = id("useMap"  );
167         /**
168          * <p>An <b>internal</b> static field defining a member ID of the field name and
169          * used internally to define a member of the same name.</p>
170          * @since 1.0
171          * @see JsHTMLImageElement#vspace
172          * @see JsHTMLImageElement.Member#vspace
173          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
174          */
175         public final static Mid vspace   = id("vspace"  );
176         /**
177          * <p>An <b>internal</b> static field defining a member ID of the field name and
178          * used internally to define a member of the same name.</p>
179          * @since 1.0
180          * @see JsHTMLImageElement#width
181          * @see JsHTMLImageElement.Member#width
182          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
183          */
184         public final static Mid width    = id("width"   );
185         /**
186          * <p>An <b>internal</b> static field defining a member ID of the field name and
187          * used internally to define a member of the same name.</p>
188          * @since 1.0
189          * @see JsHTMLImageElement#onabort
190          * @see JsHTMLImageElement.Member#onabort
191          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
192          */
193         public final static Mid onabort  = id("onabort" );
194         /**
195          * <p>An <b>internal</b> static field defining a member ID of the field name and
196          * used internally to define a member of the same name.</p>
197          * @since 1.0
198          * @see JsHTMLImageElement#onerror
199          * @see JsHTMLImageElement.Member#onerror
200          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
201          */
202         public final static Mid onerror  = id("onerror" );
203         /**
204          * <p>An <b>internal</b> static field defining a member ID of the field name and
205          * used internally to define a member of the same name.</p>
206          * @since 1.0
207          * @see JsHTMLImageElement#onload
208          * @see JsHTMLImageElement.Member#onload
209          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
210          */
211         public final static Mid onload   = id("onload"  );
212     }
213 
214     /**
215      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
216      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
217      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
218      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
219      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
220      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
221      * either circumstance, the field names must be exactly same as the member names, as 
222      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
223      * based on the field names.</p>
224      *
225      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
226      * 
227      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
228      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
229      * of class objects.
230      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
231      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
232      * <pre>q.m</pre>
233      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
234      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
235      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
236      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
237      * <pre>m</pre>
238      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
239      * error on the access to <b>opaque</b> fields declared by this class under any other 
240      * circumstances.
241      */
242     public static class Member extends JsClient.HTMLImageElement.Prototype.Member
243     {
244         /**
245          * <p>Internally constructs a member based on a qualifying member.</p>
246          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
247          * or <b>internal</b> classes or class members.</p>
248          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
249          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
250          * declared in the declaring class of this constructor itself or its subclasses. 
251          * Under this circumstance, the field names must be exactly same as the member 
252          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
253          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
254          * to their names appending to the name resolved from the specified qualifying 
255          * member with a dot in between.</p>
256          * @param q A qualifying member
257          * @param mid The ID of the member to construct
258          * @since 1.0
259          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
260          */
261         public Member(JsObject.Member q, Mid mid) {
262             super(q, mid);
263         }
264         /**
265          * <p>Internally constructs a member without a qualifying member.</p>
266          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
267          * or <b>internal</b> classes or class members.</p>
268          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
269          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
270          * declared in <b>opaque</b> types other than the declaring class of this constructor 
271          * itself and its subclasses. Under this circumstance, the field names must be
272          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
273          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
274          * @param mid The ID of the member to construct
275          * @since 1.0
276          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
277          */
278         public Member(Mid mid) {
279             super(mid);
280         }
281         @Override
282         /**
283          * <p>Evaluates the property, represented by the current member instance, of the
284          * argument object.</p>
285          * @param o The argument object
286          * @return The value of the current member based on the object argument.
287          * @since 1.0
288          * @javascript Re-compilers must convert the instance invocation of this method into
289          * the JavaScript expression: 
290          * <pre>o.m</pre>
291          * where <tt>m</tt> is the identifier name resolved from the current member
292          * instance of the invocation.
293          */
294         public JsHTMLImageElement with(ObjectLike o) {
295             return new JsHTMLImageElement(super.with(o));
296         }
297 
298         /**
299          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
300          * name of this field, qualified by the current member instance of the field, and 
301          * to access the property of the name on an object.</p>
302          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
303          * object refers to a string that names the current image for backwards compatibility. 
304          * Applications should use the {@link JsHTMLElement#id} attribute to identify 
305          * elements.</p> 
306          * @since 1.0
307          * @javascript Re-compilers must resolve the member of this instance field to the
308          * identifier of the field name appending to the identifier resolved from its 
309          * qualifying member with a dot in between.
310          */
311         public final Value.String.Member name     = new Value.String.Member(this, Members.name    );
312         /**
313          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
314          * name of this field, qualified by the current member instance of the field, and 
315          * to access the property of the name on an object.</p>
316          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
317          * object refers to a URL string designating the location of this image. When 
318          * you set this property to the URL of a new image, the browser loads and displays 
319          * that new image. This is useful for updating the graphical appearance of your 
320          * web pages in response to user actions and can also be used to perform simple 
321          * animation.</p> 
322          * @since 1.0
323          * @javascript Re-compilers must resolve the member of this instance field to the
324          * identifier of the field name appending to the identifier resolved from its 
325          * qualifying member with a dot in between.
326          */
327         public final Value.String.Member src      = new Value.String.Member(this, Members.src     );
328         /**
329          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
330          * name of this field, qualified by the current member instance of the field, and 
331          * to access the property of the name on an object.</p>
332          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
333          * object refers to a string specifying the horizontal alignment of the element 
334          * with respect to the surrounding context. Possible values are:
335          * <ul>
336          * <li><tt>"left"</tt>: text lines are rendered flush left.</li>
337          * <li><tt>"center"</tt>: text lines are centered.</li>
338          * <li><tt>"right"</tt>: text lines are rendered flush right.</li>
339          * <li><tt>"justify"</tt>: text lines are justified to both margins.</li>
340          * </ul>
341          * The default value of this attribute depends on the base text direction. 
342          * For left to right text, the default is "left", while for right to left text, 
343          * it is "right".</p>
344          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
345          * @since 1.0
346          * @javascript Re-compilers must resolve the member of this instance field to the
347          * identifier of the field name appending to the identifier resolved from its 
348          * qualifying member with a dot in between.
349          */
350         public final Value.String.Member align    = new Value.String.Member(this, Members.align   );
351         /**
352          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
353          * name of this field, qualified by the current member instance of the field, and 
354          * to access the property of the name on an object.</p>
355          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
356          * object refers to a string specifying an alternate text for web browsers not 
357          * rendering the normal content of this element.</p>
358          * @since 1.0
359          * @javascript Re-compilers must resolve the member of this instance field to the
360          * identifier of the field name appending to the identifier resolved from its 
361          * qualifying member with a dot in between.
362          */
363         public final Value.String.Member alt      = new Value.String.Member(this, Members.alt     );
364         /**
365          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
366          * name of this field, qualified by the current member instance of the field, and 
367          * to access the property of the name on an object.</p>
368          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
369          * object refers to a string specifying the border width of this element, in 
370          * pixels. The default value for this attribute depends on the web browser.</p>
371          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
372          * @since 1.0
373          * @javascript Re-compilers must resolve the member of this instance field to the
374          * identifier of the field name appending to the identifier resolved from its 
375          * qualifying member with a dot in between.
376          */
377         public final Value.String.Member border   = new Value.String.Member(this, Members.border  );
378         /**
379          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
380          * name of this field, qualified by the current member instance of the field, and 
381          * to access the property of the name on an object.</p>
382          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
383          * object refers to a number value specifying the height of the image. Note that 
384          * the type of this attribute was string in DOM Level 1 HTML.</p> 
385          * @since 1.0
386          * @javascript Re-compilers must resolve the member of this instance field to the
387          * identifier of the field name appending to the identifier resolved from its 
388          * qualifying member with a dot in between.
389          */
390         public final Value.Number.Member height   = new Value.Number.Member(this, Members.height  );
391         /**
392          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
393          * name of this field, qualified by the current member instance of the field, and 
394          * to access the property of the name on an object.</p>
395          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
396          * object refers to a number value specifying horizontal space to the left and 
397          * right of this image in pixels. Note that the type of this attribute was 
398          * string in DOM Level 1 HTML.</p> 
399          * @since 1.0
400          * @javascript Re-compilers must resolve the member of this instance field to the
401          * identifier of the field name appending to the identifier resolved from its 
402          * qualifying member with a dot in between.
403          */
404         public final Value.Number.Member hspace   = new Value.Number.Member(this, Members.hspace  );
405         /**
406          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
407          * name of this field, qualified by the current member instance of the field, and 
408          * to access the property of the name on an object.</p>
409          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
410          * object refers to a string designating a long description of this image. The 
411          * description should supplement the short description provided by the {@link JsHTMLElement#title} 
412          * attribute, and may be particularly useful for non-visual web browsers.</p>
413          * @since 1.0
414          * @javascript Re-compilers must resolve the member of this instance field to the
415          * identifier of the field name appending to the identifier resolved from its 
416          * qualifying member with a dot in between.
417          */
418         public final Value.String.Member longDesc = new Value.String.Member(this, Members.longDesc);
419         /**
420          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
421          * name of this field, qualified by the current member instance of the field, and 
422          * to access the property of the name on an object.</p>
423          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
424          * object refers to a string specifying a client-side image map for this image.</p> 
425          * @since 1.0
426          * @javascript Re-compilers must resolve the member of this instance field to the
427          * identifier of the field name appending to the identifier resolved from its 
428          * qualifying member with a dot in between.
429          */
430         public final Value.String.Member useMap   = new Value.String.Member(this, Members.useMap  );
431         /**
432          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
433          * name of this field, qualified by the current member instance of the field, and 
434          * to access the property of the name on an object.</p>
435          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
436          * object refers to a number value specifying vertical space above and below 
437          * this image in pixels. Note that the type of this attribute was string in DOM 
438          * Level 1 HTML.</p> 
439          * @since 1.0
440          * @javascript Re-compilers must resolve the member of this instance field to the
441          * identifier of the field name appending to the identifier resolved from its 
442          * qualifying member with a dot in between.
443          */
444         public final Value.Number.Member vspace   = new Value.Number.Member(this, Members.vspace  );
445         /**
446          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
447          * name of this field, qualified by the current member instance of the field, and 
448          * to access the property of the name on an object.</p>
449          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
450          * object refers to a number value specifying the width of the image. Note that 
451          * the type of this attribute was string in DOM Level 1 HTML.</p> 
452          * @since 1.0
453          * @javascript Re-compilers must resolve the member of this instance field to the
454          * identifier of the field name appending to the identifier resolved from its 
455          * qualifying member with a dot in between.
456          */
457         public final Value.Number.Member width    = new Value.Number.Member(this, Members.width   );
458         /**
459          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
460          * name of this field, qualified by the current member instance of the field, and 
461          * to access the property of the name on an object.</p>
462          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
463          * object refers to a boolean value specifying whether to use a server-side 
464          * image map.</p> 
465          * @since 1.0
466          * @javascript Re-compilers must resolve the member of this instance field to the
467          * identifier of the field name appending to the identifier resolved from its 
468          * qualifying member with a dot in between.
469          */
470         public final Value.Boolean.Member isMap = new Value.Boolean.Member(this, Members.isMap);
471         /**
472          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
473          * name of this field, qualified by the current member instance of the field, and 
474          * to access the property of the name on an object.</p>
475          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
476          * object is a reference to an event handler function invoked if page loading 
477          * is stopped before the image is fully downloaded.</p> 
478          * @since 1.0
479          * @see JsElement#addEventListener(String, JsFunction, Boolean)
480          * @see JsElement#attachEvent(String, JsFunction)
481          * @javascript Re-compilers must resolve the member of this instance field to the
482          * identifier of the field name appending to the identifier resolved from its 
483          * qualifying member with a dot in between.
484          */
485         public final JsFunction.Member<?> onabort  = new JsFunction.Member<Object>(this, Members.onabort );
486         /**
487          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
488          * name of this field, qualified by the current member instance of the field, and 
489          * to access the property of the name on an object.</p>
490          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
491          * object is a reference to an event handler function invoked if an error occurs 
492          * while downloading the image.</p> 
493          * @since 1.0
494          * @see JsElement#addEventListener(String, JsFunction, Boolean)
495          * @see JsElement#attachEvent(String, JsFunction)
496          * @javascript Re-compilers must resolve the member of this instance field to the
497          * identifier of the field name appending to the identifier resolved from its 
498          * qualifying member with a dot in between.
499          */
500         public final JsFunction.Member<?> onerror  = new JsFunction.Member<Object>(this, Members.onerror );
501         /**
502          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
503          * name of this field, qualified by the current member instance of the field, and 
504          * to access the property of the name on an object.</p>
505          * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
506          * object is a reference to an event handler function invoked when the image 
507          * successfully finishes loading.</p> 
508          * @since 1.0
509          * @see JsElement#addEventListener(String, JsFunction, Boolean)
510          * @see JsElement#attachEvent(String, JsFunction)
511          * @javascript Re-compilers must resolve the member of this instance field to the
512          * identifier of the field name appending to the identifier resolved from its 
513          * qualifying member with a dot in between.
514          */
515         public final JsFunction.Member<?> onload   = new JsFunction.Member<Object>(this, Members.onload  );
516     }
517 
518     /**
519      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
520      * with the wrapping constructor.</p>
521      * @param var The argument of an <b>opaque</b> object.
522      * @since 1.0
523      * @javascript Re-compilers must ignore the construction operation of this constructor,
524      * that is, replacing it with its only argument.
525      */
526     public JsHTMLImageElement(JsObject var) {
527         super(var);
528     }
529 
530     /**
531      * <p>An <b>opaque</b> static field defining a member that is named by the field name
532      * without a qualifying member and to access the property of the name on an object.</p>
533      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
534      * object refers to a string that names the current image for backwards compatibility. 
535      * Applications should use the {@link JsHTMLElement#id} attribute to identify 
536      * elements.</p> 
537      * @since 1.0
538      * @javascript Re-compilers must resolve the member of this static field to the
539      * identifier of the field name.
540      */
541     public static final Value.String.Member name     = new Value.String.Member(Members.name    );
542     /**
543      * <p>An <b>opaque</b> static field defining a member that is named by the field name
544      * without a qualifying member and to access the property of the name on an object.</p>
545      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
546      * object refers to a URL string designating the location of this image. When 
547      * you set this property to the URL of a new image, the browser loads and displays 
548      * that new image. This is useful for updating the graphical appearance of your 
549      * web pages in response to user actions and can also be used to perform simple 
550      * animation.</p> 
551      * @since 1.0
552      * @javascript Re-compilers must resolve the member of this static field to the
553      * identifier of the field name.
554      */
555     public static final Value.String.Member src      = new Value.String.Member(Members.src     );
556     /**
557      * <p>An <b>opaque</b> static field defining a member that is named by the field name
558      * without a qualifying member and to access the property of the name on an object.</p>
559      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
560      * object refers to a string specifying the horizontal alignment of the element 
561      * with respect to the surrounding context. Possible values are:
562      * <ul>
563      * <li><tt>"left"</tt>: text lines are rendered flush left.</li>
564      * <li><tt>"center"</tt>: text lines are centered.</li>
565      * <li><tt>"right"</tt>: text lines are rendered flush right.</li>
566      * <li><tt>"justify"</tt>: text lines are justified to both margins.</li>
567      * </ul>
568      * The default value of this attribute depends on the base text direction. 
569      * For left to right text, the default is "left", while for right to left text, 
570      * it is "right".</p>
571      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
572      * @since 1.0
573      * @javascript Re-compilers must resolve the member of this static field to the
574      * identifier of the field name.
575      */
576     public static final Value.String.Member align    = new Value.String.Member(Members.align   );
577     /**
578      * <p>An <b>opaque</b> static field defining a member that is named by the field name
579      * without a qualifying member and to access the property of the name on an object.</p>
580      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
581      * object refers to a string specifying an alternate text for web browsers not 
582      * rendering the normal content of this element.</p>
583      * @since 1.0
584      * @javascript Re-compilers must resolve the member of this static field to the
585      * identifier of the field name.
586      */
587     public static final Value.String.Member alt      = new Value.String.Member(Members.alt     );
588     /**
589      * <p>An <b>opaque</b> static field defining a member that is named by the field name
590      * without a qualifying member and to access the property of the name on an object.</p>
591      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
592      * object refers to a string specifying the border width of this element, in 
593      * pixels. The default value for this attribute depends on the web browser.</p>
594      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
595      * @since 1.0
596      * @javascript Re-compilers must resolve the member of this static field to the
597      * identifier of the field name.
598      */
599     public static final Value.String.Member border   = new Value.String.Member(Members.border  );
600     /**
601      * <p>An <b>opaque</b> static field defining a member that is named by the field name
602      * without a qualifying member and to access the property of the name on an object.</p>
603      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
604      * object refers to a number value specifying the height of the image. Note that 
605      * the type of this attribute was string in DOM Level 1 HTML.</p> 
606      * @since 1.0
607      * @javascript Re-compilers must resolve the member of this static field to the
608      * identifier of the field name.
609      */
610     public static final Value.Number.Member height   = new Value.Number.Member(Members.height  );
611     /**
612      * <p>An <b>opaque</b> static field defining a member that is named by the field name
613      * without a qualifying member and to access the property of the name on an object.</p>
614      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
615      * object refers to a number value specifying horizontal space to the left and 
616      * right of this image in pixels. Note that the type of this attribute was 
617      * string in DOM Level 1 HTML.</p> 
618      * @since 1.0
619      * @javascript Re-compilers must resolve the member of this static field to the
620      * identifier of the field name.
621      */
622     public static final Value.Number.Member hspace   = new Value.Number.Member(Members.hspace  );
623     /**
624      * <p>An <b>opaque</b> static field defining a member that is named by the field name
625      * without a qualifying member and to access the property of the name on an object.</p>
626      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
627      * object refers to a string designating a long description of this image. The 
628      * description should supplement the short description provided by the {@link JsHTMLElement#title} 
629      * attribute, and may be particularly useful for non-visual web browsers.</p>
630      * @since 1.0
631      * @javascript Re-compilers must resolve the member of this static field to the
632      * identifier of the field name.
633      */
634     public static final Value.String.Member longDesc = new Value.String.Member(Members.longDesc);
635     /**
636      * <p>An <b>opaque</b> static field defining a member that is named by the field name
637      * without a qualifying member and to access the property of the name on an object.</p>
638      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
639      * object refers to a string specifying a client-side image map for this image.</p> 
640      * @since 1.0
641      * @javascript Re-compilers must resolve the member of this static field to the
642      * identifier of the field name.
643      */
644     public static final Value.String.Member useMap   = new Value.String.Member(Members.useMap  );
645     /**
646      * <p>An <b>opaque</b> static field defining a member that is named by the field name
647      * without a qualifying member and to access the property of the name on an object.</p>
648      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
649      * object refers to a number value specifying vertical space above and below 
650      * this image in pixels. Note that the type of this attribute was string in DOM 
651      * Level 1 HTML.</p> 
652      * @since 1.0
653      * @javascript Re-compilers must resolve the member of this static field to the
654      * identifier of the field name.
655      */
656     public static final Value.Number.Member vspace   = new Value.Number.Member(Members.vspace  );
657     /**
658      * <p>An <b>opaque</b> static field defining a member that is named by the field name
659      * without a qualifying member and to access the property of the name on an object.</p>
660      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
661      * object refers to a number value specifying the width of the image. Note that 
662      * the type of this attribute was string in DOM Level 1 HTML.</p> 
663      * @since 1.0
664      * @javascript Re-compilers must resolve the member of this static field to the
665      * identifier of the field name.
666      */
667     public static final Value.Number.Member width    = new Value.Number.Member(Members.width   );
668     /**
669      * <p>An <b>opaque</b> static field defining a member that is named by the field name
670      * without a qualifying member and to access the property of the name on an object.</p>
671      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
672      * object refers to a boolean value specifying whether to use a server-side 
673      * image map.</p> 
674      * @since 1.0
675      * @javascript Re-compilers must resolve the member of this static field to the
676      * identifier of the field name.
677      */
678     public static final Value.Boolean.Member isMap = new Value.Boolean.Member(Members.isMap);
679     /**
680      * <p>An <b>opaque</b> static field defining a member that is named by the field name
681      * without a qualifying member and to access the property of the name on an object.</p>
682      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
683      * object is a reference to an event handler function invoked if page loading 
684      * is stopped before the image is fully downloaded.</p> 
685      * @since 1.0
686      * @javascript Re-compilers must resolve the member of this static field to the
687      * identifier of the field name.
688      */
689     public static final JsFunction.Member<?> onabort  = new JsFunction.Member<Object>(Members.onabort );
690     /**
691      * <p>An <b>opaque</b> static field defining a member that is named by the field name
692      * without a qualifying member and to access the property of the name on an object.</p>
693      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
694      * object is a reference to an event handler function invoked if an error occurs 
695      * while downloading the image.</p> 
696      * @since 1.0
697      * @javascript Re-compilers must resolve the member of this static field to the
698      * identifier of the field name.
699      */
700     public static final JsFunction.Member<?> onerror  = new JsFunction.Member<Object>(Members.onerror );
701     /**
702      * <p>An <b>opaque</b> static field defining a member that is named by the field name
703      * without a qualifying member and to access the property of the name on an object.</p>
704      * <p>The property, identified by this member, of a {@link JsHTMLImageElement} 
705      * object is a reference to an event handler function invoked when the image 
706      * successfully finishes loading.</p> 
707      * @since 1.0
708      * @javascript Re-compilers must resolve the member of this static field to the
709      * identifier of the field name.
710      */
711     public static final JsFunction.Member<?> onload   = new JsFunction.Member<Object>(Members.onload  );
712 
713     @Override
714     /**
715      * <p>Returns the primitive value associated with the current instance, if there is one.
716      * This invocation simply returns the instance itself for the current instance is an 
717      * object and there is no primitive value for it.</p>
718      * @return The current object itself.
719      * @since 1.0
720      * @javascript Re-compilers must convert the instance invocation of this method directly
721      * into a JavaScript invocation on its current object instance without changing the 
722      * method name, but expanding variable arguments, if any, into comma-separated values. 
723      */
724     public JsHTMLImageElement valueOf() {
725         return new JsHTMLImageElement((JsObject)var().valueOf());
726     }
727 }