1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Canvas.java Tue May 21 16:10:52 2013 +0200
1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Canvas.java Thu May 23 10:02:14 2013 +0200
1.3 @@ -17,8 +17,7 @@
1.4 */
1.5 package org.apidesign.bck2brwsr.htmlpage.api;
1.6
1.7 -import net.java.html.canvas.ICanvas;
1.8 -import net.java.html.canvas.IGraphicsContext;
1.9 +import net.java.html.canvas.GraphicsContext;
1.10 import org.apidesign.bck2brwsr.core.JavaScriptBody;
1.11 import static org.apidesign.bck2brwsr.htmlpage.api.Element.getAttribute;
1.12
1.13 @@ -26,29 +25,25 @@
1.14 *
1.15 * @author Anton Epple <toni.epple@eppleton.de>
1.16 */
1.17 -public class Canvas extends Element implements ICanvas{
1.18 +public class Canvas extends Element {
1.19
1.20 public Canvas(String id) {
1.21 super(id);
1.22 }
1.23
1.24 - @Override
1.25 public void setHeight(int height) {
1.26 setAttribute(this, "height", height);
1.27 }
1.28
1.29 - @Override
1.30 public int getHeight() {
1.31 Object ret = getAttribute(this, "height");
1.32 return (ret instanceof Number) ? ((Number)ret).intValue(): Integer.MIN_VALUE;
1.33 }
1.34
1.35 - @Override
1.36 public void setWidth(int width) {
1.37 setAttribute(this, "width", width);
1.38 }
1.39
1.40 - @Override
1.41 public int getWidth() {
1.42 Object ret = getAttribute(this, "width");
1.43 return (ret instanceof Number) ? ((Number)ret).intValue(): Integer.MIN_VALUE;
1.44 @@ -60,8 +55,8 @@
1.45 + "return e.getContext('2d');\n")
1.46 private native static Object getContextImpl(Canvas el);
1.47
1.48 - public IGraphicsContext getContext() {
1.49 - return new GraphicsContext(getContextImpl(this));
1.50 + public GraphicsContext getContext() {
1.51 + return new GraphicsContext(new HTML5GraphicsEnvironment(getContextImpl(this), this));
1.52 }
1.53
1.54 @Override