1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/HTML5GraphicsEnvironment.java Mon May 27 12:53:39 2013 +0200
1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/HTML5GraphicsEnvironment.java Mon May 27 14:13:01 2013 +0200
1.3 @@ -174,13 +174,13 @@
1.4 return drawImageImpl(context, nativeImage, sx, sy, sWidth, sHeight, x, y, width, height);
1.5 }
1.6
1.7 - @JavaScriptBody(args = {"ctx", "img", "x", "y", "width", "height"}, body = "ctx.drawImage(img,x,y,width,height); return img;")
1.8 + @JavaScriptBody(args = {"ctx", "img", "x", "y", "width", "height"}, body = "img.onload=function(){ctx.drawImage(img,x,y,width,height);};ctx.drawImage(img,x,y,width,height); return img;")
1.9 private native static Object drawImageImpl(Object ctx, Object img, double x, double y, double width, double height);
1.10
1.11 - @JavaScriptBody(args = {"ctx", "img", "sx", "sy", "swidth", "sheight", "x", "y", "width", "height"}, body = "ctx.drawImage(img,sx,sy,swidth,sheight,x,y,width,height); return img;")
1.12 + @JavaScriptBody(args = {"ctx", "img", "sx", "sy", "swidth", "sheight", "x", "y", "width", "height"}, body = "img.onload=function(){ctx.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);}; ctx.drawImage(img,sx,sy,swidth,sheight,x,y,width,height); return img;")
1.13 private native static Object drawImageImpl(Object ctx, Object img, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
1.14
1.15 - @JavaScriptBody(args = {"ctx", "img", "x", "y"}, body = "ctx.drawImage(img,x,y); return img;")
1.16 + @JavaScriptBody(args = {"ctx", "img", "x", "y"}, body = "img.onload=function(){ctx.drawImage(img,x,y);}; ctx.drawImage(img,x,y); return img;")
1.17 private native static Object drawImageImpl(Object ctx, Object img, double x, double y);
1.18
1.19 public Object setFillStyle(Style style, Object nativeStyle) {
1.20 @@ -233,7 +233,7 @@
1.21 "gradient.addColorStop(position,color)")
1.22 private static native void addColorStopImpl(Object gradient, double position, String color);
1.23
1.24 - @JavaScriptBody(args = {"context", "obj"}, body = "context.fillStyle=obj;")
1.25 + @JavaScriptBody(args = {"context", "obj"}, body = "console.log('style: '+obj);context.fillStyle=obj;")
1.26 private native void setFillStyleImpl(Object context, Object obj);
1.27
1.28 @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();")
1.29 @@ -448,8 +448,8 @@
1.30 @JavaScriptBody(args = {"context", "x0", "y0", "r0", "x1", "y1", "r1"}, body = "return context.createRadialGradient(x0,y0,r0,x1,y1,r1);")
1.31 private static native Object createRadialGradientImpl(Object context, double x0, double y0, double r0, double x1, double y1, double r1);
1.32
1.33 - @JavaScriptBody(args = {"path"}, body = "var b = new Image(); b.src=path; return b;")
1.34 - public native Image getImageForPath(String path);
1.35 +// @JavaScriptBody(args = {"path"}, body = "var b = new Image(); b.src=path; return b;")
1.36 +// public native Image getImageForPathImpl(String path);
1.37
1.38 @Override
1.39 public int getHeight() {
2.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/ImageDataWrapper.java Mon May 27 12:53:39 2013 +0200
2.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/ImageDataWrapper.java Mon May 27 14:13:01 2013 +0200
2.3 @@ -15,10 +15,7 @@
2.4 * this program. Look for COPYING file in the top folder. If not, see
2.5 * http://opensource.org/licenses/GPL-2.0.
2.6 */
2.7 -/*
2.8 - * To change this template, choose Tools | Templates
2.9 - * and open the template in the editor.
2.10 - */
2.11 +
2.12 package org.apidesign.bck2brwsr.htmlpage;
2.13
2.14 import net.java.html.canvas.ImageData;
2.15 @@ -120,7 +117,7 @@
2.16 getData().set(idx + 3, value);
2.17 }
2.18
2.19 - public static class Data {
2.20 + private static class Data {
2.21
2.22 Object data;
2.23
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/Logger.java Mon May 27 14:13:01 2013 +0200
3.3 @@ -0,0 +1,18 @@
3.4 +/*
3.5 + * To change this template, choose Tools | Templates
3.6 + * and open the template in the editor.
3.7 + */
3.8 +package org.apidesign.bck2brwsr.htmlpage;
3.9 +
3.10 +import org.apidesign.bck2brwsr.core.JavaScriptBody;
3.11 +
3.12 +/**
3.13 + *
3.14 + * @author antonepple
3.15 + */
3.16 +public class Logger {
3.17 +
3.18 + @JavaScriptBody(args = "message",body = "console.log(message)")
3.19 + public static native void log(String text);
3.20 +
3.21 +}
4.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Mon May 27 12:53:39 2013 +0200
4.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Mon May 27 14:13:01 2013 +0200
4.3 @@ -323,7 +323,7 @@
4.4 }
4.5
4.6 public Image getImageForPath(String path){
4.7 - return graphicsEnvironmentImpl.getImageForPath(path);
4.8 + return new net.java.html.canvas.Image(path);
4.9 }
4.10
4.11 public int getHeight(){
5.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/Image.java Mon May 27 12:53:39 2013 +0200
5.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Image.java Mon May 27 14:13:01 2013 +0200
5.3 @@ -30,7 +30,7 @@
5.4 private Object cached;
5.5 private int cacheHash;
5.6
5.7 - void Image(String src) {
5.8 + Image(String src) {
5.9 this.src = src;
5.10 }
5.11
6.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Mon May 27 12:53:39 2013 +0200
6.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Mon May 27 14:13:01 2013 +0200
6.3 @@ -188,8 +188,6 @@
6.4 public void setGlobalCompositeOperation(String operation);
6.5
6.6 public String getGlobalCompositeOperation();
6.7 -
6.8 - public Image getImageForPath(String path);
6.9
6.10 public int getHeight();
6.11