javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/HTML5GraphicsContext.java
author toni.epple@eppleton.de
Fri, 17 May 2013 12:06:55 +0200
branchcanvas
changeset 1112 024b165f8f21
parent 1111 javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java@8c88d0f187d8
child 1117 848b2cc261e6
permissions -rw-r--r--
Extracting interfaces from JavaQuery API. Removed first (automatic) refactoring attempt and redid it manually.
toni@1111
     1
/**
toni@1111
     2
 * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
toni@1111
     3
 * <jaroslav.tulach@apidesign.org>
toni@1111
     4
 *
toni@1111
     5
 * This program is free software: you can redistribute it and/or modify it under
toni@1111
     6
 * the terms of the GNU General Public License as published by the Free Software
toni@1111
     7
 * Foundation, version 2 of the License.
toni@1111
     8
 *
toni@1111
     9
 * This program is distributed in the hope that it will be useful, but WITHOUT
toni@1111
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
toni@1111
    11
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
toni@1111
    12
 * details.
toni@1111
    13
 *
toni@1111
    14
 * You should have received a copy of the GNU General Public License along with
toni@1111
    15
 * this program. Look for COPYING file in the top folder. If not, see
toni@1111
    16
 * http://opensource.org/licenses/GPL-2.0.
toni@521
    17
 */
toni@1112
    18
package org.apidesign.bck2brwsr.htmlpage.api;
toni@521
    19
toni@1112
    20
import net.java.html.canvas.GraphicsContext;
toni@1112
    21
import net.java.html.canvas.Image;
toni@1112
    22
import net.java.html.canvas.ImageData;
toni@1112
    23
import net.java.html.canvas.LinearGradient;
toni@1112
    24
import net.java.html.canvas.Pattern;
toni@1112
    25
import net.java.html.canvas.RadialGradient;
toni@1112
    26
import net.java.html.canvas.TextMetrics;
toni@521
    27
import org.apidesign.bck2brwsr.core.JavaScriptBody;
toni@521
    28
toni@521
    29
/**
toni@521
    30
 *
toni@1112
    31
 * @author Anton Epple <toni.epple@eppleton.de>
toni@521
    32
 */
toni@1112
    33
