0001 
0002 /*
0003  *  JScripter Standard 1.0 - To Script In Java
0004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
0005  *  
0006  *  This program is free software: you can redistribute it and/or modify
0007  *  it under the terms of the GNU Affero General Public License as published by
0008  *  the Free Software Foundation, either version 3 of the License, or
0009  *  (at your option) any later version.
0010  *  
0011  *  This program is distributed in the hope that it will be useful,
0012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  *  GNU Affero General Public License for more details.
0015  *  
0016  *  You should have received a copy of the GNU Affero General Public License
0017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 package js.user;
0021 
0022 import js.*;
0023 import js.core.*;
0024 
0025 /**
0026  * <p>An <b>opaque</b> class representing client-side objects of the JavaScript global 
0027  * {@link JsClient#CanvasRenderingContext2D} class.</p>
0028  * <p>An object of this type provides a set of graphics functions to draw on a canvas.</p>
0029  *
0030  * @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>
0031  *
0032  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
0033  * generated into the target codes. Re-compilers must exit with error on the operations of
0034  * accessing that kind of class objects.
0035  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
0036  * and <tt>instanceof</tt> to it always <tt>true</tt>.
0037  */
0038 public class JsCanvasRenderingContext2D extends JsClient.CanvasRenderingContext2D.Prototype
0039 {
0040     /**
0041      * <p>Draws only the new shape, removing everything else.</p>
0042      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0043      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0044      * are combined with colors that already exist on the canvas.</p>
0045      * @since 1.0
0046      */
0047     public final static String COMPOSITE_COPY             = "copy";
0048     /**
0049      * <p>Where both shapes overlap, the color is determined by subtracting color values.</p>
0050      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0051      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0052      * are combined with colors that already exist on the canvas.</p>
0053      * @since 1.0
0054      */
0055     public final static String COMPOSITE_DARKER           = "darker";
0056     /**
0057      * <p>Existing content is kept only where it overlaps the new shape. The new shape is drawn behind the content.</p>
0058      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0059      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0060      * are combined with colors that already exist on the canvas.</p>
0061      * @since 1.0
0062      */
0063     public final static String COMPOSITE_DESTINATION_ATOP = "destination-atop";
0064     /**
0065      * <p>Existing content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.</p>
0066      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0067      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0068      * are combined with colors that already exist on the canvas.</p>
0069      * @since 1.0
0070      */
0071     public final static String COMPOSITE_DESTINATION_IN   = "destination-in";
0072     /**
0073      * <p>Existing content is kept where it doesn't overlap the new shape. Everything else is made transparent.</p>
0074      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0075      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0076      * are combined with colors that already exist on the canvas.</p>
0077      * @since 1.0
0078      */
0079     public final static String COMPOSITE_DESTINATION_OUT  = "destination-out";
0080     /**
0081      * <p>The new shape is drawn behind existing content.</p>
0082      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0083      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0084      * are combined with colors that already exist on the canvas.</p>
0085      * @since 1.0
0086      */
0087     public final static String COMPOSITE_DESTINATION_OVER = "destination-over";
0088     /**
0089      * <p>Where both shapes overlap, the color is determined by adding the two color values.</p>
0090      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0091      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0092      * are combined with colors that already exist on the canvas.</p>
0093      * @since 1.0
0094      */
0095     public final static String COMPOSITE_LIGHTER          = "lighter";
0096     /**
0097      * <p>The new shape is drawn only where it overlaps existing content.</p>
0098      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0099      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0100      * are combined with colors that already exist on the canvas.</p>
0101      * @since 1.0
0102      */
0103     public final static String COMPOSITE_SOURCE_ATOP      = "source-atop";
0104     /**
0105      * <p>The new shape is drawn only where both the new shape and existing content overlap. Everything else is made transparent.</p>
0106      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0107      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0108      * are combined with colors that already exist on the canvas.</p>
0109      * @since 1.0
0110      */
0111     public final static String COMPOSITE_SOURCE_IN        = "source-in";
0112     /**
0113      * <p>The new shape is drawn where it doesn't overlap existing content.</p>
0114      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0115      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0116      * are combined with colors that already exist on the canvas.</p>
0117      * @since 1.0
0118      */
0119     public final static String COMPOSITE_SOURCE_OUT       = "source-out";
0120     /**
0121      * <p>The new shape is drawn on top of existing content. This is the default behavior.</p>
0122      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0123      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0124      * are combined with colors that already exist on the canvas.</p>
0125      * @since 1.0
0126      */
0127     public final static String COMPOSITE_SOURCE_OVER      = "source-over";
0128     /**
0129      * <p>Shapes are made transparent where both overlap and drawn normal everywhere else.</p>
0130      * <p>This constant is a legal value for the {@link #globalCompositeOperation} property 
0131      * of a {@link JsCanvasRenderingContext2D} object indicating how colors being drawn 
0132      * are combined with colors that already exist on the canvas.</p>
0133      * @since 1.0
0134      */
0135     public final static String COMPOSITE_XOR              = "xor";
0136 
0137     /**
0138      * <p>This default value specifies that the line should have no cap. The end of the line is straight and is perpendicular to the direction of the line. The line is not extended beyond its end-point.</p>
0139      * <p>This constant is a legal value for the {@link #lineCap} property of a {@link JsCanvasRenderingContext2D} 
0140      * object indicating how how lines should be terminated.</p>
0141      * @since 1.0
0142      */
0143     public final static String LINECAP_BUTT   = "butt";
0144     /**
0145      * <p>Specifies that lines should be capped with a semi-circle whose diameter is equal to the width of the line and which extends beyond the end of the line by one half the width of the line.</p>
0146      * <p>This constant is a legal value for the {@link #lineCap} property of a {@link JsCanvasRenderingContext2D} 
0147      * object indicating how how lines should be terminated.</p>
0148      * @since 1.0
0149      */
0150     public final static String LINECAP_ROUND  = "round";
0151     /**
0152      * <p>Specifies that lines should be capped with a rectangle. This value is like "butt", but the line is extended by half of its width.</p>
0153      * <p>This constant is a legal value for the {@link #lineCap} property of a {@link JsCanvasRenderingContext2D} 
0154      * object indicating how how lines should be terminated.</p>
0155      * @since 1.0
0156      */
0157     public final static String LINECAP_SQUARE = "square";
0158 
0159     /**
0160      * <p>A legal value for the {@link #lineJoin} property of a {@link JsCanvasRenderingContext2D} 
0161      * object indicating how vertices are drawn when a path includes the vertices where 
0162      * line segments and/or curves meet.</p>
0163      * @since 1.0
0164      */
0165     public final static String LINEJOIN_MITER = "miter";
0166     /**
0167      * <p>A legal value for the {@link #lineJoin} property of a {@link JsCanvasRenderingContext2D} 
0168      * object indicating how vertices are drawn when a path includes the vertices where 
0169      * line segments and/or curves meet.</p>
0170      * @since 1.0
0171      */
0172     public final static String LINEJOIN_ROUND = "round";
0173     /**
0174      * <p>A legal value for the {@link #lineJoin} property of a {@link JsCanvasRenderingContext2D} 
0175      * object indicating how vertices are drawn when a path includes the vertices where 
0176      * line segments and/or curves meet.</p>
0177      * @since 1.0
0178      */
0179     public final static String LINEJOIN_BEVEL = "bevel";
0180 
0181     /**
0182      * <p>An <b>internal</b> class containing membership data for its enclosing
0183      * opaque class.</p>
0184      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
0185      * class members.</p>
0186      *
0187      * @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>
0188      * 
0189      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
0190      */
0191     protected static abstract class Members extends JsClient.CanvasRenderingContext2D.Prototype.Members
0192     {
0193         /**
0194          * <p>An <b>internal</b> static field defining a member ID of the field name and
0195          * used internally to define a member of the same name.</p>
0196          * @since 1.0
0197          * @see JsCanvasRenderingContext2D#canvas
0198          * @see JsCanvasRenderingContext2D.Member#canvas
0199          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0200          */
0201         public final static Mid canvas                   = id("canvas"                  );
0202         /**
0203          * <p>An <b>internal</b> static field defining a member ID of the field name and
0204          * used internally to define a member of the same name.</p>
0205          * @since 1.0
0206          * @see JsCanvasRenderingContext2D#fillStyle
0207          * @see JsCanvasRenderingContext2D.Member#fillStyle
0208          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0209          */
0210         public final static Mid fillStyle                = id("fillStyle"               );
0211         /**
0212          * <p>An <b>internal</b> static field defining a member ID of the field name and
0213          * used internally to define a member of the same name.</p>
0214          * @since 1.0
0215          * @see JsCanvasRenderingContext2D#globalAlpha
0216          * @see JsCanvasRenderingContext2D.Member#globalAlpha
0217          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0218          */
0219         public final static Mid globalAlpha              = id("globalAlpha"             );
0220         /**
0221          * <p>An <b>internal</b> static field defining a member ID of the field name and
0222          * used internally to define a member of the same name.</p>
0223          * @since 1.0
0224          * @see JsCanvasRenderingContext2D#globalCompositeOperation
0225          * @see JsCanvasRenderingContext2D.Member#globalCompositeOperation
0226          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0227          */
0228         public final static Mid globalCompositeOperation = id("globalCompositeOperation");
0229         /**
0230          * <p>An <b>internal</b> static field defining a member ID of the field name and
0231          * used internally to define a member of the same name.</p>
0232          * @since 1.0
0233          * @see JsCanvasRenderingContext2D#lineCap
0234          * @see JsCanvasRenderingContext2D.Member#lineCap
0235          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0236          */
0237         public final static Mid lineCap                  = id("lineCap"                 );
0238         /**
0239          * <p>An <b>internal</b> static field defining a member ID of the field name and
0240          * used internally to define a member of the same name.</p>
0241          * @since 1.0
0242          * @see JsCanvasRenderingContext2D#lineJoin
0243          * @see JsCanvasRenderingContext2D.Member#lineJoin
0244          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0245          */
0246         public final static Mid lineJoin                 = id("lineJoin"                );
0247         /**
0248          * <p>An <b>internal</b> static field defining a member ID of the field name and
0249          * used internally to define a member of the same name.</p>
0250          * @since 1.0
0251          * @see JsCanvasRenderingContext2D#lineWidth
0252          * @see JsCanvasRenderingContext2D.Member#lineWidth
0253          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0254          */
0255         public final static Mid lineWidth                = id("lineWidth"               );
0256         /**
0257          * <p>An <b>internal</b> static field defining a member ID of the field name and
0258          * used internally to define a member of the same name.</p>
0259          * @since 1.0
0260          * @see JsCanvasRenderingContext2D#miterLimit
0261          * @see JsCanvasRenderingContext2D.Member#miterLimit
0262          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0263          */
0264         public final static Mid miterLimit               = id("miterLimit"              );
0265         /**
0266          * <p>An <b>internal</b> static field defining a member ID of the field name and
0267          * used internally to define a member of the same name.</p>
0268          * @since 1.0
0269          * @see JsCanvasRenderingContext2D#shadowBlur
0270          * @see JsCanvasRenderingContext2D.Member#shadowBlur
0271          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0272          */
0273         public final static Mid shadowBlur               = id("shadowBlur"              );
0274         /**
0275          * <p>An <b>internal</b> static field defining a member ID of the field name and
0276          * used internally to define a member of the same name.</p>
0277          * @since 1.0
0278          * @see JsCanvasRenderingContext2D#shadowColor
0279          * @see JsCanvasRenderingContext2D.Member#shadowColor
0280          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0281          */
0282         public final static Mid shadowColor              = id("shadowColor"             );
0283         /**
0284          * <p>An <b>internal</b> static field defining a member ID of the field name and
0285          * used internally to define a member of the same name.</p>
0286          * @since 1.0
0287          * @see JsCanvasRenderingContext2D#shadowOffsetX
0288          * @see JsCanvasRenderingContext2D.Member#shadowOffsetX
0289          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0290          */
0291         public final static Mid shadowOffsetX            = id("shadowOffsetX"           );
0292         /**
0293          * <p>An <b>internal</b> static field defining a member ID of the field name and
0294          * used internally to define a member of the same name.</p>
0295          * @since 1.0
0296          * @see JsCanvasRenderingContext2D#shadowOffsetY
0297          * @see JsCanvasRenderingContext2D.Member#shadowOffsetY
0298          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0299          */
0300         public final static Mid shadowOffsetY            = id("shadowOffsetY"           );
0301         /**
0302          * <p>An <b>internal</b> static field defining a member ID of the field name and
0303          * used internally to define a member of the same name.</p>
0304          * @since 1.0
0305          * @see JsCanvasRenderingContext2D#strokeStyle
0306          * @see JsCanvasRenderingContext2D.Member#strokeStyle
0307          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
0308          */
0309         public final static Mid strokeStyle              = id("strokeStyle"             );
0310     }
0311     /**
0312      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
0313      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
0314      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
0315      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
0316      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
0317      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
0318      * either circumstance, the field names must be exactly same as the member names, as 
0319      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
0320      * based on the field names.</p>
0321      *
0322      * @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>
0323      * 
0324      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
0325      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
0326      * of class objects.
0327      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
0328      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
0329      * <pre>q.m</pre>
0330      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
0331      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
0332      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
0333      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
0334      * <pre>m</pre>
0335      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
0336      * error on the access to <b>opaque</b> fields declared by this class under any other 
0337      * circumstances.
0338      */
0339     public static class Member extends JsClient.CanvasRenderingContext2D.Prototype.Member
0340     {
0341         /**
0342          * <p>Internally constructs a member based on a qualifying member.</p>
0343          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
0344          * or <b>internal</b> classes or class members.</p>
0345          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
0346          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
0347          * declared in the declaring class of this constructor itself or its subclasses. 
0348          * Under this circumstance, the field names must be exactly same as the member 
0349          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
0350          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
0351          * to their names appending to the name resolved from the specified qualifying 
0352          * member with a dot in between.</p>
0353          * @param q A qualifying member
0354          * @param mid The ID of the member to construct
0355          * @since 1.0
0356          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
0357          */
0358         public Member(JsObject.Member q, Mid mid) {
0359             super(q, mid);
0360         }
0361         /**
0362          * <p>Internally constructs a member without a qualifying member.</p>
0363          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
0364          * or <b>internal</b> classes or class members.</p>
0365          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
0366          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
0367          * declared in <b>opaque</b> types other than the declaring class of this constructor 
0368          * itself and its subclasses. Under this circumstance, the field names must be
0369          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
0370          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
0371          * @param mid The ID of the member to construct
0372          * @since 1.0
0373          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
0374          */
0375         public Member(Mid mid) {
0376             super(mid);
0377         }
0378         @Override
0379         /**
0380          * <p>Evaluates the property, represented by the current member instance, of the
0381          * argument object.</p>
0382          * @param o The argument object
0383          * @return The value of the current member based on the object argument.
0384          * @since 1.0
0385          * @javascript Re-compilers must convert the instance invocation of this method into
0386          * the JavaScript expression: 
0387          * <pre>o.m</pre>
0388          * where <tt>m</tt> is the identifier name resolved from the current member
0389          * instance of the invocation.
0390          */
0391         public JsCanvasRenderingContext2D with(ObjectLike o) {
0392             return new JsCanvasRenderingContext2D(super.with(o));
0393         }
0394 
0395         /**
0396          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0397          * name of this field, qualified by the current member instance of the field, and 
0398          * to access the property of the name on an object.</p>
0399          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0400          * object refers to a float value specifying the opacity of content drawn on the canvas. 
0401          * The range of values is between 0.0 (fully transparent) and 1.0 (no additional 
0402          * transparency). The default value for the property is 1.0.</p> 
0403          * @since 1.0
0404          * @javascript Re-compilers must resolve the member of this instance field to the
0405          * identifier of the field name appending to the identifier resolved from its 
0406          * qualifying member with a dot in between.
0407          */
0408         public final Value.Number.Member globalAlpha              = new Value.Number.Member(this, Members.globalAlpha             );
0409         /**
0410          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0411          * name of this field, qualified by the current member instance of the field, and 
0412          * to access the property of the name on an object.</p>
0413          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0414          * object refers to a string specifying how colors being drawn are combined (or 
0415          * "composited") with colors that already exist on the canvas. The following are the 
0416          * possible values and their meanings. The word source in the these values refers to 
0417          * the colors being drawn onto the canvas, and the word destination refers to the 
0418          * existing colors on the canvas. The default is {@link JsCanvasRenderingContext2D#COMPOSITE_SOURCE_OVER}.
0419          * <ul>
0420          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_COPY}</li>
0421          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_DARKER}</li>
0422          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_DESTINATION_ATOP}</li>
0423          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_DESTINATION_IN}</li>
0424          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_DESTINATION_OUT}</li>
0425          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_DESTINATION_OVER}</li>
0426          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_LIGHTER}</li>
0427          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_SOURCE_ATOP}</li>
0428          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_SOURCE_IN}</li>
0429          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_SOURCE_OUT}</li>
0430          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_SOURCE_OVER}</li>
0431          * <li>{@link JsCanvasRenderingContext2D#COMPOSITE_XOR}</li>
0432          * </ul>
0433          * </p>
0434          * @since 1.0
0435          * @javascript Re-compilers must resolve the member of this instance field to the
0436          * identifier of the field name appending to the identifier resolved from its 
0437          * qualifying member with a dot in between.
0438          */
0439         public final Value.String.Member globalCompositeOperation = new Value.String.Member(this, Members.globalCompositeOperation);
0440         /**
0441          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0442          * name of this field, qualified by the current member instance of the field, and 
0443          * to access the property of the name on an object.</p>
0444          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0445          * object refers to a string value specifying how lines should be terminated. It matters 
0446          * only when drawing wide lines. Legal values for the property are listed as follows. 
0447          * The default value is {@link JsCanvasRenderingContext2D#LINECAP_BUTT}.
0448          * <ul>
0449          * <li>{@link JsCanvasRenderingContext2D#LINECAP_BUTT}</li>
0450          * <li>{@link JsCanvasRenderingContext2D#LINECAP_ROUND}</li>
0451          * <li>{@link JsCanvasRenderingContext2D#LINECAP_SQUARE}</li>
0452          * </ul>
0453          * </p>
0454          * @since 1.0
0455          * @javascript Re-compilers must resolve the member of this instance field to the
0456          * identifier of the field name appending to the identifier resolved from its 
0457          * qualifying member with a dot in between.
0458          */
0459         public final Value.String.Member lineCap                  = new Value.String.Member(this, Members.lineCap                 );
0460         /**
0461          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0462          * name of this field, qualified by the current member instance of the field, and 
0463          * to access the property of the name on an object.</p>
0464          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0465          * object refers to a string value specifying how two lines are joined. Legal values 
0466          * are {@link JsCanvasRenderingContext2D#LINEJOIN_ROUND}, {@link JsCanvasRenderingContext2D#LINEJOIN_BEVEL}, 
0467          * and {@link JsCanvasRenderingContext2D#LINEJOIN_MITER}. The default is 
0468          * {@link JsCanvasRenderingContext2D#LINEJOIN_MITER}.</p>
0469          * <p>When a path includes vertices where line segments and/or curves meet, this 
0470          * property specifies how those vertices are drawn. The effect of this property 
0471          * is apparent only when drawing with wide lines.</p> 
0472          * <p>The default value of the property is {@link JsCanvasRenderingContext2D#LINEJOIN_MITER}, 
0473          * which specifies that the outside edges of the two line segments are extended 
0474          * until they intersect. When two lines meet at an acute angle, mitered joins can 
0475          * become quite long. The {@link JsCanvasRenderingContext2D#miterLimit} property 
0476          * places an upper bound on the length of a miter. Beyond this limit, the miter 
0477          * is beveled off.</p> 
0478          * <p>The value {@link JsCanvasRenderingContext2D#LINEJOIN_ROUND} specifies that 
0479          * the outside edges of the vertex should be joined with a filled arc whose diameter 
0480          * is equal to the width of the line.</p> 
0481          * <p>The value {@link JsCanvasRenderingContext2D#LINEJOIN_BEVEL} specifies that 
0482          * the outside edges of the vertex should be joined with a filled triangle.</p> 
0483          * @since 1.0
0484          * @javascript Re-compilers must resolve the member of this instance field to the
0485          * identifier of the field name appending to the identifier resolved from its 
0486          * qualifying member with a dot in between.
0487          */
0488         public final Value.String.Member lineJoin                 = new Value.String.Member(this, Members.lineJoin                );
0489         /**
0490          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0491          * name of this field, qualified by the current member instance of the field, and 
0492          * to access the property of the name on an object.</p>
0493          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0494          * object refers to a float value specifying the line width for stroking (line 
0495          * drawing) operations. The default is 1.0, and this property must be greater 
0496          * than 0.0. Wide lines are centered over the path, with half of the line width 
0497          * on each side.</p> 
0498          * @since 1.0
0499          * @javascript Re-compilers must resolve the member of this instance field to the
0500          * identifier of the field name appending to the identifier resolved from its 
0501          * qualifying member with a dot in between.
0502          */
0503         public final Value.Number.Member lineWidth                = new Value.Number.Member(this, Members.lineWidth               );
0504         /**
0505          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0506          * name of this field, qualified by the current member instance of the field, and 
0507          * to access the property of the name on an object.</p>
0508          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0509          * object refers to a float value specifying the maximum ratio of miter length 
0510          * to line width when the {@link JsCanvasRenderingContext2D#lineJoin} property 
0511          * is {@link JsCanvasRenderingContext2D#LINEJOIN_MITER}.</p> 
0512          * @since 1.0
0513          * @javascript Re-compilers must resolve the member of this instance field to the
0514          * identifier of the field name appending to the identifier resolved from its 
0515          * qualifying member with a dot in between.
0516          */
0517         public final Value.Number.Member miterLimit               = new Value.Number.Member(this, Members.miterLimit              );
0518         /**
0519          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0520          * name of this field, qualified by the current member instance of the field, and 
0521          * to access the property of the name on an object.</p>
0522          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0523          * object refers to a float value specifying how much feathering shadows should 
0524          * have. The default is 0.</p> 
0525          * @since 1.0
0526          * @javascript Re-compilers must resolve the member of this instance field to the
0527          * identifier of the field name appending to the identifier resolved from its 
0528          * qualifying member with a dot in between.
0529          */
0530         public final Value.Number.Member shadowBlur               = new Value.Number.Member(this, Members.shadowBlur              );
0531         /**
0532          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0533          * name of this field, qualified by the current member instance of the field, and 
0534          * to access the property of the name on an object.</p>
0535          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0536          * object refers to a string value specifying the color of shadows as a CSS or 
0537          * web style string and may include an alpha component for transparency. The 
0538          * default is black.</p> 
0539          * @since 1.0
0540          * @javascript Re-compilers must resolve the member of this instance field to the
0541          * identifier of the field name appending to the identifier resolved from its 
0542          * qualifying member with a dot in between.
0543          */
0544         public final Value.String.Member shadowColor              = new Value.String.Member(this, Members.shadowColor             );
0545         /**
0546          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0547          * name of this field, qualified by the current member instance of the field, and 
0548          * to access the property of the name on an object.</p>
0549          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0550          * object refers to a float value specifying the horizontal offset of the 
0551          * shadows. Larger values make the shadowed object appear to float higher above 
0552          * the background. The default is 0.</p> 
0553          * @since 1.0
0554          * @javascript Re-compilers must resolve the member of this instance field to the
0555          * identifier of the field name appending to the identifier resolved from its 
0556          * qualifying member with a dot in between.
0557          */
0558         public final Value.Number.Member shadowOffsetX            = new Value.Number.Member(this, Members.shadowOffsetX           );
0559         /**
0560          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0561          * name of this field, qualified by the current member instance of the field, and 
0562          * to access the property of the name on an object.</p>
0563          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0564          * object refers to a float value specifying the vertical offset of the 
0565          * shadows. Larger values make the shadowed object appear to float higher above 
0566          * the background. The default is 0.</p> 
0567          * @since 1.0
0568          * @javascript Re-compilers must resolve the member of this instance field to the
0569          * identifier of the field name appending to the identifier resolved from its 
0570          * qualifying member with a dot in between.
0571          */
0572         public final Value.Number.Member shadowOffsetY            = new Value.Number.Member(this, Members.shadowOffsetY           );
0573         /**
0574          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0575          * name of this field, qualified by the current member instance of the field, and 
0576          * to access the property of the name on an object.</p>
0577          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0578          * object is a read-only reference to the {@link JsHTMLCanvasElement} element 
0579          * upon which this context will draw.</p>
0580          * @since 1.0
0581          * @javascript Re-compilers must resolve the member of this instance field to the
0582          * identifier of the field name appending to the identifier resolved from its 
0583          * qualifying member with a dot in between.
0584          */
0585         public final JsHTMLCanvasElement.Member canvas = new JsHTMLCanvasElement.Member(this, Members.canvas);
0586         /**
0587          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0588          * name of this field, qualified by the current member instance of the field, and 
0589          * to access the property of the name on an object.</p>
0590          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0591          * object refers to the current color, pattern, or gradient used for filling paths. 
0592          * The property may be set to a string or to a {@link JsCanvasGradient} or 
0593          * {@link JsCanvasPattern} object. When set to a string, it is parsed as a CSS 
0594          * color value and used for solid fills. When set to a {@link JsCanvasGradient} 
0595          * or {@link JsCanvasPattern} object, fills are done using the specified 
0596          * gradient or pattern.</p>
0597          * @since 1.0
0598          * @see JsCanvasRenderingContext2D#createLinearGradient(Number, Number, Number, Number)
0599          * @see JsCanvasRenderingContext2D#createPattern(JsHTMLCanvasElement, String)
0600          * @see JsCanvasRenderingContext2D#createPattern(JsHTMLImageElement, String)
0601          * @see JsCanvasRenderingContext2D#createRadialGradient(Number, Number, Number, Number, Number, Number)
0602          * @javascript Re-compilers must resolve the member of this instance field to the
0603          * identifier of the field name appending to the identifier resolved from its 
0604          * qualifying member with a dot in between.
0605          */
0606         public final Value.Member<Object> fillStyle   = new Value.Member<Object>(this, Members.fillStyle  );
0607         /**
0608          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
0609          * name of this field, qualified by the current member instance of the field, and 
0610          * to access the property of the name on an object.</p>
0611          * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0612          * object refers to the color, pattern, or gradient used for stroking (drawing) paths. 
0613          * The property may be set to a string or to a {@link JsCanvasGradient} or 
0614          * {@link JsCanvasPattern} object. When set to a string, it is parsed as a CSS 
0615          * color value and used for solid fills. When set to a {@link JsCanvasGradient} 
0616          * or {@link JsCanvasPattern} object, fills are done using the specified 
0617          * gradient or pattern.</p>
0618          * @since 1.0
0619          * @see JsCanvasRenderingContext2D#createLinearGradient(Number, Number, Number, Number)
0620          * @see JsCanvasRenderingContext2D#createPattern(JsHTMLCanvasElement, String)
0621          * @see JsCanvasRenderingContext2D#createPattern(JsHTMLImageElement, String)
0622          * @see JsCanvasRenderingContext2D#createRadialGradient(Number, Number, Number, Number, Number, Number)
0623          * @javascript Re-compilers must resolve the member of this instance field to the
0624          * identifier of the field name appending to the identifier resolved from its 
0625          * qualifying member with a dot in between.
0626          */
0627         public final Value.Member<Object> strokeStyle = new Value.Member<Object>(this, Members.strokeStyle);
0628     }
0629 
0630     public JsCanvasRenderingContext2D(JsObject var) {
0631         super(var);
0632     }
0633 
0634     /**
0635      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0636      * without a qualifying member and to access the property of the name on an object.</p>
0637      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0638      * object refers to a float value specifying the opacity of content drawn on the canvas. 
0639      * The range of values is between 0.0 (fully transparent) and 1.0 (no additional 
0640      * transparency). The default value for the property is 1.0.</p> 
0641      * @since 1.0
0642      * @javascript Re-compilers must resolve the member of this static field to the
0643      * identifier of the field name.
0644      */
0645     public static final Value.Number.Member globalAlpha              = new Value.Number.Member(Members.globalAlpha             );
0646     /**
0647      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0648      * without a qualifying member and to access the property of the name on an object.</p>
0649      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0650      * object refers to a string specifying how colors being drawn are combined (or 
0651      * "composited") with colors that already exist on the canvas. The following are the 
0652      * possible values and their meanings. The word source in the these values refers to 
0653      * the colors being drawn onto the canvas, and the word destination refers to the 
0654      * existing colors on the canvas. The default is {@link #COMPOSITE_SOURCE_OVER}.
0655      * <ul>
0656      * <li>{@link #COMPOSITE_COPY}</li>
0657      * <li>{@link #COMPOSITE_DARKER}</li>
0658      * <li>{@link #COMPOSITE_DESTINATION_ATOP}</li>
0659      * <li>{@link #COMPOSITE_DESTINATION_IN}</li>
0660      * <li>{@link #COMPOSITE_DESTINATION_OUT}</li>
0661      * <li>{@link #COMPOSITE_DESTINATION_OVER}</li>
0662      * <li>{@link #COMPOSITE_LIGHTER}</li>
0663      * <li>{@link #COMPOSITE_SOURCE_ATOP}</li>
0664      * <li>{@link #COMPOSITE_SOURCE_IN}</li>
0665      * <li>{@link #COMPOSITE_SOURCE_OUT}</li>
0666      * <li>{@link #COMPOSITE_SOURCE_OVER}</li>
0667      * <li>{@link #COMPOSITE_XOR}</li>
0668      * </ul>
0669      * </p>
0670      * @since 1.0
0671      * @javascript Re-compilers must resolve the member of this static field to the
0672      * identifier of the field name.
0673      */
0674     public static final Value.String.Member globalCompositeOperation = new Value.String.Member(Members.globalCompositeOperation);
0675     /**
0676      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0677      * without a qualifying member and to access the property of the name on an object.</p>
0678      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0679      * object refers to a string value specifying how lines should be terminated. It matters 
0680      * only when drawing wide lines. Legal values for the property are listed as follows. 
0681      * The default value is {@link #LINECAP_BUTT}.
0682      * <ul>
0683      * <li>{@link #LINECAP_BUTT}</li>
0684      * <li>{@link #LINECAP_ROUND}</li>
0685      * <li>{@link #LINECAP_SQUARE}</li>
0686      * </ul>
0687      * </p>
0688      * @since 1.0
0689      * @javascript Re-compilers must resolve the member of this static field to the
0690      * identifier of the field name.
0691      */
0692     public static final Value.String.Member lineCap                  = new Value.String.Member(Members.lineCap                 );
0693     /**
0694      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0695      * without a qualifying member and to access the property of the name on an object.</p>
0696      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0697      * object refers to a string value specifying how two lines are joined. Legal values 
0698      * are {@link #LINEJOIN_MITER}, {@link #LINEJOIN_MITER}, and {@link #LINEJOIN_MITER}. 
0699      * The default is {@link #LINEJOIN_MITER}.</p>
0700      * <p>When a path includes vertices where line segments and/or curves meet, this 
0701      * property specifies how those vertices are drawn. The effect of this property 
0702      * is apparent only when drawing with wide lines.</p> 
0703      * <p>The default value of the property is {@link #LINEJOIN_MITER}, which specifies 
0704      * that the outside edges of the two line segments are extended until they intersect. 
0705      * When two lines meet at an acute angle, mitered joins can become quite long. 
0706      * The {@link #miterLimit} property places an upper bound on the length of a miter. 
0707      * Beyond this limit, the miter is beveled off.</p> 
0708      * <p>The value {@link #LINEJOIN_ROUND} specifies that the outside edges of the 
0709      * vertex should be joined with a filled arc whose diameter is equal to the width of 
0710      * the line.</p> 
0711      * <p>The value {@link #LINEJOIN_BEVEL} specifies that the outside edges of the 
0712      * vertex should be joined with a filled triangle.</p> 
0713      * @since 1.0
0714      * @javascript Re-compilers must resolve the member of this static field to the
0715      * identifier of the field name.
0716      */
0717     public static final Value.String.Member lineJoin                 = new Value.String.Member(Members.lineJoin                );
0718     /**
0719      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0720      * without a qualifying member and to access the property of the name on an object.</p>
0721      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0722      * object refers to a float value specifying the line width for stroking (line 
0723      * drawing) operations. The default is 1.0, and this property must be greater 
0724      * than 0.0. Wide lines are centered over the path, with half of the line width 
0725      * on each side.</p> 
0726      * @since 1.0
0727      * @javascript Re-compilers must resolve the member of this static field to the
0728      * identifier of the field name.
0729      */
0730     public static final Value.Number.Member lineWidth                = new Value.Number.Member(Members.lineWidth               );
0731     /**
0732      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0733      * without a qualifying member and to access the property of the name on an object.</p>
0734      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0735      * object refers to a float value specifying the maximum ratio of miter length 
0736      * to line width when the {@link #lineJoin} property 
0737      * is {@link #LINEJOIN_MITER}.</p> 
0738      * @since 1.0
0739      * @javascript Re-compilers must resolve the member of this static field to the
0740      * identifier of the field name.
0741      */
0742     public static final Value.Number.Member miterLimit               = new Value.Number.Member(Members.miterLimit              );
0743     /**
0744      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0745      * without a qualifying member and to access the property of the name on an object.</p>
0746      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0747      * object refers to a float value specifying how much feathering shadows should 
0748      * have. The default is 0.</p> 
0749      * @since 1.0
0750      * @javascript Re-compilers must resolve the member of this static field to the
0751      * identifier of the field name.
0752      */
0753     public static final Value.Number.Member shadowBlur               = new Value.Number.Member(Members.shadowBlur              );
0754     /**
0755      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0756      * without a qualifying member and to access the property of the name on an object.</p>
0757      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0758      * object refers to a string value specifying the color of shadows as a CSS or 
0759      * web style string and may include an alpha component for transparency. The 
0760      * default is black.</p> 
0761      * @since 1.0
0762      * @javascript Re-compilers must resolve the member of this static field to the
0763      * identifier of the field name.
0764      */
0765     public static final Value.String.Member shadowColor              = new Value.String.Member(Members.shadowColor             );
0766     /**
0767      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0768      * without a qualifying member and to access the property of the name on an object.</p>
0769      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0770      * object refers to a float value specifying the horizontal offset of the 
0771      * shadows. Larger values make the shadowed object appear to float higher above 
0772      * the background. The default is 0.</p> 
0773      * @since 1.0
0774      * @javascript Re-compilers must resolve the member of this static field to the
0775      * identifier of the field name.
0776      */
0777     public static final Value.Number.Member shadowOffsetX            = new Value.Number.Member(Members.shadowOffsetX           );
0778     /**
0779      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0780      * without a qualifying member and to access the property of the name on an object.</p>
0781      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0782      * object refers to a float value specifying the vertical offset of the 
0783      * shadows. Larger values make the shadowed object appear to float higher above 
0784      * the background. The default is 0.</p> 
0785      * @since 1.0
0786      * @javascript Re-compilers must resolve the member of this static field to the
0787      * identifier of the field name.
0788      */
0789     public static final Value.Number.Member shadowOffsetY            = new Value.Number.Member(Members.shadowOffsetY           );
0790     /**
0791      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0792      * without a qualifying member and to access the property of the name on an object.</p>
0793      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0794      * object is a read-only reference to the {@link JsHTMLCanvasElement} element 
0795      * upon which this context will draw.</p>
0796      * @since 1.0
0797      * @javascript Re-compilers must resolve the member of this static field to the
0798      * identifier of the field name.
0799      */
0800     public static final JsHTMLCanvasElement.Member canvas = new JsHTMLCanvasElement.Member(Members.canvas);
0801     /**
0802      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0803      * without a qualifying member and to access the property of the name on an object.</p>
0804      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0805      * object refers to the current color, pattern, or gradient used for filling paths. 
0806      * The property may be set to a string or to a {@link JsCanvasGradient} or 
0807      * {@link JsCanvasPattern} object. When set to a string, it is parsed as a CSS 
0808      * color value and used for solid fills. When set to a {@link JsCanvasGradient} 
0809      * or {@link JsCanvasPattern} object, fills are done using the specified 
0810      * gradient or pattern.</p>
0811      * @since 1.0
0812      * @see #createLinearGradient(Number, Number, Number, Number)
0813      * @see #createPattern(JsHTMLCanvasElement, String)
0814      * @see #createPattern(JsHTMLImageElement, String)
0815      * @see #createRadialGradient(Number, Number, Number, Number, Number, Number)
0816      * @javascript Re-compilers must resolve the member of this static field to the
0817      * identifier of the field name.
0818      */
0819     public static final Value.Member<Object> fillStyle   = new Value.Member<Object>(Members.fillStyle  );
0820     /**
0821      * <p>An <b>opaque</b> static field defining a member that is named by the field name
0822      * without a qualifying member and to access the property of the name on an object.</p>
0823      * <p>The property, identified by this member, of a {@link JsCanvasRenderingContext2D} 
0824      * object refers to the color, pattern, or gradient used for stroking (drawing) paths. 
0825      * The property may be set to a string or to a {@link JsCanvasGradient} or 
0826      * {@link JsCanvasPattern} object. When set to a string, it is parsed as a CSS 
0827      * color value and used for solid fills. When set to a {@link JsCanvasGradient} 
0828      * or {@link JsCanvasPattern} object, fills are done using the specified 
0829      * gradient or pattern.</p>
0830      * @since 1.0
0831      * @see #createLinearGradient(Number, Number, Number, Number)
0832      * @see #createPattern(JsHTMLCanvasElement, String)
0833      * @see #createPattern(JsHTMLImageElement, String)
0834      * @see #createRadialGradient(Number, Number, Number, Number, Number, Number)
0835      * @javascript Re-compilers must resolve the member of this static field to the
0836      * identifier of the field name.
0837      */
0838     public static final Value.Member<Object> strokeStyle = new Value.Member<Object>(Members.strokeStyle);
0839 
0840     @Override
0841     /**
0842      * <p>Returns the primitive value associated with the current instance, if there is one.
0843      * This invocation simply returns the instance itself for the current instance is an 
0844      * object and there is no primitive value for it.</p>
0845      * @return The current object itself.
0846      * @since 1.0
0847      * @javascript Re-compilers must convert the instance invocation of this method directly
0848      * into a JavaScript invocation on its current object instance without changing the 
0849      * method name, but expanding variable arguments, if any, into comma-separated values. 
0850      */
0851     public JsCanvasRenderingContext2D valueOf() {
0852         return new JsCanvasRenderingContext2D((JsObject)var().valueOf());
0853     }
0854     public final JsHTMLCanvasElement var(JsHTMLCanvasElement.Member r) {
0855         return r.with(this);
0856     }
0857 
0858     /**
0859      * <p>Adds an arc to the current sub-path of a canvas, using a center point and radius.</p>
0860      * <p>The first five arguments to this method specify a start point and an end point 
0861      * on the circumference of a circle. Invoking this method adds a straight line 
0862      * between the current point and the start point to the current sub-path. Next it 
0863      * adds the arc along the circumference of the circle between the start and end 
0864      * points to the sub-path. The final argument specifies the direction in which the 
0865      * circle should be traversed to connect the start and end points. This method 
0866      * leaves the current point set to the end point of the arc.</p>
0867      * @param x The X coordinate of the center of the circle describing the arc.
0868      * @param y The Y coordinate of the center of the circle describing the arc.
0869      * @param r The radius of the circle that defines the arc.
0870      * @param a1 Specifies the start point of the arc along the circle. The angles is 
0871      * measured in radians. The three o'clock position along the positive X axis is an 
0872      * angle of 0, and angles increase in the clockwise direction.
0873      * @param a2 Specifies the end point of the arc along the circle. The angle is 
0874      * measured in radians. The three o'clock position along the positive X axis is an 
0875      * angle of 0, and angles increase in the clockwise direction.
0876      * @param c Whether the arc is traversed counterclockwise (<tt>true</tt>) 
0877      * or clockwise (<tt>false</tt>) along the circle's circumference.
0878      * @since 1.0
0879      * @see #arcTo(Number, Number, Number, Number, Number)
0880      * @see #beginPath()
0881      * @see #closePath()
0882      * @javascript Re-compilers must convert the instance invocation of this method directly
0883      * into a JavaScript invocation on its current object instance without changing the 
0884      * method name, but expanding variable arguments, if any, into comma-separated values. 
0885      */
0886     public final void arc(Number x, Number y, Number r, Number a1, Number a2, Boolean c) {
0887         call(arc, new Vars<Object>().add(x).add(y).add(r).add(a1).add(a2).add(c));
0888     }
0889     /**
0890      * <p>Adds an arc to the current sub-path, using tangent points and a radius.</p>
0891      * <p>This method adds an arc to the current sub-path but describes that arc much 
0892      * differently than the {@link #arc(Number, Number, Number, Number, Number, Boolean)} 
0893      * method does. The arc that is added to the path by this method is a portion of a 
0894      * circle with the specified radius. The arc has one point tangent to the line from 
0895      * the current position to the point <tt>(x1, y1)</tt> and one point that is tangent 
0896      * to the line from the point <tt>(x1, y1)</tt> to the point <tt>(x2, y2)</tt>. The 
0897      * arc begins and ends at these two tangent points and is drawn in the direction 
0898      * that connects those two points with the shortest arc.</p>
0899      * <p>In many common uses, the arc begins at the current position and ends at 
0900      * the point <tt>(x2, y2)</tt>, but this is not always the case. If the current 
0901      * position is not the same as the starting point of the arc, this method adds a 
0902      * straight line from the current position to the start position of the arc. This 
0903      * method always leaves the current position set to the end point of the arc.</p>
0904      * @param x1 The X coordinate of the control point associated with the arc's start point.
0905      * @param y1 The Y coordinate of the control point associated with the arc's start point.
0906      * @param x2 The X coordinate of the control point associated with the arc's end point.
0907      * @param y2 The Y coordinate of the control point associated with the arc's end point.
0908      * @param r The radius of the circle that defines the arc.
0909      * @since 1.0
0910      * @see #arc(Number, Number, Number, Number, Number, Boolean)
0911      * @javascript Re-compilers must convert the instance invocation of this method directly
0912      * into a JavaScript invocation on its current object instance without changing the 
0913      * method name, but expanding variable arguments, if any, into comma-separated values. 
0914      */
0915     public final void arcTo(Number x1, Number y1, Number x2, Number y2, Number r) {
0916         call(arcTo, new Vars<Object>().add(x1).add(y1).add(x2).add(y2).add(r));
0917     }
0918     /**
0919      * <p>Starts a new path (or a collection of sub-paths) in a canvas.</p>
0920      * <p>This method discards any currently defined path and begins a new one. It sets 
0921      * the current point to (0,0).</p>
0922      * <p>When the context for a canvas is first created, this method is implicitly 
0923      * called.</p>
0924      * @since 1.0
0925      * @see #closePath()
0926      * @see #fill()
0927      * @see #stroke()
0928      * @javascript Re-compilers must convert the instance invocation of this method directly
0929      * into a JavaScript invocation on its current object instance without changing the 
0930      * method name, but expanding variable arguments, if any, into comma-separated values. 
0931      */
0932     public final void beginPath() {
0933         call(beginPath);
0934     }
0935     /**
0936      * <p>Adds a cubic Bézier curve to the current sub-path.</p>
0937      * <p>The start point of the curve is the current point of the canvas, and the end 
0938      * point is <tt>(x,y)</tt>. The two Bezier control points <tt>(x1, y1)</tt> and 
0939      * <tt>(x2, y2)</tt> define the shape of the curve. When this method returns, the 
0940      * current position is <tt>(x,y)</tt>.</p>
0941      * @param x1 The X coordinate of the control point associated with the curve's 
0942      * start point (the current position).
0943      * @param y1 The Y coordinate of the control point associated with the curve's 
0944      * start point (the current position).
0945      * @param x2 The X coordinate of the control point associated with the curve's end point.
0946      * @param y2 The Y coordinate of the control point associated with the curve's end point.
0947      * @param x The X coordinate of the curve's end point.
0948      * @param y The Y coordinate of the curve's end point.
0949      * @since 1.0
0950      * @see #quadraticCurveTo(Number, Number, Number, Number)
0951      * @javascript Re-compilers must convert the instance invocation of this method directly
0952      * into a JavaScript invocation on its current object instance without changing the 
0953      * method name, but expanding variable arguments, if any, into comma-separated values. 
0954      */
0955     public final void bezierCurveTo(Number x1, Number y1, Number x2, Number y2, Number x, Number y) {
0956         call(bezierCurveTo, new Vars<Object>().add(x1).add(y1).add(x2).add(y2).add(x).add(y));
0957     }
0958     /**
0959      * <p>Erases the pixels in a rectangular area of a canvas.</p>
0960      * <p>This method erases the specified rectangle, filling it with a transparent color.</p>
0961      * @param x The X coordinate of the upper-left corner of the rectangle.
0962      * @param y The Y coordinate of the upper-left corner of the rectangle.
0963      * @param w The X dimension of the rectangle.
0964      * @param h The Y dimension of the rectangle.
0965      * @since 1.0
0966      * @javascript Re-compilers must convert the instance invocation of this method directly
0967      * into a JavaScript invocation on its current object instance without changing the 
0968      * method name, but expanding variable arguments, if any, into comma-separated values. 
0969      */
0970     public final void clearRect(Number x, Number y, Number w, Number h) {
0971         call(clearRect, new Vars<Object>().add(x).add(y).add(w).add(h));
0972     }
0973     /**
0974      * <p>Uses the current path as the clipping region for subsequent drawing operations.</p>
0975      * <p>This method clips the current path using the current clipping path and then 
0976      * uses the clipped path as the new clipping path. Note that there is no way to 
0977      * enlarge the clipping path. If you want a temporary clipping path, you should 
0978      * first call {@link #save()} in order to use {@link #restore()} to restore the 
0979      * original clipping path. The default clipping path for a canvas is the canvas 
0980      * rectangle itself.</p>
0981      * <p>This method resets the current path so that it is empty.</p>
0982      * @since 1.0
0983      * @javascript Re-compilers must convert the instance invocation of this method directly
0984      * into a JavaScript invocation on its current object instance without changing the 
0985      * method name, but expanding variable arguments, if any, into comma-separated values. 
0986      */
0987     public final void clip() {
0988         call(clip);
0989     }
0990     /**
0991      * <p>Closes the current sub-path if it's open.</p>
0992      * <p>If the current sub-path of the canvas is open, this method closes it by adding 
0993      * a line connecting the current point to the sub-path's starting point. If the 
0994      * sub-path is already closed, this method does nothing. Once a sub-path is closed, 
0995      * no more lines or curves can be added to it. To continue adding to the path, 
0996      * you must begin a new sub-path by calling {@link #moveTo(Number, Number)}.</p>
0997      * <p>You do not need to call {@link #closePath()} before stroking or filling a path. 
0998      * Paths are implicitly closed when filled (and also when you call {@link #clip()}).</p>
0999      * @since 1.0
1000      * @see #beginPath()
1001      * @see #moveTo(Number, Number)
1002      * @see #stroke()
1003      * @see #fill()
1004      * @javascript Re-compilers must convert the instance invocation of this method directly
1005      * into a JavaScript invocation on its current object instance without changing the 
1006      * method name, but expanding variable arguments, if any, into comma-separated values. 
1007      */
1008     public final void closePath() {
1009         call(closePath);
1010     }
1011     /**
1012      * <p>Returns a {@link JsCanvasGradient} object that represents a linear color 
1013      * gradient.</p>
1014      * <p>This method creates and returns a new {@link JsCanvasGradient} object that 
1015      * linearly interpolates colors between the specified start point and end point. 
1016      * Note that this method does not specify any colors for the gradient. Use the 
1017      * {@link JsCanvasGradient#addColorStop(Number, String)} method of the returned 
1018      * object to do that. To stroke lines or fill areas using a gradient, assign a 
1019      * {@link JsCanvasGradient} object to the {@link #strokeStyle} or {@link #fillStyle} 
1020      * properties.</p>
1021      * @param x1 The X coordinate of the gradient's start point.
1022      * @param y1 The Y coordinate of the gradient's start point.
1023      * @param x2 The X coordinate of the gradient's end point.
1024      * @param y2 The Y coordinate of the gradient's end point.
1025      * @return A {@link JsCanvasGradient} object representing the linear color gradient.
1026      * @since 1.0
1027      * @see #createRadialGradient(Number, Number, Number, Number, Number, Number)
1028      * @javascript Re-compilers must convert the instance invocation of this method directly
1029      * into a JavaScript invocation on its current object instance without changing the 
1030      * method name, but expanding variable arguments, if any, into comma-separated values. 
1031      */
1032     public final JsCanvasGradient createLinearGradient(Number x1, Number y1, Number x2, Number y2) {
1033         return new JsCanvasGradient(call(createLinearGradient, new Vars<Object>().add(x1).add(y1).add(x2).add(y2)));
1034     }
1035     /**
1036      * <p>Returns a {@link JsCanvasGradient} object that represents a radial color 
1037      * gradient.</p>
1038      * <p>This method creates and returns a new {@link JsCanvasGradient} object that 
1039      * radially interpolates colors between the circumferences of the two specified 
1040      * circles. Note that this method does not specify any colors for the gradient. 
1041      * Use the {@link JsCanvasGradient#addColorStop(Number, String)} method of the 
1042      * returned object to do that. To stroke lines or fill areas using a gradient, 
1043      * assign a {@link JsCanvasGradient} object to the {@link #strokeStyle} or 
1044      * {@link #fillStyle} properties.</p>
1045      * @param x1 The X coordinate of the center of the starting circle.
1046      * @param y1 The Y coordinate of the center of the starting circle.
1047      * @param r1 The radius of the starting circle.
1048      * @param x2 The X coordinate of the center of the ending circle.
1049      * @param y2 The Y coordinate of the center of the starting circle.
1050      * @param r2 The radius of the ending circle.
1051      * @return A {@link JsCanvasGradient} object representing the radial color gradient.
1052      * @since 1.0
1053      * @see #createLinearGradient(Number, Number, Number, Number)
1054      * @javascript Re-compilers must convert the instance invocation of this method directly
1055      * into a JavaScript invocation on its current object instance without changing the 
1056      * method name, but expanding variable arguments, if any, into comma-separated values. 
1057      */
1058     public final JsCanvasGradient createRadialGradient(Number x1, Number y1, Number r1, Number x2, Number y2, Number r2) {
1059         return new JsCanvasGradient(call(createRadialGradient, new Vars<Object>().add(x1).add(y1).add(r1).add(x2).add(y2).add(r2)));
1060     }
1061     /**
1062      * <p>Returns a {@link JsCanvasPattern} object that represents a tiled image.</p>
1063      * <p>This method creates and returns a new {@link JsCanvasPattern} object that 
1064      * represents the pattern defined by a tiled image. To use a pattern for stroking 
1065      * lines or filling areas, use a {@link JsCanvasPattern} object as the value of the 
1066      * {@link #strokeStyle} or {@link #fillStyle} properties.</p>
1067      * @param image The image to be tiled. This argument is typically 
1068      * {@link JsHTMLImageElement} object, but you may also use a {@link JsHTMLCanvasElement} 
1069      * element (see {@link #createPattern(JsHTMLCanvasElement, String)}).
1070      * @param repeat Specifies how the image is tiled. The possible values are the following:
1071      * <ul>
1072      * <li>"repeat": Tile the image in both directions. This is the default.</li>
1073      * <li>"repeat-x": Tile the image in the X dimension only.</li>
1074      * <li>"repeat-y": Tile the image in the Y dimension only.</li>
1075      * <li>"no-repeat": Do not tile the image; use it a single time only.</li>
1076      * </ul>
1077      * @return A {@link JsCanvasPattern} object representing the pattern.
1078      * @since 1.0
1079      * @see #createPattern(JsHTMLCanvasElement, String)
1080      * @javascript Re-compilers must convert the instance invocation of this method directly
1081      * into a JavaScript invocation on its current object instance without changing the 
1082      * method name, but expanding variable arguments, if any, into comma-separated values. 
1083      */
1084     public final JsCanvasPattern createPattern(JsHTMLImageElement image, String repeat) {
1085         return new JsCanvasPattern(call(createPattern, new Vars<Object>().add(image).add(repeat)));
1086     }
1087     /**
1088      * <p>Returns a {@link JsCanvasPattern} object that represents a tiled image.</p>
1089      * <p>This method creates and returns a new {@link JsCanvasPattern} object that 
1090      * represents the pattern defined by a tiled image. To use a pattern for stroking 
1091      * lines or filling areas, use a {@link JsCanvasPattern} object as the value of the 
1092      * {@link #strokeStyle} or {@link #fillStyle} properties.</p>
1093      * @param image The image to be tiled. Note that this argument is typically a 
1094      * {@link JsHTMLImageElement} object (see {@link #createPattern(JsHTMLImageElement, String)}).
1095      * @param repeat Specifies how the image is tiled. The possible values are the following:
1096      * <ul>
1097      * <li>"repeat": Tile the image in both directions. This is the default.</li>
1098      * <li>"repeat-x": Tile the image in the X dimension only.</li>
1099      * <li>"repeat-y": Tile the image in the Y dimension only.</li>
1100      * <li>"no-repeat": Do not tile the image; use it a single time only.</li>
1101      * </ul>
1102      * @return A {@link JsCanvasPattern} object representing the pattern.
1103      * @see #createPattern(JsHTMLImageElement, String)
1104      * @since 1.0
1105      * @javascript Re-compilers must convert the instance invocation of this method directly
1106      * into a JavaScript invocation on its current object instance without changing the 
1107      * method name, but expanding variable arguments, if any, into comma-separated values. 
1108      */
1109     public final JsCanvasPattern createPattern(JsHTMLCanvasElement image, String repeat) {
1110         return new JsCanvasPattern(call(createPattern, new Vars<Object>().add(image).add(repeat)));
1111     }
1112     /**
1113      * <p>Draws an image.</p>
1114      * <p>This method copies the entire image to the canvas, placing its upper-left 
1115      * corner at the specified point and mapping each image pixel to one unit in the 
1116      * canvas coordinate system.</p>
1117      * @param image The image to be drawn. This argument may also be a 
1118      * {@link JsHTMLCanvasElement} object.
1119      * @param x The X coordinate of the point at which the upper-left corner of the 
1120      * image is drawn.
1121      * @param y The Y coordinate of the point at which the upper-left corner of the 
1122      * image is drawn.
1123      * @see #drawImage(JsHTMLCanvasElement, Number, Number)
1124      * @see #drawImage(JsHTMLImageElement, Number, Number, Number, Number)
1125      * @see #drawImage(JsHTMLImageElement, Number, Number, Number, Number, Number, Number, Number, Number)
1126      * @since 1.0
1127      * @javascript Re-compilers must convert the instance invocation of this method directly
1128      * into a JavaScript invocation on its current object instance without changing the 
1129      * method name, but expanding variable arguments, if any, into comma-separated values. 
1130      */
1131     public final void drawImage(JsHTMLImageElement image, Number x, Number y) {
1132         call(drawImage, new Vars<Object>().add(image).add(x).add(y));
1133     }
1134     /**
1135      * <p>Draws an image.</p>
1136      * <p>This method copies the entire image to the canvas and allows you to specify 
1137      * the desired width and height of the image in canvas units.</p>
1138      * @param image The image to be drawn. This argument may also be an 
1139      * {@link JsHTMLCanvasElement} object.
1140      * @param x The X coordinate of the point at which the upper-left corner of the 
1141      * image is drawn.
1142      * @param y The Y coordinate of the point at which the upper-left corner of the 
1143      * image is drawn.
1144      * @param w The width at which the image should be drawn. Specifying this argument 
1145      * causes the image to be scaled.
1146      * @param h The height at which the image should be drawn. Specifying this argument 
1147      * causes the image to be scaled.
1148      * @see #drawImage(JsHTMLCanvasElement, Number, Number, Number, Number)
1149      * @see #drawImage(JsHTMLImageElement, Number, Number)
1150      * @see #drawImage(JsHTMLImageElement, Number, Number, Number, Number, Number, Number, Number, Number)
1151      * @since 1.0
1152      * @javascript Re-compilers must convert the instance invocation of this method directly
1153      * into a JavaScript invocation on its current object instance without changing the 
1154      * method name, but expanding variable arguments, if any, into comma-separated values. 
1155      */
1156     public final void drawImage(
1157             JsHTMLImageElement image, Number x, Number y, Number w, Number h) {
1158         call(drawImage, new Vars<Object>().add(image).add(x).add(y).add(w).add(h));
1159     }
1160     /**
1161      * <p>Draws an image.</p>
1162      * <p>This method allows you to specify any rectangular region of the image and 
1163      * copy it, with arbitrary scaling to any position within the canvas.</p>
1164      * @param image The image to be drawn. This argument may also be an 
1165      * {@link JsHTMLCanvasElement} object.
1166      * @param x1 The X coordinate of the upper-left corner of the region of the image 
1167      * that is to be drawn. This argument must be an integer measured in image pixels.
1168      * @param y1 The X coordinate of the upper-left corner of the region of the image 
1169      * that is to be drawn. This argument must be an integer measured in image pixels.
1170      * @param w1 The X dimension, in image pixels, of the region of the image that is 
1171      * to be drawn.
1172      * @param h1 The Y dimension, in image pixels, of the region of the image that is 
1173      * to be drawn.
1174      * @param x2 The canvas X coordinate at which the upper-left corner of the image 
1175      * region is to be drawn.
1176      * @param y2 The canvas Y coordinate at which the upper-left corner of the image 
1177      * region is to be drawn.
1178      * @param w2 The canvas X dimension at which the image region should be drawn.
1179      * @param h2 The canvas Y dimension at which the image region should be drawn.
1180      * @see #drawImage(JsHTMLCanvasElement, Number, Number, Number, Number, Number, Number, Number, Number)
1181      * @see #drawImage(JsHTMLImageElement, Number, Number)
1182      * @see #drawImage(JsHTMLImageElement, Number, Number, Number, Number)
1183      * @since 1.0
1184      * @javascript Re-compilers must convert the instance invocation of this method directly
1185      * into a JavaScript invocation on its current object instance without changing the 
1186      * method name, but expanding variable arguments, if any, into comma-separated values. 
1187      */
1188     public final void drawImage(JsHTMLImageElement image, 
1189             Number x1, Number y1, Number w1, Number h1,
1190             Number x2, Number y2, Number w2, Number h2) {
1191         call(drawImage, new Vars<Object>().add(image)
1192                 .add(x1).add(y1).add(w1).add(h1)
1193                 .add(x2).add(y2).add(w2).add(h2));
1194     }
1195     /**
1196      * <p>Draws an image.</p>
1197      * <p>This method copies the entire image to the canvas, placing its upper-left 
1198      * corner at the specified point and mapping each image pixel to one unit in the 
1199      * canvas coordinate system.</p>
1200      * @param image The image to be drawn. This argument may also be an {@link JsHTMLImageElement} 
1201      * object representing an <tt>&lt;img&gt;</tt> tag, or an offscreen image.
1202      * @param x The X coordinate of the point at which the upper-left corner of the 
1203      * image is drawn.
1204      * @param y The Y coordinate of the point at which the upper-left corner of the 
1205      * image is drawn.
1206      * @see #drawImage(JsHTMLImageElement, Number, Number)
1207      * @see #drawImage(JsHTMLCanvasElement, Number, Number, Number, Number)
1208      * @see #drawImage(JsHTMLCanvasElement, Number, Number, Number, Number, Number, Number, Number, Number)
1209      * @since 1.0
1210      * @javascript Re-compilers must convert the instance invocation of this method directly
1211      * into a JavaScript invocation on its current object instance without changing the 
1212      * method name, but expanding variable arguments, if any, into comma-separated values. 
1213      */
1214     public final void drawImage(JsHTMLCanvasElement image, Number x, Number y) {
1215         call(drawImage, new Vars<Object>().add(image).add(x).add(y));
1216     }
1217     /**
1218      * <p>Draws an image.</p>
1219      * <p>This method copies the entire image to the canvas and allows you to specify 
1220      * the desired width and height of the image in canvas units.</p>
1221      * @param image The image to be drawn. This argument may also be an {@link JsHTMLImageElement} 
1222      * object representing an <tt>&lt;img&gt;</tt> tag, or an offscreen image.
1223      * @param x The X coordinate of the point at which the upper-left corner of the 
1224      * image is drawn.
1225      * @param y The Y coordinate of the point at which the upper-left corner of the 
1226      * image is drawn.
1227      * @param w The width at which the image should be drawn. Specifying this argument 
1228      * causes the image to be scaled.
1229      * @param h The height at which the image should be drawn. Specifying this argument 
1230      * causes the image to be scaled.
1231      * @see #drawImage(JsHTMLImageElement, Number, Number, Number, Number)
1232      * @see #drawImage(JsHTMLCanvasElement, Number, Number)
1233      * @see #drawImage(JsHTMLCanvasElement, Number, Number, Number, Number, Number, Number, Number, Number)
1234      * @since 1.0
1235      * @javascript Re-compilers must convert the instance invocation of this method directly
1236      * into a JavaScript invocation on its current object instance without changing the 
1237      * method name, but expanding variable arguments, if any, into comma-separated values. 
1238      */
1239     public final void drawImage(
1240             JsHTMLCanvasElement image, Number x, Number y, Number w, Number h) {
1241         call(drawImage, new Vars<Object>().add(image).add(x).add(y).add(w).add(h));
1242     }
1243     /**
1244      * <p>Draws an image.</p>
1245      * <p>This method allows you to specify any rectangular region of the image and 
1246      * copy it, with arbitrary scaling to any position within the canvas.</p>
1247      * @param image The image to be drawn. This argument may also be an {@link JsHTMLImageElement} 
1248      * object representing an <tt>&lt;img&gt;</tt> tag, or an offscreen image.
1249      * @param x1 The X coordinate of the upper-left corner of the region of the image 
1250      * that is to be drawn. This argument must be an integer measured in image pixels.
1251      * @param y1 The X coordinate of the upper-left corner of the region of the image 
1252      * that is to be drawn. This argument must be an integer measured in image pixels.
1253      * @param w1 The X dimension, in image pixels, of the region of the image that is 
1254      * to be drawn.
1255      * @param h1 The Y dimension, in image pixels, of the region of the image that is 
1256      * to be drawn.
1257      * @param x2 The canvas X coordinate at which the upper-left corner of the image 
1258      * region is to be drawn.
1259      * @param y2 The canvas Y coordinate at which the upper-left corner of the image 
1260      * region is to be drawn.
1261      * @param w2 The canvas X dimension at which the image region should be drawn.
1262      * @param h2 The canvas Y dimension at which the image region should be drawn.
1263      * @see #drawImage(JsHTMLImageElement, Number, Number, Number, Number, Number, Number, Number, Number)
1264      * @see #drawImage(JsHTMLCanvasElement, Number, Number)
1265      * @see #drawImage(JsHTMLCanvasElement, Number, Number, Number, Number)
1266      * @since 1.0
1267      * @javascript Re-compilers must convert the instance invocation of this method directly
1268      * into a JavaScript invocation on its current object instance without changing the 
1269      * method name, but expanding variable arguments, if any, into comma-separated values. 
1270      */
1271     public final void drawImage(JsHTMLCanvasElement image, 
1272             Number x1, Number y1, Number w1, Number h1,
1273             Number x2, Number y2, Number w2, Number h2) {
1274         call(drawImage, new Vars<Object>().add(image)
1275                 .add(x1).add(y1).add(w1).add(h1)
1276                 .add(x2).add(y2).add(w2).add(h2));
1277     }
1278     /**
1279      * <p>Fills the interior of the current path with the color, gradient, or pattern 
1280      * specified by the {@link #fillStyle} property.</p>
1281      * @since 1.0
1282      * @see #fillRect(Number, Number, Number, Number)
1283      * @javascript Re-compilers must convert the instance invocation of this method directly
1284      * into a JavaScript invocation on its current object instance without changing the 
1285      * method name, but expanding variable arguments, if any, into comma-separated values. 
1286      */
1287     public final void fill() {
1288         call(fill);
1289     }
1290     /**
1291      * <p>Paints or fills a rectangle.</p>
1292      * <p>This method fills the specified rectangle with the color, gradient, or pattern 
1293      * specified by the {@link #fillStyle} property.</p>
1294      * <p>Current implementations of this method also clear the path as if 
1295      * {@link #beginPath()} had been called. This surprising behavior may not be 
1296      * standardized and should not be relied on.</p>
1297      * @param x The X coordinate of the upper-left corner of the rectangle.
1298      * @param y The Y coordinate of the upper-left corner of the rectangle.
1299      * @param w The X dimension of the rectangle.
1300      * @param h The Y dimension of the rectangle.
1301      * @since 1.0
1302      * @see #fill()
1303      * @see #rect(Number, Number, Number, Number)
1304      * @see #strokeRect(Number, Number, Number, Number)
1305      * @javascript Re-compilers must convert the instance invocation of this method directly
1306      * into a JavaScript invocation on its current object instance without changing the 
1307      * method name, but expanding variable arguments, if any, into comma-separated values. 
1308      */
1309     public final void fillRect(Number x, Number y, Number w, Number h) {
1310         call(fillRect, new Vars<Object>().add(x).add(y).add(w).add(h));
1311     }
1312     /**
1313      * <p>Adds a straight line segment to the current sub-path.</p>
1314      * <p>This method adds a straight line to the current sub-path. The line begins at 
1315      * the current point and ends at <tt>(x,y)</tt>.</p>
1316      * <p>When this method returns, the current position is <tt>(x,y)</tt>.</p>
1317      * @param x The X coordinate of the end point of the line.
1318      * @param y The Y coordinate of the end point of the line.
1319      * @since 1.0
1320      * @see #beginPath()
1321      * @see #moveTo(Number, Number)
1322      * @javascript Re-compilers must convert the instance invocation of this method directly
1323      * into a JavaScript invocation on its current object instance without changing the 
1324      * method name, but expanding variable arguments, if any, into comma-separated values. 
1325      */
1326     public final void lineTo(Number x, Number y) {
1327         call(lineTo, new Vars<Object>().add(x).add(y));
1328     }
1329     /**
1330      * <p>Sets the current position and begins a new sub-path.</p>
1331      * <p>This method sets the current position to <tt>(x,y)</tt> and creates a new 
1332      * sub-path with this as its first point. If there was a previous sub-path and it 
1333      * consisted of just one point, that sub-path is removed from the path.</p>
1334      * @param x The X coordinate of the new current point.
1335      * @param y The Y coordinate of the new current point.
1336      * @since 1.0
1337      * @see #beginPath()
1338      * @javascript Re-compilers must convert the instance invocation of this method directly
1339      * into a JavaScript invocation on its current object instance without changing the 
1340      * method name, but expanding variable arguments, if any, into comma-separated values. 
1341      */
1342     public final void moveTo(Number x, Number y) {
1343         call(moveTo, new Vars<Object>().add(x).add(y));
1344     }
1345     /**
1346      * <p>Adds a quadratic Bézier curve to the current sub-path.</p>
1347      * <p>This method adds a quadratic Bézier curve segment to the current sub-path. 
1348      * The curve starts at the current point and ends at <tt>(x,y)</tt>. The control 
1349      * point <tt>(cx, cy)</tt> specifies the shape of the curve between these two points.</p>
1350      * <p>When this method returns, the current position is <tt>(x,y)</tt>.</p>
1351      * @param cx The X coordinate of the control point.
1352      * @param cy The Y coordinate of the control point.
1353      * @param x The X coordinate of the end point.
1354      * @param y The Y coordinate of the end point.
1355      * @since 1.0
1356      * @see #bezierCurveTo(Number, Number, Number, Number, Number, Number)
1357      * @javascript Re-compilers must convert the instance invocation of this method directly
1358      * into a JavaScript invocation on its current object instance without changing the 
1359      * method name, but expanding variable arguments, if any, into comma-separated values. 
1360      */
1361     public final void quadraticCurveTo(Number cx, Number cy, Number x, Number y) {
1362         call(quadraticCurveTo, new Vars<Object>().add(cx).add(cy).add(x).add(y));
1363     }
1364     /**
1365      * <p>Adds a rectangle sub-path to the current path.</p>
1366      * <p>This method adds a rectangle to the path. This rectangle is in a sub-path of 
1367      * its own and is not connected to any other sub-paths in the path.</p>
1368      * <p>When this method returns, the current position is (0,0).</p>
1369      * @param x The X coordinate of the upper-left corner of the rectangle.
1370      * @param y The Y coordinate of the upper-left corner of the rectangle.
1371      * @param w The X dimension of the rectangle.
1372      * @param h The Y dimension of the rectangle.
1373      * @since 1.0
1374      * @see #fillRect(Number, Number, Number, Number)
1375      * @see #strokeRect(Number, Number, Number, Number)
1376      * @javascript Re-compilers must convert the instance invocation of this method directly
1377      * into a JavaScript invocation on its current object instance without changing the 
1378      * method name, but expanding variable arguments, if any, into comma-separated values. 
1379      */
1380     public final void rect(Number x, Number y, Number w, Number h) {
1381         call(rect, new Vars<Object>().add(x).add(y).add(w).add(h));
1382     }
1383     /**
1384      * <p>Resets the canvas to the graphics state most recently saved.</p>
1385      * <p>This method pops the stack of saved graphics states and restores the values of 
1386      * the {@link JsCanvasRenderingContext2D} properties, the clipping path, and the 
1387      * transformation matrix.</p>
1388      * @since 1.0
1389      * @see #save()
1390      * @javascript Re-compilers must convert the instance invocation of this method directly
1391      * into a JavaScript invocation on its current object instance without changing the 
1392      * method name, but expanding variable arguments, if any, into comma-separated values. 
1393      */
1394     public final void restore() {
1395         call(restore);
1396     }
1397     /**
1398      * <p>Rotates the canvas.</p>
1399      * <p>This method alters the mapping between canvas coordinates and the pixels of 
1400      * the <tt>&lt;canvas&gt;</tt> element in the web browser so that any subsequent 
1401      * drawing appears rotated within the canvas by the specified angle. It does not 
1402      * rotate the <tt>&lt;canvas&gt;</tt> element itself.</p>
1403      * <p>Note that the angle is specified in radians. To convert degrees to radians, 
1404      * multiply by {@link js.MathLike#PI} and divide by 180.</p>
1405      * @param a The amount of rotation, in radians. Positive values result in clockwise 
1406      * rotation, and negative values result in counterclockwise rotation.
1407      * @since 1.0
1408      * @see #rotate(NumberLike)
1409      * @see #scale(Number, Number)
1410      * @see #translate(Number, Number)
1411      * @javascript Re-compilers must convert the instance invocation of this method directly
1412      * into a JavaScript invocation on its current object instance without changing the 
1413      * method name, but expanding variable arguments, if any, into comma-separated values. 
1414      */
1415     public final void rotate(Number a) {
1416         call(rotate, a);
1417     }
1418     /**
1419      * <p>Rotates the canvas.</p>
1420      * <p>This method alters the mapping between canvas coordinates and the pixels of 
1421      * the <tt>&lt;canvas&gt;</tt> element in the web browser so that any subsequent 
1422      * drawing appears rotated within the canvas by the specified angle. It does not 
1423      * rotate the <tt>&lt;canvas&gt;</tt> element itself.</p>
1424      * <p>Note that the angle is specified in radians. To convert degrees to radians, 
1425      * multiply by {@link js.MathLike#PI} and divide by 180.</p>
1426      * @param a The amount of rotation, in radians. Positive values result in clockwise 
1427      * rotation, and negative values result in counterclockwise rotation.
1428      * @since 1.0
1429      * @see #rotate(Number)
1430      * @see #scale(Number, Number)
1431      * @see #translate(Number, Number)
1432      * @javascript Re-compilers must convert the instance invocation of this method directly
1433      * into a JavaScript invocation on its current object instance without changing the 
1434      * method name, but expanding variable arguments, if any, into comma-separated values. 
1435      */
1436     public final void rotate(NumberLike<?> a) {
1437         rotate(Js.valueOf(a));
1438     }
1439     /**
1440      * <p>Saves the properties, clipping region, and transformation matrix of the 
1441      * {@link JsCanvasRenderingContext2D} object.</p>
1442      * @since 1.0
1443      * @see #restore()
1444      * @javascript Re-compilers must convert the instance invocation of this method directly
1445      * into a JavaScript invocation on its current object instance without changing the 
1446      * method name, but expanding variable arguments, if any, into comma-separated values. 
1447      */
1448     public final void save() {
1449         call(save);
1450     }
1451     /**
1452      * <p>Scales the user coordinate system of the canvas.</p>
1453      * <p>This method adds a scale transformation to the current transformation matrix 
1454      * of the canvas. Scaling is done with independent horizontal and vertical scaling 
1455      * factors.</p>
1456      * <p>Specifying a negative value for <tt>sx</tt> causes X coordinates to be flipped 
1457      * across the Y axis, and a negative value of <tt>sy</tt> causes Y coordinates to 
1458      * be flipped across the X axis.</p>
1459      * @param sx The horizontal scaling factor.
1460      * @param sy The vertical scaling factor.
1461      * @since 1.0
1462      * @see #rotate(Number)
1463      * @see #rotate(NumberLike)
1464      * @see #translate(Number, Number)
1465      * @javascript Re-compilers must convert the instance invocation of this method directly
1466      * into a JavaScript invocation on its current object instance without changing the 
1467      * method name, but expanding variable arguments, if any, into comma-separated values. 
1468      */
1469     public final void scale(Number sx, Number sy) {
1470         call(scale, new Vars<Object>().add(sx).add(sy));
1471     }
1472     /**
1473      * <p>Draws, or strokes, a line following the current path.</p>
1474      * <p>The line is drawn according to the {@link #lineWidth}, {@link #lineJoin}, 
1475      * {@link #lineCap}, and {@link #strokeStyle} properties, among others.</p>
1476      * @since 1.0
1477      * @see #fill()
1478      * @see #strokeRect(Number, Number, Number, Number)
1479      * @javascript Re-compilers must convert the instance invocation of this method directly
1480      * into a JavaScript invocation on its current object instance without changing the 
1481      * method name, but expanding variable arguments, if any, into comma-separated values. 
1482      */
1483     public final void stroke() {
1484         call(stroke);
1485     }
1486     /**
1487      * <p>Draws a rectangle without filling it.</p>
1488      * <p>This method draws the outline, but does not fill the interior, of a rectangle 
1489      * with the specified position and size. Line color and line width are specified by 
1490      * the {@link #strokeStyle} and {@link #lineWidth} properties. The appearance of the 
1491      * rectangle corners are specified by the {@link #lineJoin} property.</p>
1492      * <p>Current implementations of this method clear the path as if {@link #beginPath()} 
1493      * had been called. This surprising behavior may not be standardized and should not 
1494      * be relied on.</p>
1495      * @param x The X coordinate of the upper-left corner of the rectangle.
1496      * @param y The Y coordinate of the upper-left corner of the rectangle.
1497      * @param w The X dimension of the rectangle.
1498      * @param h The Y dimension of the rectangle.
1499      * @since 1.0
1500      * @see #fillRect(Number, Number, Number, Number)
1501      * @see #rect(Number, Number, Number, Number)
1502      * @see #stroke()
1503      * @javascript Re-compilers must convert the instance invocation of this method directly
1504      * into a JavaScript invocation on its current object instance without changing the 
1505      * method name, but expanding variable arguments, if any, into comma-separated values. 
1506      */
1507     public final void strokeRect(Number x, Number y, Number w, Number h) {
1508         call(strokeRect, new Vars<Object>().add(x).add(y).add(w).add(h));
1509     }
1510     /**
1511      * <p>Translates the user coordinate system of the canvas.</p>
1512      * <p>This method adds horizontal and vertical offsets to the transformation matrix 
1513      * of the canvas. The arguments <tt>dx</tt> and <tt>dy</tt> are added to all points 
1514      * in any subsequently defined paths.</p>
1515      * @param dx The amount to translate in the X dimension.
1516      * @param dy The amount to translate in the Y dimension.
1517      * @since 1.0
1518      * @see #rotate(Number)
1519      * @see #rotate(NumberLike)
1520      * @see #scale(Number, Number)
1521      * @javascript Re-compilers must convert the instance invocation of this method directly
1522      * into a JavaScript invocation on its current object instance without changing the 
1523      * method name, but expanding variable arguments, if any, into comma-separated values. 
1524      */
1525     public final void translate(Number dx, Number dy) {
1526         call(translate, new Vars<Object>().add(dx).add(dy));
1527     }
1528 }