According to https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String one is supposed to use valueOf to convert from String object to primitive string value
1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/GraphicsContext.java Wed Feb 27 14:38:16 2013 +0100
1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/GraphicsContext.java Wed Feb 27 14:56:25 2013 +0100
1.3 @@ -134,7 +134,7 @@
1.4 @JavaScriptBody(args = {"ctx", "img", "x", "y"}, body = "ctx.drawImage(img,x,y);")
1.5 private native static void drawImageImpl(Object ctx, Object img, double x, double y);
1.6
1.7 - @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style;")
1.8 + @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style.valueOf();")
1.9 public native void setFillStyle(String style);
1.10
1.11 @JavaScriptBody(args = {}, body = "return this._context().fillStyle;")
1.12 @@ -155,7 +155,7 @@
1.13 @JavaScriptBody(args = {"context","obj"}, body = "context.fillStyle=obj;")
1.14 private native void setFillStyleImpl(Object context, Object obj);
1.15
1.16 - @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style;")
1.17 + @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();")
1.18 public native void setStrokeStyle(String style);
1.19
1.20 public void setStrokeStyle(LinearGradient style) {
1.21 @@ -174,7 +174,7 @@
1.22 @JavaScriptBody(args = {"context","obj"}, body = "context.strokeStyle=obj;")
1.23 private native void setStrokeStyleImpl(Object context, Object obj);
1.24
1.25 - @JavaScriptBody(args = {"color"}, body = "this._context().shadowColor=color;")
1.26 + @JavaScriptBody(args = {"color"}, body = "this._context().shadowColor=color.valueOf();")
1.27 public native void setShadowColor(String color);
1.28
1.29 @JavaScriptBody(args = {"blur"}, body = "this._context().shadowBlur=blur;")
1.30 @@ -204,19 +204,19 @@
1.31 @JavaScriptBody(args = {}, body = "return this._context().lineCap;")
1.32 public native String getLineCap();
1.33
1.34 - @JavaScriptBody(args = {"style"}, body = "this._context().lineCap=style;")
1.35 + @JavaScriptBody(args = {"style"}, body = "this._context().lineCap=style.valueOf();")
1.36 public native void setLineCap(String style);
1.37
1.38 @JavaScriptBody(args = {}, body = "return this._context().lineJoin;")
1.39 public native String getLineJoin();
1.40
1.41 - @JavaScriptBody(args = {"style"}, body = "this._context().lineJoin=style;")
1.42 + @JavaScriptBody(args = {"style"}, body = "this._context().lineJoin=style.valueOf();")
1.43 public native void setLineJoin(String style) ;
1.44
1.45 @JavaScriptBody(args = {}, body = "return this._context().lineWidth;")
1.46 public native double getLineWidth();
1.47
1.48 - @JavaScriptBody(args = {"width"}, body = "this._context().lineJoin=width;")
1.49 + @JavaScriptBody(args = {"width"}, body = "this._context().lineWidth=width;")
1.50 public native void setLineWidth(double width);
1.51
1.52 @JavaScriptBody(args = {}, body = "return this._context().miterLimit;")
1.53 @@ -228,19 +228,19 @@
1.54 @JavaScriptBody(args = {}, body = "return this._context().font;")
1.55 public native String getFont();
1.56
1.57 - @JavaScriptBody(args = {"font"}, body = "this._context().font=font;")
1.58 + @JavaScriptBody(args = {"font"}, body = "this._context().font=font.valueOf();")
1.59 public native void setFont(String font);
1.60
1.61 @JavaScriptBody(args = {}, body = "return this._context().textAlign;")
1.62 public native String getTextAlign();
1.63
1.64 - @JavaScriptBody(args = {"textalign"}, body = "this._context().textAlign=textalign;")
1.65 + @JavaScriptBody(args = {"textalign"}, body = "this._context().textAlign=textalign.valueOf();")
1.66 public native void setTextAlign(String textAlign);
1.67
1.68 @JavaScriptBody(args = {}, body = "return this._context().textBaseline;")
1.69 public native String getTextBaseline();
1.70
1.71 - @JavaScriptBody(args = {"textbaseline"}, body = "this._context().textBaseline=textbaseline;")
1.72 + @JavaScriptBody(args = {"textbaseline"}, body = "this._context().textBaseline=textbaseline.valueOf();")
1.73 public native void setTextBaseline(String textbaseline);
1.74
1.75 @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().fillText(text,x,y);")
1.76 @@ -306,7 +306,7 @@
1.77 @JavaScriptBody(args = {}, body = "return this._context().globalAlpha;")
1.78 public native double getGlobalAlpha();
1.79
1.80 - @JavaScriptBody(args = {"operation"}, body = "this._context().globalCompositeOperation=operation;")
1.81 + @JavaScriptBody(args = {"operation"}, body = "this._context().globalCompositeOperation=operation.valueOf();")
1.82 public native void setGlobalCompositeOperation(String operation);
1.83
1.84 @JavaScriptBody(args = {}, body = "return this._context().globalCompositeOperation;")