Started extracting GraphicsContext interface from JavaQuery API. First extracting methods with primitive parameters and return type.
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
5 package net.java.html.canvas;
7 import org.apidesign.bck2brwsr.core.JavaScriptBody;
13 public interface GraphicsContext {
15 @JavaScriptBody(args = {"centerx", "centery", "radius", "startangle", "endangle", "ccw"}, body = "this._context().arc(centerx,centery, radius, startangle, endangle,ccw);")
16 void arc(double centerX, double centerY, double startAngle, double radius, double endAngle, boolean ccw);
18 @JavaScriptBody(args = {"x1", "y1", "x2", "y2", "r"}, body = "this._context().arcTo(x1,y1,x2,y2,r);")
19 void arcTo(double x1, double y1, double x2, double y2, double r);
21 @JavaScriptBody(args = {}, body = "this._context().beginPath();")
24 @JavaScriptBody(args = {"cp1x", "cp1y", "cp2x", "cp2y", "x", "y"}, body = "this._context().bezierCurveTo(cp1x,cp1y,cp2x,cp2y,x,y);")
25 void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
27 @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().clearRect(x,y,width,height);")
28 void clearRect(double x, double y, double width, double height);
30 @JavaScriptBody(args = {}, body = "this._context().clip();")
33 @JavaScriptBody(args = {}, body = "this._context().closePath();")
36 @JavaScriptBody(args = {}, body = "this._context().fill();")
39 @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().fillRect(x,y,width,height);")
40 void fillRect(double x, double y, double width, double height);
42 @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().fillText(text,x,y);")
43 void fillText(String text, double x, double y);
45 @JavaScriptBody(args = {"text", "x", "y", "maxwidth"}, body = "this._context().fillText(text,x,y,maxwidth);")
46 void fillText(String text, double x, double y, double maxWidth);
48 @JavaScriptBody(args = {}, body = "return this._context().fillStyle;")
49 String getFillStyle();
51 @JavaScriptBody(args = {}, body = "return this._context().font;")
54 @JavaScriptBody(args = {}, body = "return this._context().globalAlpha;")
55 double getGlobalAlpha();
57 @JavaScriptBody(args = {}, body = "return this._context().globalCompositeOperation;")
58 String getGlobalCompositeOperation();
60 @JavaScriptBody(args = {}, body = "return this._context().lineCap;")
63 @JavaScriptBody(args = {}, body = "return this._context().lineJoin;")
66 @JavaScriptBody(args = {}, body = "return this._context().lineWidth;")
67 double getLineWidth();
69 @JavaScriptBody(args = {}, body = "return this._context().miterLimit;")
70 double getMiterLimit();
72 @JavaScriptBody(args = {}, body = "return this._context().shadowBlur;")
73 double getShadowBlur();
75 @JavaScriptBody(args = {}, body = "return this._context().shadowColor;")
76 String getShadowColor();
78 @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetX;")
79 double getShadowOffsetX();
81 @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetY;")
82 double getShadowOffsetY();
84 @JavaScriptBody(args = {}, body = "return this._context().strokeStyle;")
85 String getStrokeStyle();
87 @JavaScriptBody(args = {}, body = "return this._context().textAlign;")
88 String getTextAlign();
90 @JavaScriptBody(args = {}, body = "return this._context().textBaseline;")
91 String getTextBaseline();
93 @JavaScriptBody(args = {"x", "y"}, body = "return this._context().isPointInPath(x,y);")
94 boolean isPointInPath(double x, double y);
96 @JavaScriptBody(args = {"x", "y"}, body = "this._context().lineTo(x,y);")
97 void lineTo(double x, double y);
99 @JavaScriptBody(args = {"x", "y"}, body = "this._context().moveTo(x,y);")
100 void moveTo(double x, double y);
102 @JavaScriptBody(args = {"cpx", "cpy", "x", "y"}, body = "this._context().quadraticCurveTo(cpx,cpy,x,y);")
103 void quadraticCurveTo(double cpx, double cpy, double x, double y);
105 @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().rectect(x,y,width,height);")
106 void rect(double x, double y, double width, double height);
108 @JavaScriptBody(args = {}, body = "this._context().restore();")
111 @JavaScriptBody(args = {"angle"}, body = "this._context().rotate(angle);")
112 void rotate(double angle);
114 @JavaScriptBody(args = {}, body = "this._context().save();")
117 @JavaScriptBody(args = {"x", "y"}, body = "this._context().scale(x,y);")
118 void scale(double x, double y);
120 @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style.valueOf();")
121 void setFillStyle(String style);
123 @JavaScriptBody(args = {"font"}, body = "this._context().font=font.valueOf();")
124 void setFont(String font);
126 @JavaScriptBody(args = {"alpha"}, body = "this._context().globalAlpha=alpha;")
127 void setGlobalAlpha(double alpha);
129 @JavaScriptBody(args = {"operation"}, body = "this._context().globalCompositeOperation=operation.valueOf();")
130 void setGlobalCompositeOperation(String operation);
132 @JavaScriptBody(args = {"style"}, body = "this._context().lineCap=style.valueOf();")
133 void setLineCap(String style);
135 @JavaScriptBody(args = {"style"}, body = "this._context().lineJoin=style.valueOf();")
136 void setLineJoin(String style);
138 @JavaScriptBody(args = {"width"}, body = "this._context().lineWidth=width;")
139 void setLineWidth(double width);
141 @JavaScriptBody(args = {"limit"}, body = "this._context().miterLimit=limit;")
142 void setMiterLimit(double limit);
144 @JavaScriptBody(args = {"blur"}, body = "this._context().shadowBlur=blur;")
145 void setShadowBlur(double blur);
147 @JavaScriptBody(args = {"color"}, body = "this._context().shadowColor=color.valueOf();")
148 void setShadowColor(String color);
150 @JavaScriptBody(args = {"x"}, body = "this._context().shadowOffsetX=x;")
151 void setShadowOffsetX(double x);
153 @JavaScriptBody(args = {"y"}, body = "this._context().shadowOffsetY=y;")
154 void setShadowOffsetY(double y);
156 @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();")
157 void setStrokeStyle(String style);
159 @JavaScriptBody(args = {"textalign"}, body = "this._context().textAlign=textalign.valueOf();")
160 void setTextAlign(String textAlign);
162 @JavaScriptBody(args = {"textbaseline"}, body = "this._context().textBaseline=textbaseline.valueOf();")
163 void setTextBaseline(String textbaseline);
165 @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().setTransform(a,b,c,d,e,f);")
166 void setTransform(double a, double b, double c, double d, double e, double f);
168 @JavaScriptBody(args = {}, body = "this._context().stroke();")
171 @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().strokeRect(x,y,width,height);")
172 void strokeRect(double x, double y, double width, double height);
174 @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().strokeText(text,x,y);")
175 void strokeText(String text, double x, double y);
177 @JavaScriptBody(args = {"text", "x", "y", "maxWidth"}, body = "this._context().strokeText(text,x,y,maxWidth);")
178 void strokeText(String text, double x, double y, double maxWidth);
180 @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().transform(a,b,c,d,e,f);")
181 void transform(double a, double b, double c, double d, double e, double f);
183 @JavaScriptBody(args = {"x", "y"}, body = "this._context().translate(x,y);")
184 void translate(double x, double y);