public class HTML5GraphicsContext implements GraphicsContext {
toni@521
    34
toni@1112
    35
    Object context;
toni@1112
    36
toni@1112
    37
    HTML5GraphicsContext(Object contextImpl) {
toni@1112
    38
        this.context = contextImpl;
toni@1112
    39
    }
toni@1112
    40
toni@1112
    41
    @JavaScriptBody(args = {"centerx", "centery", "radius", "startangle", "endangle", "ccw"},
toni@1112
    42
            body = "this._context().arc(centerx,centery, radius, startangle, endangle,ccw);")
toni@1112
    43
    @Override
toni@1112
    44
    public native void arc(double centerX,
toni@1111
    45
            double centerY,
toni@1111
    46
            double startAngle,
toni@1111
    47
            double radius,
toni@1111
    48
            double endAngle,
toni@1111
    49
            boolean ccw);
toni@521
    50
toni@1112
    51
    @JavaScriptBody(args = {"x1", "y1", "x2", "y2", "r"},
toni@1112
    52
            body = "this._context().arcTo(x1,y1,x2,y2,r);")
toni@1112
    53
    @Override
toni@1112
    54
    public native void arcTo(double x1,
toni@1111
    55
            double y1,
toni@1111
    56
            double x2,
toni@1111
    57
            double y2,
toni@1111
    58
            double r);
toni@521
    59
toni@1112
    60
    @JavaScriptBody(args = {"x", "y"},
toni@1112
    61
            body = "return this._context().isPointInPath(x,y);")
toni@1112
    62
    @Override
toni@1112
    63
    public native boolean isPointInPath(double x, double y);
toni@521
    64
toni@1112
    65
    @JavaScriptBody(args = {}, body = "this._context().fill();")
toni@1112
    66
    @Override
toni@1112
    67
    public native void fill();
toni@521
    68
toni@1112
    69
    @JavaScriptBody(args = {}, body = "this._context().stroke();")
toni@1112
    70
    @Override
toni@1112
    71
    public native void stroke();
toni@1109
    72
toni@1112
    73
    @JavaScriptBody(args = {}, body = "this._context().beginPath();")
toni@1112
    74
    @Override
toni@1112
    75
    public native void beginPath();
toni@1109
    76
toni@1112
    77
    @JavaScriptBody(args = {}, body = "this._context().closePath();")
toni@1112
    78
    @Override
toni@1112
    79
    public native void closePath();
toni@521
    80
toni@1112
    81
    @JavaScriptBody(args = {}, body = "this._context().clip();")
toni@1112
    82
    @Override
toni@1112
    83
    public native void clip();
toni@1109
    84
toni@1112
    85
    @JavaScriptBody(args = {"x", "y"}, body = "this._context().moveTo(x,y);")
toni@1112
    86
    @Override
toni@1112
    87
    public native void moveTo(double x, double y);
toni@1109
    88
toni@1112
    89
    @JavaScriptBody(args = {"x", "y"}, body = "this._context().lineTo(x,y);")
toni@1112
    90
    @Override
toni@1112
    91
    public native void lineTo(double x, double y);
toni@1109
    92
toni@1112
    93
    @JavaScriptBody(args = {"cpx", "cpy", "x", "y"}, body = "this._context().quadraticCurveTo(cpx,cpy,x,y);")
toni@1112
    94
    @Override
toni@1112
    95
    public native void quadraticCurveTo(double cpx, double cpy, double x, double y);
toni@1109
    96
toni@1112
    97
    @JavaScriptBody(args = {"cp1x", "cp1y", "cp2x", "cp2y", "x", "y"},
toni@1112
    98
            body = "this._context().bezierCurveTo(cp1x,cp1y,cp2x,cp2y,x,y);")
toni@1112
    99
    @Override
toni@1112
   100
    public native void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
toni@1109
   101
toni@1112
   102
    @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().fillRect(x,y,width,height);")
toni@1112
   103
    @Override
toni@1112
   104
    public native void fillRect(double x, double y, double width, double height);
toni@1109
   105
toni@1112
   106
    @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().strokeRect(x,y,width,height);")
toni@1112
   107
    @Override
toni@1112
   108
    public native void strokeRect(double x, double y, double width, double height);
toni@1109
   109
toni@1112
   110
    @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().clearRect(x,y,width,height);")
toni@1112
   111
    @Override
toni@1112
   112
    public native void clearRect(double x, double y, double width, double height);
toni@1109
   113
toni@1112
   114
    @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().rectect(x,y,width,height);")
toni@1112
   115
    @Override
toni@1112
   116
    public native void rect(double x, double y, double width, double height);
toni@1109
   117
toni@1112
   118
    @JavaScriptBody(args = {}, body = "this._context().save();")
toni@1112
   119
    @Override
toni@1112
   120
    public native void save();
toni@1109
   121
toni@1112
   122
    @JavaScriptBody(args = {}, body = "this._context().restore();")
toni@1112
   123
    @Override
toni@1112
   124
    public native void restore();
toni@1109
   125
toni@1112
   126
    @JavaScriptBody(args = {"angle"}, body = "this._context().rotate(angle);")
toni@1112
   127
    @Override
toni@1112
   128
    public native void rotate(double angle);
toni@1109
   129
toni@1112
   130
    @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().transform(a,b,c,d,e,f);")
toni@1112
   131
    @Override
toni@1112
   132
    public native void transform(double a, double b, double c, double d, double e, double f);
toni@1109
   133
toni@1112
   134
    @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().setTransform(a,b,c,d,e,f);")
toni@1112
   135
    @Override
toni@1112
   136
    public native void setTransform(double a, double b, double c, double d, double e, double f);
toni@1109
   137
toni@1112
   138
    @JavaScriptBody(args = {"x", "y"}, body = "this._context().translate(x,y);")
toni@1112
   139
    @Override
toni@1112
   140
    public native void translate(double x, double y);
toni@1109
   141
toni@1112
   142
    @JavaScriptBody(args = {"x", "y"}, body = "this._context().scale(x,y);")
toni@1112
   143
    @Override
toni@1112
   144
    public native void scale(double x, double y);
toni@1109
   145
toni@1112
   146
    @Override
toni@1112
   147
    public void drawImage(Image image, double x, double y) {
toni@1112
   148
        drawImageImpl(context, Element.getElementById((HTML5Image)image), x, y);
toni@1112
   149
    }
toni@1109
   150
toni@1112
   151
    @Override
toni@1112
   152
    public void drawImage(Image image, double x, double y, double width, double height) {
toni@1112
   153
        drawImageImpl(context, Element.getElementById((HTML5Image)image), x, y, width, height);
toni@1112
   154
    }
toni@1109
   155
toni@1112
   156
    @Override
toni@1112
   157
    public void drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height) {
toni@1112
   158
        drawImageImpl(context, Element.getElementById((HTML5Image)image), sx, sy, sWidth, sHeight, x, y, width, height);
toni@1112
   159
    }
