Started extracting GraphicsContext interface from JavaQuery API. First extracting methods with primitive parameters and return type.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Fri May 17 11:00:23 2013 +0200
1.3 @@ -0,0 +1,186 @@
1.4 +/*
1.5 + * To change this template, choose Tools | Templates
1.6 + * and open the template in the editor.
1.7 + */
1.8 +package net.java.html.canvas;
1.9 +
1.10 +import org.apidesign.bck2brwsr.core.JavaScriptBody;
1.11 +
1.12 +/**
1.13 + *
1.14 + * @author antonepple
1.15 + */
1.16 +public interface GraphicsContext {
1.17 +
1.18 + @JavaScriptBody(args = {"centerx", "centery", "radius", "startangle", "endangle", "ccw"}, body = "this._context().arc(centerx,centery, radius, startangle, endangle,ccw);")
1.19 + void arc(double centerX, double centerY, double startAngle, double radius, double endAngle, boolean ccw);
1.20 +
1.21 + @JavaScriptBody(args = {"x1", "y1", "x2", "y2", "r"}, body = "this._context().arcTo(x1,y1,x2,y2,r);")
1.22 + void arcTo(double x1, double y1, double x2, double y2, double r);
1.23 +
1.24 + @JavaScriptBody(args = {}, body = "this._context().beginPath();")
1.25 + void beginPath();
1.26 +
1.27 + @JavaScriptBody(args = {"cp1x", "cp1y", "cp2x", "cp2y", "x", "y"}, body = "this._context().bezierCurveTo(cp1x,cp1y,cp2x,cp2y,x,y);")
1.28 + void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
1.29 +
1.30 + @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().clearRect(x,y,width,height);")
1.31 + void clearRect(double x, double y, double width, double height);
1.32 +
1.33 + @JavaScriptBody(args = {}, body = "this._context().clip();")
1.34 + void clip();
1.35 +
1.36 + @JavaScriptBody(args = {}, body = "this._context().closePath();")
1.37 + void closePath();
1.38 +
1.39 + @JavaScriptBody(args = {}, body = "this._context().fill();")
1.40 + void fill();
1.41 +
1.42 + @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().fillRect(x,y,width,height);")
1.43 + void fillRect(double x, double y, double width, double height);
1.44 +
1.45 + @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().fillText(text,x,y);")
1.46 + void fillText(String text, double x, double y);
1.47 +
1.48 + @JavaScriptBody(args = {"text", "x", "y", "maxwidth"}, body = "this._context().fillText(text,x,y,maxwidth);")
1.49 + void fillText(String text, double x, double y, double maxWidth);
1.50 +
1.51 + @JavaScriptBody(args = {}, body = "return this._context().fillStyle;")
1.52 + String getFillStyle();
1.53 +
1.54 + @JavaScriptBody(args = {}, body = "return this._context().font;")
1.55 + String getFont();
1.56 +
1.57 + @JavaScriptBody(args = {}, body = "return this._context().globalAlpha;")
1.58 + double getGlobalAlpha();
1.59 +
1.60 + @JavaScriptBody(args = {}, body = "return this._context().globalCompositeOperation;")
1.61 + String getGlobalCompositeOperation();
1.62 +
1.63 + @JavaScriptBody(args = {}, body = "return this._context().lineCap;")
1.64 + String getLineCap();
1.65 +
1.66 + @JavaScriptBody(args = {}, body = "return this._context().lineJoin;")
1.67 + String getLineJoin();
1.68 +
1.69 + @JavaScriptBody(args = {}, body = "return this._context().lineWidth;")
1.70 + double getLineWidth();
1.71 +
1.72 + @JavaScriptBody(args = {}, body = "return this._context().miterLimit;")
1.73 + double getMiterLimit();
1.74 +
1.75 + @JavaScriptBody(args = {}, body = "return this._context().shadowBlur;")
1.76 + double getShadowBlur();
1.77 +
1.78 + @JavaScriptBody(args = {}, body = "return this._context().shadowColor;")
1.79 + String getShadowColor();
1.80 +
1.81 + @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetX;")
1.82 + double getShadowOffsetX();
1.83 +
1.84 + @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetY;")
1.85 + double getShadowOffsetY();
1.86 +
1.87 + @JavaScriptBody(args = {}, body = "return this._context().strokeStyle;")
1.88 + String getStrokeStyle();
1.89 +
1.90 + @JavaScriptBody(args = {}, body = "return this._context().textAlign;")
1.91 + String getTextAlign();
1.92 +
1.93 + @JavaScriptBody(args = {}, body = "return this._context().textBaseline;")
1.94 + String getTextBaseline();
1.95 +
1.96 + @JavaScriptBody(args = {"x", "y"}, body = "return this._context().isPointInPath(x,y);")
1.97 + boolean isPointInPath(double x, double y);
1.98 +
1.99 + @JavaScriptBody(args = {"x", "y"}, body = "this._context().lineTo(x,y);")
1.100 + void lineTo(double x, double y);
1.101 +
1.102 + @JavaScriptBody(args = {"x", "y"}, body = "this._context().moveTo(x,y);")
1.103 + void moveTo(double x, double y);
1.104 +
1.105 + @JavaScriptBody(args = {"cpx", "cpy", "x", "y"}, body = "this._context().quadraticCurveTo(cpx,cpy,x,y);")
1.106 + void quadraticCurveTo(double cpx, double cpy, double x, double y);
1.107 +
1.108 + @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().rectect(x,y,width,height);")
1.109 + void rect(double x, double y, double width, double height);
1.110 +
1.111 + @JavaScriptBody(args = {}, body = "this._context().restore();")
1.112 + void restore();
1.113 +
1.114 + @JavaScriptBody(args = {"angle"}, body = "this._context().rotate(angle);")
1.115 + void rotate(double angle);
1.116 +
1.117 + @JavaScriptBody(args = {}, body = "this._context().save();")
1.118 + void save();
1.119 +
1.120 + @JavaScriptBody(args = {"x", "y"}, body = "this._context().scale(x,y);")
1.121 + void scale(double x, double y);
1.122 +
1.123 + @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style.valueOf();")
1.124 + void setFillStyle(String style);
1.125 +
1.126 + @JavaScriptBody(args = {"font"}, body = "this._context().font=font.valueOf();")
1.127 + void setFont(String font);
1.128 +
1.129 + @JavaScriptBody(args = {"alpha"}, body = "this._context().globalAlpha=alpha;")
1.130 + void setGlobalAlpha(double alpha);
1.131 +
1.132 + @JavaScriptBody(args = {"operation"}, body = "this._context().globalCompositeOperation=operation.valueOf();")
1.133 + void setGlobalCompositeOperation(String operation);
1.134 +
1.135 + @JavaScriptBody(args = {"style"}, body = "this._context().lineCap=style.valueOf();")
1.136 + void setLineCap(String style);
1.137 +
1.138 + @JavaScriptBody(args = {"style"}, body = "this._context().lineJoin=style.valueOf();")
1.139 + void setLineJoin(String style);
1.140 +
1.141 + @JavaScriptBody(args = {"width"}, body = "this._context().lineWidth=width;")
1.142 + void setLineWidth(double width);
1.143 +
1.144 + @JavaScriptBody(args = {"limit"}, body = "this._context().miterLimit=limit;")
1.145 + void setMiterLimit(double limit);
1.146 +
1.147 + @JavaScriptBody(args = {"blur"}, body = "this._context().shadowBlur=blur;")
1.148 + void setShadowBlur(double blur);
1.149 +
1.150 + @JavaScriptBody(args = {"color"}, body = "this._context().shadowColor=color.valueOf();")
1.151 + void setShadowColor(String color);
1.152 +
1.153 + @JavaScriptBody(args = {"x"}, body = "this._context().shadowOffsetX=x;")
1.154 + void setShadowOffsetX(double x);
1.155 +
1.156 + @JavaScriptBody(args = {"y"}, body = "this._context().shadowOffsetY=y;")
1.157 + void setShadowOffsetY(double y);
1.158 +
1.159 + @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();")
1.160 + void setStrokeStyle(String style);
1.161 +
1.162 + @JavaScriptBody(args = {"textalign"}, body = "this._context().textAlign=textalign.valueOf();")
1.163 + void setTextAlign(String textAlign);
1.164 +
1.165 + @JavaScriptBody(args = {"textbaseline"}, body = "this._context().textBaseline=textbaseline.valueOf();")
1.166 + void setTextBaseline(String textbaseline);
1.167 +
1.168 + @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().setTransform(a,b,c,d,e,f);")
1.169 + void setTransform(double a, double b, double c, double d, double e, double f);
1.170 +
1.171 + @JavaScriptBody(args = {}, body = "this._context().stroke();")
1.172 + void stroke();
1.173 +
1.174 + @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().strokeRect(x,y,width,height);")
1.175 + void strokeRect(double x, double y, double width, double height);
1.176 +
1.177 + @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().strokeText(text,x,y);")
1.178 + void strokeText(String text, double x, double y);
1.179 +
1.180 + @JavaScriptBody(args = {"text", "x", "y", "maxWidth"}, body = "this._context().strokeText(text,x,y,maxWidth);")
1.181 + void strokeText(String text, double x, double y, double maxWidth);
1.182 +
1.183 + @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().transform(a,b,c,d,e,f);")
1.184 + void transform(double a, double b, double c, double d, double e, double f);
1.185 +
1.186 + @JavaScriptBody(args = {"x", "y"}, body = "this._context().translate(x,y);")
1.187 + void translate(double x, double y);
1.188 +
1.189 +}