implemented getImageForPath canvas
authortoni.epple@eppleton.de
Tue, 21 May 2013 15:17:40 +0200
branchcanvas
changeset 1122f5f15ac48ea8
parent 1121 dbc985f7226e
child 1123 99e875d14a97
implemented getImageForPath
javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/HTML5GraphicsContext.java
     1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/HTML5GraphicsContext.java	Tue May 21 15:15:09 2013 +0200
     1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/HTML5GraphicsContext.java	Tue May 21 15:17:40 2013 +0200
     1.3 @@ -145,17 +145,17 @@
     1.4  
     1.5      @Override
     1.6      public void drawImage(Image image, double x, double y) {
     1.7 -        drawImageImpl(context, Element.getElementById((HTML5Image)image), x, y);
     1.8 +        drawImageImpl(context, Element.getElementById((HTML5Image) image), x, y);
     1.9      }
    1.10  
    1.11      @Override
    1.12      public void drawImage(Image image, double x, double y, double width, double height) {
    1.13 -        drawImageImpl(context, Element.getElementById((HTML5Image)image), x, y, width, height);
    1.14 +        drawImageImpl(context, Element.getElementById((HTML5Image) image), x, y, width, height);
    1.15      }
    1.16  
    1.17      @Override
    1.18      public void drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height) {
    1.19 -        drawImageImpl(context, Element.getElementById((HTML5Image)image), sx, sy, sWidth, sHeight, x, y, width, height);
    1.20 +        drawImageImpl(context, Element.getElementById((HTML5Image) image), sx, sy, sWidth, sHeight, x, y, width, height);
    1.21      }
    1.22  
    1.23      @JavaScriptBody(args = {"ctx", "img", "x", "y", "width", "height"}, body = "ctx.drawImage(img,x,y,width,height);")
    1.24 @@ -177,17 +177,17 @@
    1.25  
    1.26      @Override
    1.27      public void setFillStyle(LinearGradient style) {
    1.28 -        setFillStyleImpl(context, ((HTML5LinearGradient)style).object());
    1.29 +        setFillStyleImpl(context, ((HTML5LinearGradient) style).object());
    1.30      }
    1.31  
    1.32      @Override
    1.33      public void setFillStyle(RadialGradient style) {
    1.34 -        setFillStyleImpl(context, ((HTML5RadialGradient)style).object());
    1.35 +        setFillStyleImpl(context, ((HTML5RadialGradient) style).object());
    1.36      }
    1.37  
    1.38      @Override
    1.39      public void setFillStyle(Pattern style) {
    1.40 -        setFillStyleImpl(context, ((HTML5Pattern)style).object());
    1.41 +        setFillStyleImpl(context, ((HTML5Pattern) style).object());
    1.42      }
    1.43  
    1.44      @JavaScriptBody(args = {"context", "obj"}, body = "context.fillStyle=obj;")
    1.45 @@ -199,18 +199,18 @@
    1.46  
    1.47      @Override
    1.48      public void setStrokeStyle(LinearGradient style) {
    1.49 -        setStrokeStyleImpl(context, ((HTML5LinearGradient)style).object());
    1.50 +        setStrokeStyleImpl(context, ((HTML5LinearGradient) style).object());
    1.51      }
    1.52  
    1.53      @Override
    1.54      public void setStrokeStyle(RadialGradient style) {
    1.55 -        setStrokeStyleImpl(context, ((HTML5RadialGradient)style).object());
    1.56 +        setStrokeStyleImpl(context, ((HTML5RadialGradient) style).object());
    1.57      }
    1.58  
    1.59      @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style;")
    1.60      @Override
    1.61      public void setStrokeStyle(Pattern style) {
    1.62 -        setStrokeStyleImpl(context, ((HTML5LinearGradient)style).object());
    1.63 +        setStrokeStyleImpl(context, ((HTML5LinearGradient) style).object());
    1.64      }
    1.65  
    1.66      @JavaScriptBody(args = {"context", "obj"}, body = "context.strokeStyle=obj;")
    1.67 @@ -359,7 +359,7 @@
    1.68  
    1.69      @Override
    1.70      public void putImageData(ImageData imageData, double x, double y) {
    1.71 -        putImageDataImpl(((HTML5ImageData)imageData).object(), x, y);
    1.72 +        putImageDataImpl(((HTML5ImageData) imageData).object(), x, y);
    1.73      }
    1.74  
    1.75      @JavaScriptBody(args = {"imageData", "x", "y"},
    1.76 @@ -368,7 +368,7 @@
    1.77  
    1.78      @Override
    1.79      public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight) {
    1.80 -        putImageDataImpl(((HTML5ImageData)imageData).object(), x, y, dirtyx, dirtyy, dirtywidth, dirtyheight);
    1.81 +        putImageDataImpl(((HTML5ImageData) imageData).object(), x, y, dirtyx, dirtyy, dirtywidth, dirtyheight);
    1.82      }
    1.83  
    1.84      @JavaScriptBody(args = {"imageData", "x", "y", "dirtyx", "dirtyy", "dirtywidth", "dirtyheight"},
    1.85 @@ -415,6 +415,7 @@
    1.86      @JavaScriptBody(args = {"context", "x0", "y0", "r0", "x1", "y1", "r1"}, body = "return context.createRadialGradient(x0,y0,r0,x1,y1,r1);")
    1.87      private static native Object createRadialGradientImpl(Object context, double x0, double y0, double r0, double x1, double y1, double r1);
    1.88  
    1.89 +    @JavaScriptBody(args = {"path"}, body = "var b = new Image(); b.src=path; return b;")
    1.90      @Override
    1.91      public Image getImageForPath(String path) {
    1.92          throw new UnsupportedOperationException("getImageForPath is not yet supported");