# HG changeset patch # User toni.epple@eppleton.de # Date 1368785196 -7200 # Node ID 8c88d0f187d8f30cbcfa16021ffafbdd1fb3194e # Parent ca05c9890031d160b2ece7fa4d42b41488e31047 Extracting interfaces from JavaQuery API. Removed first (automatic) refactoring attempt and redid it manually. diff -r ca05c9890031 -r 8c88d0f187d8 javaquery/canvas/src/main/java/net/java/html/canvas/Canvas.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Canvas.java Fri May 17 12:06:36 2013 +0200 @@ -0,0 +1,13 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.java.html.canvas; + +/** + * + * @author antonepple + */ +public interface Canvas { + +} diff -r ca05c9890031 -r 8c88d0f187d8 javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java --- a/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Fri May 17 11:00:38 2013 +0200 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java Fri May 17 12:06:36 2013 +0200 @@ -1,6 +1,19 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. +/** + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach + * + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. Look for COPYING file in the top folder. If not, see + * http://opensource.org/licenses/GPL-2.0. */ package net.java.html.canvas; @@ -12,175 +25,162 @@ */ public interface GraphicsContext { - @JavaScriptBody(args = {"centerx", "centery", "radius", "startangle", "endangle", "ccw"}, body = "this._context().arc(centerx,centery, radius, startangle, endangle,ccw);") - void arc(double centerX, double centerY, double startAngle, double radius, double endAngle, boolean ccw); + public void arc(double centerX, + double centerY, + double startAngle, + double radius, + double endAngle, + boolean ccw); - @JavaScriptBody(args = {"x1", "y1", "x2", "y2", "r"}, body = "this._context().arcTo(x1,y1,x2,y2,r);") - void arcTo(double x1, double y1, double x2, double y2, double r); + public void arcTo(double x1, + double y1, + double x2, + double y2, + double r); - @JavaScriptBody(args = {}, body = "this._context().beginPath();") - void beginPath(); + public boolean isPointInPath(double x, double y); - @JavaScriptBody(args = {"cp1x", "cp1y", "cp2x", "cp2y", "x", "y"}, body = "this._context().bezierCurveTo(cp1x,cp1y,cp2x,cp2y,x,y);") - void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y); + public void fill(); - @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().clearRect(x,y,width,height);") - void clearRect(double x, double y, double width, double height); + public void stroke(); - @JavaScriptBody(args = {}, body = "this._context().clip();") - void clip(); + public void beginPath(); - @JavaScriptBody(args = {}, body = "this._context().closePath();") - void closePath(); + public void closePath(); - @JavaScriptBody(args = {}, body = "this._context().fill();") - void fill(); + public void clip(); - @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().fillRect(x,y,width,height);") - void fillRect(double x, double y, double width, double height); + public void moveTo(double x, double y); - @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().fillText(text,x,y);") - void fillText(String text, double x, double y); + public void lineTo(double x, double y); - @JavaScriptBody(args = {"text", "x", "y", "maxwidth"}, body = "this._context().fillText(text,x,y,maxwidth);") - void fillText(String text, double x, double y, double maxWidth); + public void quadraticCurveTo(double cpx, double cpy, double x, double y); - @JavaScriptBody(args = {}, body = "return this._context().fillStyle;") - String getFillStyle(); + public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y); - @JavaScriptBody(args = {}, body = "return this._context().font;") - String getFont(); + public void fillRect(double x, double y, double width, double height); - @JavaScriptBody(args = {}, body = "return this._context().globalAlpha;") - double getGlobalAlpha(); + public void strokeRect(double x, double y, double width, double height); - @JavaScriptBody(args = {}, body = "return this._context().globalCompositeOperation;") - String getGlobalCompositeOperation(); + public void clearRect(double x, double y, double width, double height); - @JavaScriptBody(args = {}, body = "return this._context().lineCap;") - String getLineCap(); + public void rect(double x, double y, double width, double height); - @JavaScriptBody(args = {}, body = "return this._context().lineJoin;") - String getLineJoin(); + public void save(); - @JavaScriptBody(args = {}, body = "return this._context().lineWidth;") - double getLineWidth(); + public void restore(); - @JavaScriptBody(args = {}, body = "return this._context().miterLimit;") - double getMiterLimit(); + public void rotate(double angle); - @JavaScriptBody(args = {}, body = "return this._context().shadowBlur;") - double getShadowBlur(); + public void transform(double a, double b, double c, double d, double e, double f); - @JavaScriptBody(args = {}, body = "return this._context().shadowColor;") - String getShadowColor(); + public void setTransform(double a, double b, double c, double d, double e, double f); - @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetX;") - double getShadowOffsetX(); + public void translate(double x, double y); - @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetY;") - double getShadowOffsetY(); + public void scale(double x, double y); - @JavaScriptBody(args = {}, body = "return this._context().strokeStyle;") - String getStrokeStyle(); + public void drawImage(Image image, double x, double y); - @JavaScriptBody(args = {}, body = "return this._context().textAlign;") - String getTextAlign(); + public void drawImage(Image image, double x, double y, double width, double height); - @JavaScriptBody(args = {}, body = "return this._context().textBaseline;") - String getTextBaseline(); + public void drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height); - @JavaScriptBody(args = {"x", "y"}, body = "return this._context().isPointInPath(x,y);") - boolean isPointInPath(double x, double y); + public void setFillStyle(String style); - @JavaScriptBody(args = {"x", "y"}, body = "this._context().lineTo(x,y);") - void lineTo(double x, double y); + public String getFillStyle(); - @JavaScriptBody(args = {"x", "y"}, body = "this._context().moveTo(x,y);") - void moveTo(double x, double y); + public void setFillStyle(LinearGradient style); - @JavaScriptBody(args = {"cpx", "cpy", "x", "y"}, body = "this._context().quadraticCurveTo(cpx,cpy,x,y);") - void quadraticCurveTo(double cpx, double cpy, double x, double y); + public void setFillStyle(RadialGradient style); - @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().rectect(x,y,width,height);") - void rect(double x, double y, double width, double height); + public void setFillStyle(Pattern style); - @JavaScriptBody(args = {}, body = "this._context().restore();") - void restore(); + public void setStrokeStyle(String style); - @JavaScriptBody(args = {"angle"}, body = "this._context().rotate(angle);") - void rotate(double angle); + public void setStrokeStyle(LinearGradient style); - @JavaScriptBody(args = {}, body = "this._context().save();") - void save(); + public void setStrokeStyle(RadialGradient style); - @JavaScriptBody(args = {"x", "y"}, body = "this._context().scale(x,y);") - void scale(double x, double y); + public void setStrokeStyle(Pattern style); - @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style.valueOf();") - void setFillStyle(String style); + public void setShadowColor(String color); - @JavaScriptBody(args = {"font"}, body = "this._context().font=font.valueOf();") - void setFont(String font); + public void setShadowBlur(double blur); - @JavaScriptBody(args = {"alpha"}, body = "this._context().globalAlpha=alpha;") - void setGlobalAlpha(double alpha); + public void setShadowOffsetX(double x); - @JavaScriptBody(args = {"operation"}, body = "this._context().globalCompositeOperation=operation.valueOf();") - void setGlobalCompositeOperation(String operation); + public void setShadowOffsetY(double y); - @JavaScriptBody(args = {"style"}, body = "this._context().lineCap=style.valueOf();") - void setLineCap(String style); + public String getStrokeStyle(); - @JavaScriptBody(args = {"style"}, body = "this._context().lineJoin=style.valueOf();") - void setLineJoin(String style); + public String getShadowColor(); - @JavaScriptBody(args = {"width"}, body = "this._context().lineWidth=width;") - void setLineWidth(double width); + public double getShadowBlur(); - @JavaScriptBody(args = {"limit"}, body = "this._context().miterLimit=limit;") - void setMiterLimit(double limit); + public double getShadowOffsetX(); - @JavaScriptBody(args = {"blur"}, body = "this._context().shadowBlur=blur;") - void setShadowBlur(double blur); + public double getShadowOffsetY(); - @JavaScriptBody(args = {"color"}, body = "this._context().shadowColor=color.valueOf();") - void setShadowColor(String color); + public String getLineCap(); - @JavaScriptBody(args = {"x"}, body = "this._context().shadowOffsetX=x;") - void setShadowOffsetX(double x); + public void setLineCap(String style); - @JavaScriptBody(args = {"y"}, body = "this._context().shadowOffsetY=y;") - void setShadowOffsetY(double y); + public String getLineJoin(); - @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();") - void setStrokeStyle(String style); + public void setLineJoin(String style); - @JavaScriptBody(args = {"textalign"}, body = "this._context().textAlign=textalign.valueOf();") - void setTextAlign(String textAlign); + public double getLineWidth(); - @JavaScriptBody(args = {"textbaseline"}, body = "this._context().textBaseline=textbaseline.valueOf();") - void setTextBaseline(String textbaseline); + public void setLineWidth(double width); - @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().setTransform(a,b,c,d,e,f);") - void setTransform(double a, double b, double c, double d, double e, double f); + public double getMiterLimit(); - @JavaScriptBody(args = {}, body = "this._context().stroke();") - void stroke(); + public void setMiterLimit(double limit); - @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().strokeRect(x,y,width,height);") - void strokeRect(double x, double y, double width, double height); + public String getFont(); - @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().strokeText(text,x,y);") - void strokeText(String text, double x, double y); + public void setFont(String font); - @JavaScriptBody(args = {"text", "x", "y", "maxWidth"}, body = "this._context().strokeText(text,x,y,maxWidth);") - void strokeText(String text, double x, double y, double maxWidth); + public String getTextAlign(); - @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().transform(a,b,c,d,e,f);") - void transform(double a, double b, double c, double d, double e, double f); + public void setTextAlign(String textAlign); - @JavaScriptBody(args = {"x", "y"}, body = "this._context().translate(x,y);") - void translate(double x, double y); - + public String getTextBaseline(); + + public void setTextBaseline(String textbaseline); + + public void fillText(String text, double x, double y); + + public void fillText(String text, double x, double y, double maxWidth); + + public TextMetrics measureText(String text); + + public void strokeText(String text, double x, double y); + + public void strokeText(String text, double x, double y, double maxWidth); + + public ImageData createImageData(double x, double y); + + public ImageData createImageData(ImageData imageData); + + public ImageData getImageData(double x, double y, double width, double height); + + public void putImageData(ImageData imageData, double x, double y); + + public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight); + + public void setGlobalAlpha(double alpha); + + public double getGlobalAlpha(); + + public void setGlobalCompositeOperation(String operation); + + public String getGlobalCompositeOperation(); + + public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1); + + public Pattern createPattern(Image image, String repeat); + + public RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1); } diff -r ca05c9890031 -r 8c88d0f187d8 javaquery/canvas/src/main/java/net/java/html/canvas/Image.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Image.java Fri May 17 12:06:36 2013 +0200 @@ -0,0 +1,13 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.java.html.canvas; + +/** + * + * @author antonepple + */ +public interface Image { + +} diff -r ca05c9890031 -r 8c88d0f187d8 javaquery/canvas/src/main/java/net/java/html/canvas/ImageData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/ImageData.java Fri May 17 12:06:36 2013 +0200 @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.java.html.canvas; + + + +/** + * + * @author antonepple + */ +public interface ImageData { + + public double getHeight(); + + public double getWidth(); + +} diff -r ca05c9890031 -r 8c88d0f187d8 javaquery/canvas/src/main/java/net/java/html/canvas/LinearGradient.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/LinearGradient.java Fri May 17 12:06:36 2013 +0200 @@ -0,0 +1,13 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.java.html.canvas; + +/** + * + * @author antonepple + */ +public interface LinearGradient { + +} diff -r ca05c9890031 -r 8c88d0f187d8 javaquery/canvas/src/main/java/net/java/html/canvas/Pattern.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Pattern.java Fri May 17 12:06:36 2013 +0200 @@ -0,0 +1,13 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.java.html.canvas; + +/** + * + * @author antonepple + */ +public interface Pattern { + +} diff -r ca05c9890031 -r 8c88d0f187d8 javaquery/canvas/src/main/java/net/java/html/canvas/RadialGradient.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/RadialGradient.java Fri May 17 12:06:36 2013 +0200 @@ -0,0 +1,13 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.java.html.canvas; + +/** + * + * @author antonepple + */ +public interface RadialGradient { + +} diff -r ca05c9890031 -r 8c88d0f187d8 javaquery/canvas/src/main/java/net/java/html/canvas/TextMetrics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/TextMetrics.java Fri May 17 12:06:36 2013 +0200 @@ -0,0 +1,13 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.java.html.canvas; + +/** + * + * @author antonepple + */ +public interface TextMetrics { + +}