Extracting interfaces from JavaQuery API. Removed first (automatic) refactoring attempt and redid it manually.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Canvas.java Fri May 17 12:06:36 2013 +0200
1.3 @@ -0,0 +1,13 @@
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 +/**
1.11 + *
1.12 + * @author antonepple
1.13 + */
1.14 +public interface Canvas {
1.15 +
1.16 +}
2.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Fri May 17 11:00:38 2013 +0200
2.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Fri May 17 12:06:36 2013 +0200
2.3 @@ -1,6 +1,19 @@
2.4 -/*
2.5 - * To change this template, choose Tools | Templates
2.6 - * and open the template in the editor.
2.7 +/**
2.8 + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
2.9 + * <jaroslav.tulach@apidesign.org>
2.10 + *
2.11 + * This program is free software: you can redistribute it and/or modify it under
2.12 + * the terms of the GNU General Public License as published by the Free Software
2.13 + * Foundation, version 2 of the License.
2.14 + *
2.15 + * This program is distributed in the hope that it will be useful, but WITHOUT
2.16 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
2.17 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
2.18 + * details.
2.19 + *
2.20 + * You should have received a copy of the GNU General Public License along with
2.21 + * this program. Look for COPYING file in the top folder. If not, see
2.22 + * http://opensource.org/licenses/GPL-2.0.
2.23 */
2.24 package net.java.html.canvas;
2.25
2.26 @@ -12,175 +25,162 @@
2.27 */
2.28 public interface GraphicsContext {
2.29
2.30 - @JavaScriptBody(args = {"centerx", "centery", "radius", "startangle", "endangle", "ccw"}, body = "this._context().arc(centerx,centery, radius, startangle, endangle,ccw);")
2.31 - void arc(double centerX, double centerY, double startAngle, double radius, double endAngle, boolean ccw);
2.32 + public void arc(double centerX,
2.33 + double centerY,
2.34 + double startAngle,
2.35 + double radius,
2.36 + double endAngle,
2.37 + boolean ccw);
2.38
2.39 - @JavaScriptBody(args = {"x1", "y1", "x2", "y2", "r"}, body = "this._context().arcTo(x1,y1,x2,y2,r);")
2.40 - void arcTo(double x1, double y1, double x2, double y2, double r);
2.41 + public void arcTo(double x1,
2.42 + double y1,
2.43 + double x2,
2.44 + double y2,
2.45 + double r);
2.46
2.47 - @JavaScriptBody(args = {}, body = "this._context().beginPath();")
2.48 - void beginPath();
2.49 + public boolean isPointInPath(double x, double y);
2.50
2.51 - @JavaScriptBody(args = {"cp1x", "cp1y", "cp2x", "cp2y", "x", "y"}, body = "this._context().bezierCurveTo(cp1x,cp1y,cp2x,cp2y,x,y);")
2.52 - void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
2.53 + public void fill();
2.54
2.55 - @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().clearRect(x,y,width,height);")
2.56 - void clearRect(double x, double y, double width, double height);
2.57 + public void stroke();
2.58
2.59 - @JavaScriptBody(args = {}, body = "this._context().clip();")
2.60 - void clip();
2.61 + public void beginPath();
2.62
2.63 - @JavaScriptBody(args = {}, body = "this._context().closePath();")
2.64 - void closePath();
2.65 + public void closePath();
2.66
2.67 - @JavaScriptBody(args = {}, body = "this._context().fill();")
2.68 - void fill();
2.69 + public void clip();
2.70
2.71 - @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().fillRect(x,y,width,height);")
2.72 - void fillRect(double x, double y, double width, double height);
2.73 + public void moveTo(double x, double y);
2.74
2.75 - @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().fillText(text,x,y);")
2.76 - void fillText(String text, double x, double y);
2.77 + public void lineTo(double x, double y);
2.78
2.79 - @JavaScriptBody(args = {"text", "x", "y", "maxwidth"}, body = "this._context().fillText(text,x,y,maxwidth);")
2.80 - void fillText(String text, double x, double y, double maxWidth);
2.81 + public void quadraticCurveTo(double cpx, double cpy, double x, double y);
2.82
2.83 - @JavaScriptBody(args = {}, body = "return this._context().fillStyle;")
2.84 - String getFillStyle();
2.85 + public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
2.86
2.87 - @JavaScriptBody(args = {}, body = "return this._context().font;")
2.88 - String getFont();
2.89 + public void fillRect(double x, double y, double width, double height);
2.90
2.91 - @JavaScriptBody(args = {}, body = "return this._context().globalAlpha;")
2.92 - double getGlobalAlpha();
2.93 + public void strokeRect(double x, double y, double width, double height);
2.94
2.95 - @JavaScriptBody(args = {}, body = "return this._context().globalCompositeOperation;")
2.96 - String getGlobalCompositeOperation();
2.97 + public void clearRect(double x, double y, double width, double height);
2.98
2.99 - @JavaScriptBody(args = {}, body = "return this._context().lineCap;")
2.100 - String getLineCap();
2.101 + public void rect(double x, double y, double width, double height);
2.102
2.103 - @JavaScriptBody(args = {}, body = "return this._context().lineJoin;")
2.104 - String getLineJoin();
2.105 + public void save();
2.106
2.107 - @JavaScriptBody(args = {}, body = "return this._context().lineWidth;")
2.108 - double getLineWidth();
2.109 + public void restore();
2.110
2.111 - @JavaScriptBody(args = {}, body = "return this._context().miterLimit;")
2.112 - double getMiterLimit();
2.113 + public void rotate(double angle);
2.114
2.115 - @JavaScriptBody(args = {}, body = "return this._context().shadowBlur;")
2.116 - double getShadowBlur();
2.117 + public void transform(double a, double b, double c, double d, double e, double f);
2.118
2.119 - @JavaScriptBody(args = {}, body = "return this._context().shadowColor;")
2.120 - String getShadowColor();
2.121 + public void setTransform(double a, double b, double c, double d, double e, double f);
2.122
2.123 - @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetX;")
2.124 - double getShadowOffsetX();
2.125 + public void translate(double x, double y);
2.126
2.127 - @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetY;")
2.128 - double getShadowOffsetY();
2.129 + public void scale(double x, double y);
2.130
2.131 - @JavaScriptBody(args = {}, body = "return this._context().strokeStyle;")
2.132 - String getStrokeStyle();
2.133 + public void drawImage(Image image, double x, double y);
2.134
2.135 - @JavaScriptBody(args = {}, body = "return this._context().textAlign;")
2.136 - String getTextAlign();
2.137 + public void drawImage(Image image, double x, double y, double width, double height);
2.138
2.139 - @JavaScriptBody(args = {}, body = "return this._context().textBaseline;")
2.140 - String getTextBaseline();
2.141 + public void drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
2.142
2.143 - @JavaScriptBody(args = {"x", "y"}, body = "return this._context().isPointInPath(x,y);")
2.144 - boolean isPointInPath(double x, double y);
2.145 + public void setFillStyle(String style);
2.146
2.147 - @JavaScriptBody(args = {"x", "y"}, body = "this._context().lineTo(x,y);")
2.148 - void lineTo(double x, double y);
2.149 + public String getFillStyle();
2.150
2.151 - @JavaScriptBody(args = {"x", "y"}, body = "this._context().moveTo(x,y);")
2.152 - void moveTo(double x, double y);
2.153 + public void setFillStyle(LinearGradient style);
2.154
2.155 - @JavaScriptBody(args = {"cpx", "cpy", "x", "y"}, body = "this._context().quadraticCurveTo(cpx,cpy,x,y);")
2.156 - void quadraticCurveTo(double cpx, double cpy, double x, double y);
2.157 + public void setFillStyle(RadialGradient style);
2.158
2.159 - @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().rectect(x,y,width,height);")
2.160 - void rect(double x, double y, double width, double height);
2.161 + public void setFillStyle(Pattern style);
2.162
2.163 - @JavaScriptBody(args = {}, body = "this._context().restore();")
2.164 - void restore();
2.165 + public void setStrokeStyle(String style);
2.166
2.167 - @JavaScriptBody(args = {"angle"}, body = "this._context().rotate(angle);")
2.168 - void rotate(double angle);
2.169 + public void setStrokeStyle(LinearGradient style);
2.170
2.171 - @JavaScriptBody(args = {}, body = "this._context().save();")
2.172 - void save();
2.173 + public void setStrokeStyle(RadialGradient style);
2.174
2.175 - @JavaScriptBody(args = {"x", "y"}, body = "this._context().scale(x,y);")
2.176 - void scale(double x, double y);
2.177 + public void setStrokeStyle(Pattern style);
2.178
2.179 - @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style.valueOf();")
2.180 - void setFillStyle(String style);
2.181 + public void setShadowColor(String color);
2.182
2.183 - @JavaScriptBody(args = {"font"}, body = "this._context().font=font.valueOf();")
2.184 - void setFont(String font);
2.185 + public void setShadowBlur(double blur);
2.186
2.187 - @JavaScriptBody(args = {"alpha"}, body = "this._context().globalAlpha=alpha;")
2.188 - void setGlobalAlpha(double alpha);
2.189 + public void setShadowOffsetX(double x);
2.190
2.191 - @JavaScriptBody(args = {"operation"}, body = "this._context().globalCompositeOperation=operation.valueOf();")
2.192 - void setGlobalCompositeOperation(String operation);
2.193 + public void setShadowOffsetY(double y);
2.194
2.195 - @JavaScriptBody(args = {"style"}, body = "this._context().lineCap=style.valueOf();")
2.196 - void setLineCap(String style);
2.197 + public String getStrokeStyle();
2.198
2.199 - @JavaScriptBody(args = {"style"}, body = "this._context().lineJoin=style.valueOf();")
2.200 - void setLineJoin(String style);
2.201 + public String getShadowColor();
2.202
2.203 - @JavaScriptBody(args = {"width"}, body = "this._context().lineWidth=width;")
2.204 - void setLineWidth(double width);
2.205 + public double getShadowBlur();
2.206
2.207 - @JavaScriptBody(args = {"limit"}, body = "this._context().miterLimit=limit;")
2.208 - void setMiterLimit(double limit);
2.209 + public double getShadowOffsetX();
2.210
2.211 - @JavaScriptBody(args = {"blur"}, body = "this._context().shadowBlur=blur;")
2.212 - void setShadowBlur(double blur);
2.213 + public double getShadowOffsetY();
2.214
2.215 - @JavaScriptBody(args = {"color"}, body = "this._context().shadowColor=color.valueOf();")
2.216 - void setShadowColor(String color);
2.217 + public String getLineCap();
2.218
2.219 - @JavaScriptBody(args = {"x"}, body = "this._context().shadowOffsetX=x;")
2.220 - void setShadowOffsetX(double x);
2.221 + public void setLineCap(String style);
2.222
2.223 - @JavaScriptBody(args = {"y"}, body = "this._context().shadowOffsetY=y;")
2.224 - void setShadowOffsetY(double y);
2.225 + public String getLineJoin();
2.226
2.227 - @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();")
2.228 - void setStrokeStyle(String style);
2.229 + public void setLineJoin(String style);
2.230
2.231 - @JavaScriptBody(args = {"textalign"}, body = "this._context().textAlign=textalign.valueOf();")
2.232 - void setTextAlign(String textAlign);
2.233 + public double getLineWidth();
2.234
2.235 - @JavaScriptBody(args = {"textbaseline"}, body = "this._context().textBaseline=textbaseline.valueOf();")
2.236 - void setTextBaseline(String textbaseline);
2.237 + public void setLineWidth(double width);
2.238
2.239 - @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().setTransform(a,b,c,d,e,f);")
2.240 - void setTransform(double a, double b, double c, double d, double e, double f);
2.241 + public double getMiterLimit();
2.242
2.243 - @JavaScriptBody(args = {}, body = "this._context().stroke();")
2.244 - void stroke();
2.245 + public void setMiterLimit(double limit);
2.246
2.247 - @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().strokeRect(x,y,width,height);")
2.248 - void strokeRect(double x, double y, double width, double height);
2.249 + public String getFont();
2.250
2.251 - @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().strokeText(text,x,y);")
2.252 - void strokeText(String text, double x, double y);
2.253 + public void setFont(String font);
2.254
2.255 - @JavaScriptBody(args = {"text", "x", "y", "maxWidth"}, body = "this._context().strokeText(text,x,y,maxWidth);")
2.256 - void strokeText(String text, double x, double y, double maxWidth);
2.257 + public String getTextAlign();
2.258
2.259 - @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().transform(a,b,c,d,e,f);")
2.260 - void transform(double a, double b, double c, double d, double e, double f);
2.261 + public void setTextAlign(String textAlign);
2.262
2.263 - @JavaScriptBody(args = {"x", "y"}, body = "this._context().translate(x,y);")
2.264 - void translate(double x, double y);
2.265 -
2.266 + public String getTextBaseline();
2.267 +
2.268 + public void setTextBaseline(String textbaseline);
2.269 +
2.270 + public void fillText(String text, double x, double y);
2.271 +
2.272 + public void fillText(String text, double x, double y, double maxWidth);
2.273 +
2.274 + public TextMetrics measureText(String text);
2.275 +
2.276 + public void strokeText(String text, double x, double y);
2.277 +
2.278 + public void strokeText(String text, double x, double y, double maxWidth);
2.279 +
2.280 + public ImageData createImageData(double x, double y);
2.281 +
2.282 + public ImageData createImageData(ImageData imageData);
2.283 +
2.284 + public ImageData getImageData(double x, double y, double width, double height);
2.285 +
2.286 + public void putImageData(ImageData imageData, double x, double y);
2.287 +
2.288 + public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
2.289 +
2.290 + public void setGlobalAlpha(double alpha);
2.291 +
2.292 + public double getGlobalAlpha();
2.293 +
2.294 + public void setGlobalCompositeOperation(String operation);
2.295 +
2.296 + public String getGlobalCompositeOperation();
2.297 +
2.298 + public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1);
2.299 +
2.300 + public Pattern createPattern(Image image, String repeat);
2.301 +
2.302 + public RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
2.303 }
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Image.java Fri May 17 12:06:36 2013 +0200
3.3 @@ -0,0 +1,13 @@
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 net.java.html.canvas;
3.9 +
3.10 +/**
3.11 + *
3.12 + * @author antonepple
3.13 + */
3.14 +public interface Image {
3.15 +
3.16 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/ImageData.java Fri May 17 12:06:36 2013 +0200
4.3 @@ -0,0 +1,19 @@
4.4 +/*
4.5 + * To change this template, choose Tools | Templates
4.6 + * and open the template in the editor.
4.7 + */
4.8 +package net.java.html.canvas;
4.9 +
4.10 +
4.11 +
4.12 +/**
4.13 + *
4.14 + * @author antonepple
4.15 + */
4.16 +public interface ImageData {
4.17 +
4.18 + public double getHeight();
4.19 +
4.20 + public double getWidth();
4.21 +
4.22 +}
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/LinearGradient.java Fri May 17 12:06:36 2013 +0200
5.3 @@ -0,0 +1,13 @@
5.4 +/*
5.5 + * To change this template, choose Tools | Templates
5.6 + * and open the template in the editor.
5.7 + */
5.8 +package net.java.html.canvas;
5.9 +
5.10 +/**
5.11 + *
5.12 + * @author antonepple
5.13 + */
5.14 +public interface LinearGradient {
5.15 +
5.16 +}
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Pattern.java Fri May 17 12:06:36 2013 +0200
6.3 @@ -0,0 +1,13 @@
6.4 +/*
6.5 + * To change this template, choose Tools | Templates
6.6 + * and open the template in the editor.
6.7 + */
6.8 +package net.java.html.canvas;
6.9 +
6.10 +/**
6.11 + *
6.12 + * @author antonepple
6.13 + */
6.14 +public interface Pattern {
6.15 +
6.16 +}
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/RadialGradient.java Fri May 17 12:06:36 2013 +0200
7.3 @@ -0,0 +1,13 @@
7.4 +/*
7.5 + * To change this template, choose Tools | Templates
7.6 + * and open the template in the editor.
7.7 + */
7.8 +package net.java.html.canvas;
7.9 +
7.10 +/**
7.11 + *
7.12 + * @author antonepple
7.13 + */
7.14 +public interface RadialGradient {
7.15 +
7.16 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/TextMetrics.java Fri May 17 12:06:36 2013 +0200
8.3 @@ -0,0 +1,13 @@
8.4 +/*
8.5 + * To change this template, choose Tools | Templates
8.6 + * and open the template in the editor.
8.7 + */
8.8 +package net.java.html.canvas;
8.9 +
8.10 +/**
8.11 + *
8.12 + * @author antonepple
8.13 + */
8.14 +public interface TextMetrics {
8.15 +
8.16 +}