toni@1109
   160
toni@1112
   161
    @JavaScriptBody(args = {"ctx", "img", "x", "y", "width", "height"}, body = "ctx.drawImage(img,x,y,width,height);")
toni@1112
   162
    private native static void drawImageImpl(Object ctx, Object img, double x, double y, double width, double height);
toni@1109
   163
toni@1112
   164
    @JavaScriptBody(args = {"ctx", "img", "sx", "sy", "swidth", "sheight", "x", "y", "width", "height"}, body = "ctx.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);")
toni@1112
   165
    private native static void drawImageImpl(Object ctx, Object img, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
toni@1109
   166
toni@1112
   167
    @JavaScriptBody(args = {"ctx", "img", "x", "y"}, body = "ctx.drawImage(img,x,y);")
toni@1112
   168
    private native static void drawImageImpl(Object ctx, Object img, double x, double y);
toni@1109
   169
toni@1112
   170
    @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style.valueOf();")
toni@1112
   171
    @Override
toni@1112
   172
    public native void setFillStyle(String style);
toni@1109
   173
toni@1112
   174
    @JavaScriptBody(args = {}, body = "return this._context().fillStyle;")
toni@1112
   175
    @Override
toni@1112
   176
    public native String getFillStyle();
toni@1109
   177
toni@1112
   178
    @Override
toni@1112
   179
    public void setFillStyle(LinearGradient style) {
toni@1112
   180
        setFillStyleImpl(context, ((HTML5LinearGradient)style).object());
toni@1112
   181
    }
toni@1109
   182
toni@1112
   183
    @Override
toni@1112
   184
    public void setFillStyle(RadialGradient style) {
toni@1112
   185
        setFillStyleImpl(context, ((HTML5RadialGradient)style).object());
toni@1112
   186
    }
toni@1109
   187
toni@1112
   188
    @Override
toni@1112
   189
    public void setFillStyle(Pattern style) {
toni@1112
   190
        setFillStyleImpl(context, ((HTML5Pattern)style).object());
toni@1112
   191
    }
toni@1109
   192
toni@1112
   193
    @JavaScriptBody(args = {"context", "obj"}, body = "context.fillStyle=obj;")
toni@1112
   194
    private native void setFillStyleImpl(Object context, Object obj);
toni@1109
   195
toni@1112
   196
    @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();")
toni@1112
   197
    @Override
toni@1112
   198
    public native void setStrokeStyle(String style);
toni@1109
   199
toni@1112
   200
    @Override
toni@1112
   201
    public void setStrokeStyle(LinearGradient style) {
toni@1112
   202
        setStrokeStyleImpl(context, ((HTML5LinearGradient)style).object());
toni@1112
   203
    }
toni@1109
   204
toni@1112
   205
    public void setStrokeStyle(RadialGradient style) {
toni@1112
   206
        setStrokeStyleImpl(context, ((HTML5RadialGradient)style).object());
toni@1112
   207
    }
toni@1109
   208
toni@1112
   209
    @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style;")
toni@1112
   210
    @Override
toni@1112
   211
    public void setStrokeStyle(Pattern style) {
toni@1112
   212
        setStrokeStyleImpl(context, ((HTML5LinearGradient)style).object());
toni@1112
   213
    }
toni@1109
   214
toni@1112
   215
    @JavaScriptBody(args = {"context", "obj"}, body = "context.strokeStyle=obj;")
toni@1112
   216
    private native void setStrokeStyleImpl(Object context, Object obj);
toni@1109
   217
toni@1112
   218
    @JavaScriptBody(args = {"color"}, body = "this._context().shadowColor=color.valueOf();")
toni@1112
   219
    @Override
toni@1112
   220
    public native void setShadowColor(String color);
toni@1109
   221
toni@1112
   222
    @JavaScriptBody(args = {"blur"}, body = "this._context().shadowBlur=blur;")
toni@1112
   223
    @Override
toni@1112
   224
    public native void setShadowBlur(double blur);
toni@1109
   225
toni@1112
   226
    @JavaScriptBody(args = {"x"}, body = "this._context().shadowOffsetX=x;")
toni@1112
   227
    @Override
toni@1112
   228
    public native void setShadowOffsetX(double x);
toni@1109
   229
toni@1112
   230
    @JavaScriptBody(args = {"y"}, body = "this._context().shadowOffsetY=y;")
toni@1112
   231
    @Override
toni@1112
   232
    public native void setShadowOffsetY(double y);
toni@1109
   233
toni@1112
   234
    @JavaScriptBody(args = {}, body = "return this._context().strokeStyle;")
toni@1112
   235
    @Override
toni@1112
   236
    public native String getStrokeStyle();
toni@1109
   237
toni@1112
   238
    @JavaScriptBody(args = {}, body = "return this._context().shadowColor;")
toni@1112
   239
    @Override
toni@1112
   240
    public native String getShadowColor();
toni@1109
   241
toni@1112
   242
    @JavaScriptBody(args = {}, body = "return this._context().shadowBlur;")
toni@1112
   243
    @Override
toni@1112
   244
    public native double getShadowBlur();
toni@1109
   245
toni@1112
   246
    @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetX;")
toni@1112
   247
    @Override
toni@1112
   248
    public native double getShadowOffsetX();
toni@1109
   249
toni@1112
   250
    @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetY;")
toni@1112
   251
    @Override
toni@1112
   252
    public native double getShadowOffsetY();
toni@1109
   253
toni@1112
   254
    @JavaScriptBody(args = {}, body = "return this._context().lineCap;")
toni@1112
   255
    @Override
toni@1112
   256
    public native String getLineCap();
toni@1109
   257
toni@1112
   258
    @JavaScriptBody(args = {"style"}, body = "this._context().lineCap=style.valueOf();")
toni@1112
   259
    @Override
toni@1112
   260
    public native void setLineCap(String style);
toni@521
   261
toni@1112
   262
    @JavaScriptBody(args = {}, body = "return this._context().lineJoin;")
toni@1112
   263
    @Override
toni@1112
   264
    public native String getLineJoin();
toni@521
   265
toni@1112
   266
    @JavaScriptBody(args = {"style"}, body = "this._context().lineJoin=style.valueOf();")
toni@1112
   267
    @Override
toni@1112
   268
    public native void setLineJoin(String style);
toni@521
   269
toni@1112
   270
    @JavaScriptBody(args = {}, body = "return this._context().lineWidth;")
toni@1112
   271
    @Override
toni@1112
   272
    public native double getLineWidth();
toni@521
   273
toni@1112
   274
    @JavaScriptBody(args = {"width"}, body = "this._context().lineWidth=width;")
toni@1112
   275
    @Override
toni@1112
   276
    public native void setLineWidth(double width);
toni@521
   277
toni@1112
   278
    @JavaScriptBody(args = {}, body = "return this._context().miterLimit;")
toni@1112
   279
    @Override
toni@1112
   280
    public native double getMiterLimit();
toni@521
   281
toni@1112
   282
    @JavaScriptBody(args = {"limit"}, body = "this._context().miterLimit=limit;")
toni@1112
   283
    @Override
toni@1112
   284
    public native void setMiterLimit(double limit);
toni@1111
   285
toni@1112
   286
    @JavaScriptBody(args = {}, body = "return this._context().font;")
toni@1112
   287
    @Override
toni@1112
   288
    public native String getFont();
toni@1111
   289
toni@1112
   290
    @JavaScriptBody(args = {"font"}, body = "this._context().font=font.valueOf();")
toni@1112
   291
    @Override
toni@1112
   292
    public native void setFont(String font);
toni@1111
   293
toni@1112
   294
    @JavaScriptBody(args = {}, body = "return this._context().textAlign;")
toni@1112
   295
    @Override
toni@1112
   296
    public native String getTextAlign();
toni@1111
   297
toni@1112
   298
    @JavaScriptBody(args = {"textalign"}, body = "this._context().textAlign=textalign.valueOf();")
toni@1112
   299
    @Override
toni@1112
   300
    public native void setTextAlign(String textAlign);
toni@1111
   301
toni@1112
   302
    @JavaScriptBody(args = {}, body = "return this._context().textBaseline;")
toni@1112
   303
    @Override
toni@1112
   304
    public native String getTextBaseline();
toni@1111
   305
toni@1112
   306
    @JavaScriptBody(args = {"textbaseline"}, body = "this._context().textBaseline=textbaseline.valueOf();")
toni@1112
   307
    @Override
toni@1112
   308
    public native void setTextBaseline(String textbaseline);
toni@1111
   309
toni@1112
   310
    @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().fillText(text,x,y);")
toni@1112
   311
    @Override
toni@1112
   312
    public native void fillText(String text, double x, double y);
toni@1111
   313
toni@1112
   314
    @JavaScriptBody(args = {"text", "x", "y", "maxwidth"}, body = "this._context().fillText(text,x,y,maxwidth);")
toni@1112
   315
    @Override
toni@1112
   316
    public void fillText(String text, double x, double y, double maxWidth) {
toni@1112
   317
    }
toni@1111
   318
toni@1112
   319
    @Override
toni@1112
   320
    public TextMetrics measureText(String text) {
toni@1112
   321
        return new HTML5TextMetrics(measureTextImpl(text));
toni@1112
   322
    }
toni@1111
   323
toni@1112
   324
    @JavaScriptBody(args = {"text"},
toni@1112
   325
            body = "return this._context().measureText(text);")
toni@1112
   326
    private native Object measureTextImpl(String text);
toni@1111
   327
toni@1112
   328
    @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().strokeText(text,x,y);")
toni@1112
   329
    @Override
toni@1112
   330
    public native void strokeText(String text, double x, double y);
toni@1111
   331
toni@1112
   332
    @JavaScriptBody(args = {"text", "x", "y", "maxWidth"}, body = "this._context().strokeText(text,x,y,maxWidth);")
toni@1112
   333
    @Override
toni@1112
   334
    public native void strokeText(String text, double x, double y, double maxWidth);
toni@1111
   335
toni@1112
   336
    @Override
toni@1112
   337
    public ImageData createImageData(double x, double y) {
toni@1112
   338
        return new HTML5ImageData(createImageDataImpl(x, y));
toni@1112
   339
    }
toni@1111
   340
toni@1112
   341
    @JavaScriptBody(args = {"x", "y"},
toni@1112
   342
            body = "return this._context().createImageData(x,y);")
toni@1112
   343
    private native Object createImageDataImpl(double x, double y);
toni@1111
   344
toni@1112
   345
    @Override
toni@1112
   346
    public ImageData createImageData(ImageData imageData) {
toni@1112
   347
        return new HTML5ImageData(createImageDataImpl(imageData.getWidth(), imageData.getHeight()));
toni@1112
   348
    }
toni@1111
   349
toni@1112
   350
    @Override
toni@1112
   351
    public ImageData getImageData(double x, double y, double width, double height) {
toni@1112
   352
        return new HTML5ImageData(getImageDataImpl(x, y, width, height));
toni@1112
   353
    }
toni@1111
   354
toni@1112
   355
    @JavaScriptBody(args = {"x", "y", "width", "height"},
toni@1112
   356
            body = "return this._context().getImageData(x,y,width,height);")
toni@1112
   357
    private native Object getImageDataImpl(double x, double y, double width, double height);
toni@1111
   358
toni@1112
   359
    @Override
toni@1112
   360
    public void putImageData(ImageData imageData, double x, double y) {
toni@1112
   361
        putImageDataImpl(((HTML5ImageData)imageData).object(), x, y);
toni@1112
   362
    }
toni@1112
   363
toni@1112
   364
    @JavaScriptBody(args = {"imageData", "x", "y"},
toni@1112
   365
            body = "this._context().putImageData(imageData,x,y);")
toni@1112
   366
    private native void putImageDataImpl(Object imageData, double x, double y);
toni@1112
   367
toni@1112
   368
    @Override
toni@1112
   369
    public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight) {
toni@1112
   370
        putImageDataImpl(((HTML5ImageData)imageData).object(), x, y, dirtyx, dirtyy, dirtywidth, dirtyheight);
toni@1112
   371
    }
toni@1112
   372
toni@1112
   373
    @JavaScriptBody(args = {"imageData", "x", "y", "dirtyx", "dirtyy", "dirtywidth", "dirtyheight"},
toni@1112
   374
            body = "this._context().putImageData(imageData,x,y, dirtyx, dirtyy, dirtywidth,dirtyheight);")
toni@1112
   375
    private native void putImageDataImpl(Object imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
toni@1112
   376
toni@1112
   377
    @JavaScriptBody(args = {"alpha"}, body = "this._context().globalAlpha=alpha;")
toni@1112
   378
    @Override
toni@1112
   379
    public native void setGlobalAlpha(double alpha);
toni@1112
   380
toni@1112
   381
    @JavaScriptBody(args = {}, body = "return this._context().globalAlpha;")
toni@1112
   382
    @Override
toni@1112
   383
    public native double getGlobalAlpha();
toni@1112
   384
toni@1112
   385
    @JavaScriptBody(args = {"operation"}, body = "this._context().globalCompositeOperation=operation.valueOf();")
toni@1112
   386
    @Override
toni@1112
   387
    public native void setGlobalCompositeOperation(String operation);
toni@1112
   388
toni@1112
   389
    @JavaScriptBody(args = {}, body = "return this._context().globalCompositeOperation;")
toni@1112
   390
    @Override
toni@1112
   391
    public native String getGlobalCompositeOperation();
toni@1112
   392
toni@1112
   393
    @Override
toni@1112
   394
    public HTML5LinearGradient createLinearGradient(double x0, double y0, double x1, double y1) {
toni@1112
   395
        return new HTML5LinearGradient(createLinearGradientImpl(context, x0, y0, x1, y1));
toni@1112
   396
    }
toni@1112
   397
toni@1112
   398
    @JavaScriptBody(args = {"context", "x0", "y0", "x1", "y1"}, body = "return context.createLinearGradient(x0,y0,x1,y1);")
toni@1112
   399
    private native Object createLinearGradientImpl(Object context, double x0, double y0, double x1, double y1);
toni@1112
   400
toni@1112
   401
    @Override
toni@1112
   402
    public Pattern createPattern(Image image, String repeat) {
toni@1112
   403
        return new HTML5Pattern(createPatternImpl(context, image, repeat));
toni@1112
   404
    }
toni@1112
   405
toni@1112
   406
    @JavaScriptBody(args = {"context", "image", "repeat"}, body = "return context.createPattern(image, repeat);")
toni@1112
   407
    private static native Object createPatternImpl(Object context, Image image, String repeat);
toni@1112
   408
toni@1112
   409
    @Override
toni@1112
   410
    public HTML5RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1) {
toni@1112
   411
        return new HTML5RadialGradient(createRadialGradientImpl(context, x0, y0, r0, x1, y1, r1));
toni@1112
   412
    }
toni@1112
   413
toni@1112
   414
    @JavaScriptBody(args = {"context", "x0", "y0", "r0", "x1", "y1", "r1"}, body = "return context.createRadialGradient(x0,y0,r0,x1,y1,r1);")
toni@1112
   415
    private static native Object createRadialGradientImpl(Object context, double x0, double y0, double r0, double x1, double y1, double r1);
toni@521
   416
}