Simplified and separated Provider and Client API canvas
authorAnton Epple <toni.epple@eppleton.de>
Wed, 22 May 2013 16:37:51 +0200
branchcanvas
changeset 11282dc980517b36
parent 1127 39b095abcc68
child 1129 425c0c9ff88c
Simplified and separated Provider and Client API
javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java
javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsEnvironment.java
javaquery/canvas/src/main/java/net/java/html/canvas/ICanvas.java
javaquery/canvas/src/main/java/net/java/html/canvas/IGraphicsContext.java
javaquery/canvas/src/main/java/net/java/html/canvas/IImage.java
javaquery/canvas/src/main/java/net/java/html/canvas/IImageData.java
javaquery/canvas/src/main/java/net/java/html/canvas/ILinearGradient.java
javaquery/canvas/src/main/java/net/java/html/canvas/IPattern.java
javaquery/canvas/src/main/java/net/java/html/canvas/IRadialGradient.java
javaquery/canvas/src/main/java/net/java/html/canvas/ITextMetrics.java
javaquery/canvas/src/main/java/net/java/html/canvas/ImageData.java
javaquery/canvas/src/main/java/net/java/html/canvas/LinearGradient.java
javaquery/canvas/src/main/java/net/java/html/canvas/Pattern.java
javaquery/canvas/src/main/java/net/java/html/canvas/RadialGradient.java
     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	Wed May 22 16:37:51 2013 +0200
     1.3 @@ -0,0 +1,346 @@
     1.4 +/**
     1.5 + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     1.6 + * <jaroslav.tulach@apidesign.org>
     1.7 + *
     1.8 + * This program is free software: you can redistribute it and/or modify it under
     1.9 + * the terms of the GNU General Public License as published by the Free Software
    1.10 + * Foundation, version 2 of the License.
    1.11 + *
    1.12 + * This program is distributed in the hope that it will be useful, but WITHOUT
    1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    1.14 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1.15 + * details.
    1.16 + *
    1.17 + * You should have received a copy of the GNU General Public License along with
    1.18 + * this program. Look for COPYING file in the top folder. If not, see
    1.19 + * http://opensource.org/licenses/GPL-2.0.
    1.20 + */
    1.21 +package net.java.html.canvas;
    1.22 +
    1.23 +import java.awt.Dimension;
    1.24 +
    1.25 +/**
    1.26 + *
    1.27 + * @author antonepple
    1.28 + */
    1.29 +public final class GraphicsContext {
    1.30 +
    1.31 +    GraphicsEnvironment graphicsEnvironmentImpl;
    1.32 +
    1.33 +    public GraphicsContext(GraphicsEnvironment graphicsEnvironment) {
    1.34 +        this.graphicsEnvironmentImpl = graphicsEnvironment;
    1.35 +    }
    1.36 +
    1.37 +    public void arc(double centerX,
    1.38 +            double centerY,
    1.39 +            double startAngle,
    1.40 +            double radius,
    1.41 +            double endAngle,
    1.42 +            boolean ccw) {
    1.43 +        graphicsEnvironmentImpl.arc(centerX, centerY, startAngle, radius, endAngle, ccw);
    1.44 +    }
    1.45 +
    1.46 +    public void arcTo(double x1,
    1.47 +            double y1,
    1.48 +            double x2,
    1.49 +            double y2,
    1.50 +            double r) {
    1.51 +        graphicsEnvironmentImpl.arcTo(x1, y1, x2, y2, r);
    1.52 +    }
    1.53 +
    1.54 +    public boolean isPointInPath(double x, double y) {
    1.55 +        return graphicsEnvironmentImpl.isPointInPath(x, y);
    1.56 +    }
    1.57 +
    1.58 +    public void fill() {
    1.59 +        graphicsEnvironmentImpl.fill();
    1.60 +    }
    1.61 +
    1.62 +    public void stroke() {
    1.63 +        graphicsEnvironmentImpl.stroke();
    1.64 +    }
    1.65 +
    1.66 +    public void beginPath() {
    1.67 +        graphicsEnvironmentImpl.beginPath();
    1.68 +    }
    1.69 +
    1.70 +    public void closePath(){
    1.71 +        graphicsEnvironmentImpl.closePath();
    1.72 +    }
    1.73 +
    1.74 +    public void clip(){
    1.75 +        graphicsEnvironmentImpl.clip();
    1.76 +    }
    1.77 +
    1.78 +    public void moveTo(double x, double y){
    1.79 +        graphicsEnvironmentImpl.moveTo(x, y);
    1.80 +    }
    1.81 +
    1.82 +    public void lineTo(double x, double y){
    1.83 +        graphicsEnvironmentImpl.lineTo(x, y);
    1.84 +    }
    1.85 +
    1.86 +    public void quadraticCurveTo(double cpx, double cpy, double x, double y){
    1.87 +    graphicsEnvironmentImpl.quadraticCurveTo(cpx, cpy, x, y);
    1.88 +    }
    1.89 +
    1.90 +    public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y){
    1.91 +        graphicsEnvironmentImpl.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
    1.92 +    }
    1.93 +
    1.94 +    public void fillRect(double x, double y, double width, double height){
    1.95 +        graphicsEnvironmentImpl.fillRect(x, y, width, height);
    1.96 +    }
    1.97 +
    1.98 +    public void strokeRect(double x, double y, double width, double height){
    1.99 +    graphicsEnvironmentImpl.strokeRect(x, y, width, height);
   1.100 +    }
   1.101 +
   1.102 +    public void clearRect(double x, double y, double width, double height){
   1.103 +        graphicsEnvironmentImpl.clearRect(x, y, width, height);
   1.104 +    }
   1.105 +
   1.106 +    public void rect(double x, double y, double width, double height){
   1.107 +        graphicsEnvironmentImpl.rect(x, y, width, height);
   1.108 +    }
   1.109 +
   1.110 +    public void save(){
   1.111 +        graphicsEnvironmentImpl.save();
   1.112 +    }
   1.113 +
   1.114 +    public void restore(){
   1.115 +        graphicsEnvironmentImpl.restore();
   1.116 +    }
   1.117 +
   1.118 +    public void rotate(double angle){
   1.119 +        graphicsEnvironmentImpl.rotate(angle);
   1.120 +    }
   1.121 +
   1.122 +    public void transform(double a, double b, double c, double d, double e, double f){
   1.123 +        graphicsEnvironmentImpl.transform(a, b, c, d, e, f);
   1.124 +    }
   1.125 +
   1.126 +    public void setTransform(double a, double b, double c, double d, double e, double f){
   1.127 +        graphicsEnvironmentImpl.setTransform(a, b, c, d, e, f);
   1.128 +    }
   1.129 +
   1.130 +    public void translate(double x, double y){
   1.131 +        graphicsEnvironmentImpl.translate(x, y);
   1.132 +    }
   1.133 +
   1.134 +    public void scale(double x, double y){
   1.135 +        graphicsEnvironmentImpl.scale(x, y);
   1.136 +    }
   1.137 +
   1.138 +    public void drawImage(ImageData image, double x, double y){
   1.139 +        graphicsEnvironmentImpl.drawImage(image, x, y);
   1.140 +    }
   1.141 +
   1.142 +    public void drawImage(ImageData image, double x, double y, double width, double height){
   1.143 +        graphicsEnvironmentImpl.drawImage(image, x, y, width, height);
   1.144 +    }
   1.145 +
   1.146 +    public void drawImage(ImageData image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height){
   1.147 +        graphicsEnvironmentImpl.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);
   1.148 +    }
   1.149 +
   1.150 +    public void setFillStyle(String style){
   1.151 +        graphicsEnvironmentImpl.setFillStyle(style);
   1.152 +    }
   1.153 +
   1.154 +    public String getFillStyle(){
   1.155 +        return graphicsEnvironmentImpl.getFillStyle();
   1.156 +    }
   1.157 +
   1.158 +    public void setFillStyle(Pattern style){
   1.159 +        graphicsEnvironmentImpl.setFillStyle(style);
   1.160 +    }
   1.161 +
   1.162 +    public void setStrokeStyle(String style){
   1.163 +        graphicsEnvironmentImpl.setStrokeStyle(style);
   1.164 +    }
   1.165 +
   1.166 +    public void setStrokeStyle(Pattern style){
   1.167 +        graphicsEnvironmentImpl.setStrokeStyle(style);
   1.168 +    }
   1.169 +
   1.170 +    public void setShadowColor(String color){
   1.171 +        graphicsEnvironmentImpl.setShadowColor(color);
   1.172 +    }
   1.173 +
   1.174 +    public void setShadowBlur(double blur){
   1.175 +        graphicsEnvironmentImpl.setShadowBlur(blur);
   1.176 +    }
   1.177 +
   1.178 +    public void setShadowOffsetX(double x){
   1.179 +        graphicsEnvironmentImpl.setShadowOffsetX(x);
   1.180 +    }
   1.181 +
   1.182 +    public void setShadowOffsetY(double y){
   1.183 +        graphicsEnvironmentImpl.setShadowOffsetY(y);
   1.184 +    }
   1.185 +
   1.186 +    public String getStrokeStyle(){
   1.187 +        return graphicsEnvironmentImpl.getStrokeStyle();
   1.188 +    }
   1.189 +
   1.190 +    public String getShadowColor(){
   1.191 +        return graphicsEnvironmentImpl.getShadowColor();
   1.192 +    }
   1.193 +
   1.194 +    public double getShadowBlur(){
   1.195 +        return graphicsEnvironmentImpl.getShadowBlur();
   1.196 +        }
   1.197 +
   1.198 +    public double getShadowOffsetX(){
   1.199 +        return graphicsEnvironmentImpl.getShadowOffsetX();
   1.200 +    }
   1.201 +
   1.202 +    public double getShadowOffsetY(){
   1.203 +        return graphicsEnvironmentImpl.getShadowOffsetY();
   1.204 +    }
   1.205 +
   1.206 +    public String getLineCap(){
   1.207 +        return graphicsEnvironmentImpl.getLineCap();
   1.208 +    }
   1.209 +
   1.210 +    public void setLineCap(String style){
   1.211 +        graphicsEnvironmentImpl.setLineCap(style);
   1.212 +    }
   1.213 +
   1.214 +    public String getLineJoin(){
   1.215 +        return graphicsEnvironmentImpl.getLineJoin();
   1.216 +    }
   1.217 +
   1.218 +    public void setLineJoin(String style){
   1.219 +        graphicsEnvironmentImpl.setLineJoin(style);
   1.220 +    }
   1.221 +
   1.222 +    public double getLineWidth(){
   1.223 +        return graphicsEnvironmentImpl.getLineWidth();
   1.224 +    }
   1.225 +
   1.226 +    public void setLineWidth(double width){
   1.227 +        graphicsEnvironmentImpl.setLineWidth(width);
   1.228 +    }
   1.229 +
   1.230 +    public double getMiterLimit(){
   1.231 +        return graphicsEnvironmentImpl.getMiterLimit();
   1.232 +    }
   1.233 +
   1.234 +    public void setMiterLimit(double limit){
   1.235 +        graphicsEnvironmentImpl.setMiterLimit(limit);
   1.236 +    }
   1.237 +
   1.238 +    public String getFont(){
   1.239 +        return graphicsEnvironmentImpl.getFont();
   1.240 +    }
   1.241 +
   1.242 +    public void setFont(String font){
   1.243 +        graphicsEnvironmentImpl.setFont(font);
   1.244 +    }
   1.245 +
   1.246 +    public String getTextAlign(){
   1.247 +        return graphicsEnvironmentImpl.getTextAlign();
   1.248 +    }
   1.249 +
   1.250 +    public void setTextAlign(String textAlign){
   1.251 +        graphicsEnvironmentImpl.setTextAlign(textAlign);
   1.252 +    }
   1.253 +
   1.254 +    public String getTextBaseline(){
   1.255 +        return graphicsEnvironmentImpl.getTextBaseline();
   1.256 +    }
   1.257 +
   1.258 +    public void setTextBaseline(String textbaseline){
   1.259 +        graphicsEnvironmentImpl.setTextBaseline(textbaseline);
   1.260 +    }
   1.261 +
   1.262 +    public void fillText(String text, double x, double y){
   1.263 +        graphicsEnvironmentImpl.fillText(text, x, y);
   1.264 +    }
   1.265 +
   1.266 +    public void fillText(String text, double x, double y, double maxWidth){
   1.267 +        graphicsEnvironmentImpl.fillText(text, x, y, maxWidth);
   1.268 +    }
   1.269 +
   1.270 +    public Dimension measureText(String text){
   1.271 +        return graphicsEnvironmentImpl.measureText(text);
   1.272 +    }
   1.273 +
   1.274 +    public void strokeText(String text, double x, double y){
   1.275 +        graphicsEnvironmentImpl.strokeText(text, x, y);
   1.276 +    }
   1.277 +
   1.278 +    public void strokeText(String text, double x, double y, double maxWidth){
   1.279 +        graphicsEnvironmentImpl.strokeText(text, x, y, maxWidth);
   1.280 +    }
   1.281 +
   1.282 +    public ImageData createImageData(double x, double y){
   1.283 +        return graphicsEnvironmentImpl.createImageData(x, y);
   1.284 +    }
   1.285 +
   1.286 +    public ImageData createImageData(ImageData imageData){
   1.287 +        return graphicsEnvironmentImpl.createImageData(imageData);
   1.288 +    }
   1.289 +
   1.290 +    public ImageData getImageData(double x, double y, double width, double height){
   1.291 +        return graphicsEnvironmentImpl.getImageData(x, y, width, height);
   1.292 +    }
   1.293 +
   1.294 +    public void putImageData(ImageData imageData, double x, double y){
   1.295 +        graphicsEnvironmentImpl.putImageData(imageData, x, y);
   1.296 +    }
   1.297 +
   1.298 +    public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight){
   1.299 +        graphicsEnvironmentImpl.putImageData(imageData, x, y, dirtyx, dirtyy, dirtywidth, dirtyheight);
   1.300 +    }
   1.301 +
   1.302 +    public void setGlobalAlpha(double alpha){
   1.303 +        graphicsEnvironmentImpl.setGlobalAlpha(alpha);
   1.304 +    }
   1.305 +
   1.306 +    public double getGlobalAlpha(){
   1.307 +        return graphicsEnvironmentImpl.getGlobalAlpha();
   1.308 +    }
   1.309 +
   1.310 +    public void setGlobalCompositeOperation(String operation){
   1.311 +        graphicsEnvironmentImpl.setGlobalCompositeOperation(operation);
   1.312 +    }
   1.313 +
   1.314 +    public String getGlobalCompositeOperation(){
   1.315 +        return graphicsEnvironmentImpl.getGlobalCompositeOperation();
   1.316 +    }
   1.317 +
   1.318 +    public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1){
   1.319 +        return graphicsEnvironmentImpl.createLinearGradient(x0, y0, x1, y1);
   1.320 +    }
   1.321 +
   1.322 +    public Pattern createPattern(ImageData image, String repeat){
   1.323 +        return graphicsEnvironmentImpl.createPattern(image, repeat);
   1.324 +    }
   1.325 +
   1.326 +    public RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1){
   1.327 +        return graphicsEnvironmentImpl.createRadialGradient(x0, y0, r0, x1, y1, r1);
   1.328 +    }
   1.329 +
   1.330 +    public ImageData getImageForPath(String path){
   1.331 +        return graphicsEnvironmentImpl.getImageForPath(path);
   1.332 +    }
   1.333 +
   1.334 +    public int getHeight(){
   1.335 +        return graphicsEnvironmentImpl.getHeight();
   1.336 +    }
   1.337 +
   1.338 +    public int getWidth(){
   1.339 +        return graphicsEnvironmentImpl.getWidth();
   1.340 +    }
   1.341 +
   1.342 +    public void setHeight(int height){
   1.343 +        graphicsEnvironmentImpl.setHeight(height);
   1.344 +    }
   1.345 +
   1.346 +    public void setWidth(int width){
   1.347 +        graphicsEnvironmentImpl.setWidth(width);
   1.348 +    }
   1.349 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsEnvironment.java	Wed May 22 16:37:51 2013 +0200
     2.3 @@ -0,0 +1,175 @@
     2.4 +/*
     2.5 + * To change this template, choose Tools | Templates
     2.6 + * and open the template in the editor.
     2.7 + */
     2.8 +package net.java.html.canvas;
     2.9 +
    2.10 +import java.awt.Dimension;
    2.11 +
    2.12 +/**
    2.13 + *
    2.14 + * @author antonepple
    2.15 + */
    2.16 +public interface GraphicsEnvironment {
    2.17 +    public void arc(double centerX,
    2.18 +            double centerY,
    2.19 +            double startAngle,
    2.20 +            double radius,
    2.21 +            double endAngle,
    2.22 +            boolean ccw);
    2.23 +
    2.24 +    public void arcTo(double x1,
    2.25 +            double y1,
    2.26 +            double x2,
    2.27 +            double y2,
    2.28 +            double r);
    2.29 +
    2.30 +    public boolean isPointInPath(double x, double y);
    2.31 +
    2.32 +    public void fill();
    2.33 +
    2.34 +    public void stroke();
    2.35 +
    2.36 +    public void beginPath();
    2.37 +
    2.38 +    public void closePath();
    2.39 +
    2.40 +    public void clip();
    2.41 +
    2.42 +    public void moveTo(double x, double y);
    2.43 +
    2.44 +    public void lineTo(double x, double y);
    2.45 +
    2.46 +    public void quadraticCurveTo(double cpx, double cpy, double x, double y);
    2.47 +
    2.48 +    public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
    2.49 +
    2.50 +    public void fillRect(double x, double y, double width, double height);
    2.51 +
    2.52 +    public void strokeRect(double x, double y, double width, double height);
    2.53 +
    2.54 +    public void clearRect(double x, double y, double width, double height);
    2.55 +
    2.56 +    public void rect(double x, double y, double width, double height);
    2.57 +
    2.58 +    public void save();
    2.59 +
    2.60 +    public void restore();
    2.61 +
    2.62 +    public void rotate(double angle);
    2.63 +
    2.64 +    public void transform(double a, double b, double c, double d, double e, double f);
    2.65 +
    2.66 +    public void setTransform(double a, double b, double c, double d, double e, double f);
    2.67 +
    2.68 +    public void translate(double x, double y);
    2.69 +
    2.70 +    public void scale(double x, double y);
    2.71 +
    2.72 +    public void drawImage(ImageData image, double x, double y);
    2.73 +
    2.74 +    public void drawImage(ImageData image, double x, double y, double width, double height);
    2.75 +
    2.76 +    public void drawImage(ImageData image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
    2.77 +
    2.78 +    public void setFillStyle(String style);
    2.79 +
    2.80 +    public String getFillStyle();
    2.81 +
    2.82 +    public void setFillStyle(Pattern style);
    2.83 +
    2.84 +    public void setStrokeStyle(String style);
    2.85 +
    2.86 +    public void setStrokeStyle(Pattern style);
    2.87 +
    2.88 +    public void setShadowColor(String color);
    2.89 +
    2.90 +    public void setShadowBlur(double blur);
    2.91 +
    2.92 +    public void setShadowOffsetX(double x);
    2.93 +
    2.94 +    public void setShadowOffsetY(double y);
    2.95 +
    2.96 +    public String getStrokeStyle();
    2.97 +
    2.98 +    public String getShadowColor();
    2.99 +
   2.100 +    public double getShadowBlur();
   2.101 +
   2.102 +    public double getShadowOffsetX();
   2.103 +
   2.104 +    public double getShadowOffsetY();
   2.105 +
   2.106 +    public String getLineCap();
   2.107 +
   2.108 +    public void setLineCap(String style);
   2.109 +
   2.110 +    public String getLineJoin();
   2.111 +
   2.112 +    public void setLineJoin(String style);
   2.113 +
   2.114 +    public double getLineWidth();
   2.115 +
   2.116 +    public void setLineWidth(double width);
   2.117 +
   2.118 +    public double getMiterLimit();
   2.119 +
   2.120 +    public void setMiterLimit(double limit);
   2.121 +
   2.122 +    public String getFont();
   2.123 +
   2.124 +    public void setFont(String font);
   2.125 +
   2.126 +    public String getTextAlign();
   2.127 +
   2.128 +    public void setTextAlign(String textAlign);
   2.129 +
   2.130 +    public String getTextBaseline();
   2.131 +
   2.132 +    public void setTextBaseline(String textbaseline);
   2.133 +
   2.134 +    public void fillText(String text, double x, double y);
   2.135 +
   2.136 +    public void fillText(String text, double x, double y, double maxWidth);
   2.137 +
   2.138 +    public Dimension measureText(String text);
   2.139 +
   2.140 +    public void strokeText(String text, double x, double y);
   2.141 +
   2.142 +    public void strokeText(String text, double x, double y, double maxWidth);
   2.143 +
   2.144 +    public ImageData createImageData(double x, double y);
   2.145 +
   2.146 +    public ImageData createImageData(ImageData imageData);
   2.147 +
   2.148 +    public ImageData getImageData(double x, double y, double width, double height);
   2.149 +
   2.150 +    public void putImageData(ImageData imageData, double x, double y);
   2.151 +
   2.152 +    public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
   2.153 +
   2.154 +    public void setGlobalAlpha(double alpha);
   2.155 +
   2.156 +    public double getGlobalAlpha();
   2.157 +
   2.158 +    public void setGlobalCompositeOperation(String operation);
   2.159 +
   2.160 +    public String getGlobalCompositeOperation();
   2.161 +
   2.162 +    public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1);
   2.163 +
   2.164 +    public Pattern createPattern(ImageData image, String repeat);
   2.165 +
   2.166 +    public RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
   2.167 +    
   2.168 +    public ImageData getImageForPath(String path);
   2.169 +    
   2.170 +    public int getHeight();
   2.171 +
   2.172 +    public int getWidth();
   2.173 +
   2.174 +    public void setHeight(int height);
   2.175 +
   2.176 +    public void setWidth(int width);
   2.177 +    
   2.178 +}
     3.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/ICanvas.java	Wed May 22 12:10:54 2013 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,37 +0,0 @@
     3.4 -/**
     3.5 - * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     3.6 - * <jaroslav.tulach@apidesign.org>
     3.7 - *
     3.8 - * This program is free software: you can redistribute it and/or modify it under
     3.9 - * the terms of the GNU General Public License as published by the Free Software
    3.10 - * Foundation, version 2 of the License.
    3.11 - *
    3.12 - * This program is distributed in the hope that it will be useful, but WITHOUT
    3.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    3.14 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    3.15 - * details.
    3.16 - *
    3.17 - * You should have received a copy of the GNU General Public License along with
    3.18 - * this program. Look for COPYING file in the top folder. If not, see
    3.19 - * http://opensource.org/licenses/GPL-2.0.
    3.20 - */
    3.21 -package net.java.html.canvas;
    3.22 -
    3.23 -
    3.24 -/**
    3.25 - *
    3.26 - * @author antonepple
    3.27 - */
    3.28 -public interface ICanvas {
    3.29 -
    3.30 -    IGraphicsContext getContext();
    3.31 -
    3.32 -    int getHeight();
    3.33 -
    3.34 -    int getWidth();
    3.35 -
    3.36 -    void setHeight(int height);
    3.37 -
    3.38 -    void setWidth(int width);
    3.39 -    
    3.40 -}
     4.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/IGraphicsContext.java	Wed May 22 12:10:54 2013 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,187 +0,0 @@
     4.4 -/**
     4.5 - * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     4.6 - * <jaroslav.tulach@apidesign.org>
     4.7 - *
     4.8 - * This program is free software: you can redistribute it and/or modify it under
     4.9 - * the terms of the GNU General Public License as published by the Free Software
    4.10 - * Foundation, version 2 of the License.
    4.11 - *
    4.12 - * This program is distributed in the hope that it will be useful, but WITHOUT
    4.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    4.14 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    4.15 - * details.
    4.16 - *
    4.17 - * You should have received a copy of the GNU General Public License along with
    4.18 - * this program. Look for COPYING file in the top folder. If not, see
    4.19 - * http://opensource.org/licenses/GPL-2.0.
    4.20 - */
    4.21 -package net.java.html.canvas;
    4.22 -
    4.23 -
    4.24 -/**
    4.25 - *
    4.26 - * @author antonepple
    4.27 - */
    4.28 -public interface IGraphicsContext {
    4.29 -
    4.30 -    public void arc(double centerX,
    4.31 -            double centerY,
    4.32 -            double startAngle,
    4.33 -            double radius,
    4.34 -            double endAngle,
    4.35 -            boolean ccw);
    4.36 -
    4.37 -    public void arcTo(double x1,
    4.38 -            double y1,
    4.39 -            double x2,
    4.40 -            double y2,
    4.41 -            double r);
    4.42 -
    4.43 -    public boolean isPointInPath(double x, double y);
    4.44 -
    4.45 -    public void fill();
    4.46 -
    4.47 -    public void stroke();
    4.48 -
    4.49 -    public void beginPath();
    4.50 -
    4.51 -    public void closePath();
    4.52 -
    4.53 -    public void clip();
    4.54 -
    4.55 -    public void moveTo(double x, double y);
    4.56 -
    4.57 -    public void lineTo(double x, double y);
    4.58 -
    4.59 -    public void quadraticCurveTo(double cpx, double cpy, double x, double y);
    4.60 -
    4.61 -    public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
    4.62 -
    4.63 -    public void fillRect(double x, double y, double width, double height);
    4.64 -
    4.65 -    public void strokeRect(double x, double y, double width, double height);
    4.66 -
    4.67 -    public void clearRect(double x, double y, double width, double height);
    4.68 -
    4.69 -    public void rect(double x, double y, double width, double height);
    4.70 -
    4.71 -    public void save();
    4.72 -
    4.73 -    public void restore();
    4.74 -
    4.75 -    public void rotate(double angle);
    4.76 -
    4.77 -    public void transform(double a, double b, double c, double d, double e, double f);
    4.78 -
    4.79 -    public void setTransform(double a, double b, double c, double d, double e, double f);
    4.80 -
    4.81 -    public void translate(double x, double y);
    4.82 -
    4.83 -    public void scale(double x, double y);
    4.84 -
    4.85 -    public void drawImage(IImage image, double x, double y);
    4.86 -
    4.87 -    public void drawImage(IImage image, double x, double y, double width, double height);
    4.88 -
    4.89 -    public void drawImage(IImage image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
    4.90 -
    4.91 -    public void setFillStyle(String style);
    4.92 -
    4.93 -    public String getFillStyle();
    4.94 -
    4.95 -    public void setFillStyle(ILinearGradient style);
    4.96 -
    4.97 -    public void setFillStyle(IRadialGradient style);
    4.98 -
    4.99 -    public void setFillStyle(IPattern style);
   4.100 -
   4.101 -    public void setStrokeStyle(String style);
   4.102 -
   4.103 -    public void setStrokeStyle(ILinearGradient style);
   4.104 -
   4.105 -    public void setStrokeStyle(IRadialGradient style);
   4.106 -
   4.107 -    public void setStrokeStyle(IPattern style);
   4.108 -
   4.109 -    public void setShadowColor(String color);
   4.110 -
   4.111 -    public void setShadowBlur(double blur);
   4.112 -
   4.113 -    public void setShadowOffsetX(double x);
   4.114 -
   4.115 -    public void setShadowOffsetY(double y);
   4.116 -
   4.117 -    public String getStrokeStyle();
   4.118 -
   4.119 -    public String getShadowColor();
   4.120 -
   4.121 -    public double getShadowBlur();
   4.122 -
   4.123 -    public double getShadowOffsetX();
   4.124 -
   4.125 -    public double getShadowOffsetY();
   4.126 -
   4.127 -    public String getLineCap();
   4.128 -
   4.129 -    public void setLineCap(String style);
   4.130 -
   4.131 -    public String getLineJoin();
   4.132 -
   4.133 -    public void setLineJoin(String style);
   4.134 -
   4.135 -    public double getLineWidth();
   4.136 -
   4.137 -    public void setLineWidth(double width);
   4.138 -
   4.139 -    public double getMiterLimit();
   4.140 -
   4.141 -    public void setMiterLimit(double limit);
   4.142 -
   4.143 -    public String getFont();
   4.144 -
   4.145 -    public void setFont(String font);
   4.146 -
   4.147 -    public String getTextAlign();
   4.148 -
   4.149 -    public void setTextAlign(String textAlign);
   4.150 -
   4.151 -    public String getTextBaseline();
   4.152 -
   4.153 -    public void setTextBaseline(String textbaseline);
   4.154 -
   4.155 -    public void fillText(String text, double x, double y);
   4.156 -
   4.157 -    public void fillText(String text, double x, double y, double maxWidth);
   4.158 -
   4.159 -    public ITextMetrics measureText(String text);
   4.160 -
   4.161 -    public void strokeText(String text, double x, double y);
   4.162 -
   4.163 -    public void strokeText(String text, double x, double y, double maxWidth);
   4.164 -
   4.165 -    public IImageData createImageData(double x, double y);
   4.166 -
   4.167 -    public IImageData createImageData(IImageData imageData);
   4.168 -
   4.169 -    public IImageData getImageData(double x, double y, double width, double height);
   4.170 -
   4.171 -    public void putImageData(IImageData imageData, double x, double y);
   4.172 -
   4.173 -    public void putImageData(IImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
   4.174 -
   4.175 -    public void setGlobalAlpha(double alpha);
   4.176 -
   4.177 -    public double getGlobalAlpha();
   4.178 -
   4.179 -    public void setGlobalCompositeOperation(String operation);
   4.180 -
   4.181 -    public String getGlobalCompositeOperation();
   4.182 -
   4.183 -    public ILinearGradient createLinearGradient(double x0, double y0, double x1, double y1);
   4.184 -
   4.185 -    public IPattern createPattern(IImage image, String repeat);
   4.186 -
   4.187 -    public IRadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
   4.188 -    
   4.189 -    public IImage getImageForPath(String path);
   4.190 -}
     5.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/IImage.java	Wed May 22 12:10:54 2013 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,32 +0,0 @@
     5.4 -/**
     5.5 - * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     5.6 - * <jaroslav.tulach@apidesign.org>
     5.7 - *
     5.8 - * This program is free software: you can redistribute it and/or modify it under
     5.9 - * the terms of the GNU General Public License as published by the Free Software
    5.10 - * Foundation, version 2 of the License.
    5.11 - *
    5.12 - * This program is distributed in the hope that it will be useful, but WITHOUT
    5.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    5.14 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    5.15 - * details.
    5.16 - *
    5.17 - * You should have received a copy of the GNU General Public License along with
    5.18 - * this program. Look for COPYING file in the top folder. If not, see
    5.19 - * http://opensource.org/licenses/GPL-2.0.
    5.20 - */
    5.21 -package net.java.html.canvas;
    5.22 -
    5.23 -/**
    5.24 - *
    5.25 - * @author antonepple
    5.26 - */
    5.27 -public interface IImage {
    5.28 -    
    5.29 -    
    5.30 -    public int getHeight();
    5.31 -    
    5.32 -    public int getWidth();
    5.33 -    
    5.34 -    
    5.35 -}
     6.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/IImageData.java	Wed May 22 12:10:54 2013 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,32 +0,0 @@
     6.4 -/**
     6.5 - * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     6.6 - * <jaroslav.tulach@apidesign.org>
     6.7 - *
     6.8 - * This program is free software: you can redistribute it and/or modify it under
     6.9 - * the terms of the GNU General Public License as published by the Free Software
    6.10 - * Foundation, version 2 of the License.
    6.11 - *
    6.12 - * This program is distributed in the hope that it will be useful, but WITHOUT
    6.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    6.14 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    6.15 - * details.
    6.16 - *
    6.17 - * You should have received a copy of the GNU General Public License along with
    6.18 - * this program. Look for COPYING file in the top folder. If not, see
    6.19 - * http://opensource.org/licenses/GPL-2.0.
    6.20 - */
    6.21 -package net.java.html.canvas;
    6.22 -
    6.23 -
    6.24 -
    6.25 -/**
    6.26 - *
    6.27 - * @author antonepple
    6.28 - */
    6.29 -public interface IImageData {
    6.30 -
    6.31 -    public double getHeight();
    6.32 -
    6.33 -    public double getWidth();
    6.34 -    
    6.35 -}
     7.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/ILinearGradient.java	Wed May 22 12:10:54 2013 +0200
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,28 +0,0 @@
     7.4 -/**
     7.5 - * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     7.6 - * <jaroslav.tulach@apidesign.org>
     7.7 - *
     7.8 - * This program is free software: you can redistribute it and/or modify it under
     7.9 - * the terms of the GNU General Public License as published by the Free Software
    7.10 - * Foundation, version 2 of the License.
    7.11 - *
    7.12 - * This program is distributed in the hope that it will be useful, but WITHOUT
    7.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    7.14 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    7.15 - * details.
    7.16 - *
    7.17 - * You should have received a copy of the GNU General Public License along with
    7.18 - * this program. Look for COPYING file in the top folder. If not, see
    7.19 - * http://opensource.org/licenses/GPL-2.0.
    7.20 - */
    7.21 -package net.java.html.canvas;
    7.22 -
    7.23 -/**
    7.24 - *
    7.25 - * @author antonepple
    7.26 - */
    7.27 -public interface ILinearGradient {
    7.28 -
    7.29 -    void addColorStop(double position, String color);
    7.30 -    
    7.31 -}
     8.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/IPattern.java	Wed May 22 12:10:54 2013 +0200
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,26 +0,0 @@
     8.4 -/**
     8.5 - * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     8.6 - * <jaroslav.tulach@apidesign.org>
     8.7 - *
     8.8 - * This program is free software: you can redistribute it and/or modify it under
     8.9 - * the terms of the GNU General Public License as published by the Free Software
    8.10 - * Foundation, version 2 of the License.
    8.11 - *
    8.12 - * This program is distributed in the hope that it will be useful, but WITHOUT
    8.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    8.14 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    8.15 - * details.
    8.16 - *
    8.17 - * You should have received a copy of the GNU General Public License along with
    8.18 - * this program. Look for COPYING file in the top folder. If not, see
    8.19 - * http://opensource.org/licenses/GPL-2.0.
    8.20 - */
    8.21 -package net.java.html.canvas;
    8.22 -
    8.23 -/**
    8.24 - *
    8.25 - * @author antonepple
    8.26 - */
    8.27 -public interface IPattern {
    8.28 -    
    8.29 -}
     9.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/IRadialGradient.java	Wed May 22 12:10:54 2013 +0200
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,28 +0,0 @@
     9.4 -/**
     9.5 - * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     9.6 - * <jaroslav.tulach@apidesign.org>
     9.7 - *
     9.8 - * This program is free software: you can redistribute it and/or modify it under
     9.9 - * the terms of the GNU General Public License as published by the Free Software
    9.10 - * Foundation, version 2 of the License.
    9.11 - *
    9.12 - * This program is distributed in the hope that it will be useful, but WITHOUT
    9.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    9.14 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    9.15 - * details.
    9.16 - *
    9.17 - * You should have received a copy of the GNU General Public License along with
    9.18 - * this program. Look for COPYING file in the top folder. If not, see
    9.19 - * http://opensource.org/licenses/GPL-2.0.
    9.20 - */
    9.21 -package net.java.html.canvas;
    9.22 -
    9.23 -/**
    9.24 - *
    9.25 - * @author antonepple
    9.26 - */
    9.27 -public interface IRadialGradient {
    9.28 -
    9.29 -    void addColorStop(double position, String color);
    9.30 -    
    9.31 -}
    10.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/ITextMetrics.java	Wed May 22 12:10:54 2013 +0200
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,30 +0,0 @@
    10.4 -/**
    10.5 - * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
    10.6 - * <jaroslav.tulach@apidesign.org>
    10.7 - *
    10.8 - * This program is free software: you can redistribute it and/or modify it under
    10.9 - * the terms of the GNU General Public License as published by the Free Software
   10.10 - * Foundation, version 2 of the License.
   10.11 - *
   10.12 - * This program is distributed in the hope that it will be useful, but WITHOUT
   10.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   10.14 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
   10.15 - * details.
   10.16 - *
   10.17 - * You should have received a copy of the GNU General Public License along with
   10.18 - * this program. Look for COPYING file in the top folder. If not, see
   10.19 - * http://opensource.org/licenses/GPL-2.0.
   10.20 - */
   10.21 -package net.java.html.canvas;
   10.22 -
   10.23 -/**
   10.24 - *
   10.25 - * @author antonepple
   10.26 - */
   10.27 -public interface ITextMetrics {
   10.28 -
   10.29 -    double getHeight();
   10.30 -
   10.31 -    double getWidth();
   10.32 -    
   10.33 -}
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/ImageData.java	Wed May 22 16:37:51 2013 +0200
    11.3 @@ -0,0 +1,36 @@
    11.4 +/**
    11.5 + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
    11.6 + * <jaroslav.tulach@apidesign.org>
    11.7 + *
    11.8 + * This program is free software: you can redistribute it and/or modify it under
    11.9 + * the terms of the GNU General Public License as published by the Free Software
   11.10 + * Foundation, version 2 of the License.
   11.11 + *
   11.12 + * This program is distributed in the hope that it will be useful, but WITHOUT
   11.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   11.14 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
   11.15 + * details.
   11.16 + *
   11.17 + * You should have received a copy of the GNU General Public License along with
   11.18 + * this program. Look for COPYING file in the top folder. If not, see
   11.19 + * http://opensource.org/licenses/GPL-2.0.
   11.20 + */
   11.21 +package net.java.html.canvas;
   11.22 +
   11.23 +
   11.24 +
   11.25 +/**
   11.26 + *
   11.27 + * @author antonepple
   11.28 + */
   11.29 +public interface ImageData {
   11.30 +
   11.31 +    public double getHeight();
   11.32 +
   11.33 +    public double getWidth();
   11.34 +    
   11.35 +    public int getValueAt(double x, double y);
   11.36 +    
   11.37 +    public void setValueAt(double x, double y, int value);
   11.38 +    
   11.39 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/LinearGradient.java	Wed May 22 16:37:51 2013 +0200
    12.3 @@ -0,0 +1,28 @@
    12.4 +/**
    12.5 + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
    12.6 + * <jaroslav.tulach@apidesign.org>
    12.7 + *
    12.8 + * This program is free software: you can redistribute it and/or modify it under
    12.9 + * the terms of the GNU General Public License as published by the Free Software
   12.10 + * Foundation, version 2 of the License.
   12.11 + *
   12.12 + * This program is distributed in the hope that it will be useful, but WITHOUT
   12.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   12.14 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
   12.15 + * details.
   12.16 + *
   12.17 + * You should have received a copy of the GNU General Public License along with
   12.18 + * this program. Look for COPYING file in the top folder. If not, see
   12.19 + * http://opensource.org/licenses/GPL-2.0.
   12.20 + */
   12.21 +package net.java.html.canvas;
   12.22 +
   12.23 +/**
   12.24 + *
   12.25 + * @author antonepple
   12.26 + */
   12.27 +public interface LinearGradient extends Pattern{
   12.28 +
   12.29 +    void addColorStop(double position, String color);
   12.30 +    
   12.31 +}
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Pattern.java	Wed May 22 16:37:51 2013 +0200
    13.3 @@ -0,0 +1,26 @@
    13.4 +/**
    13.5 + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
    13.6 + * <jaroslav.tulach@apidesign.org>
    13.7 + *
    13.8 + * This program is free software: you can redistribute it and/or modify it under
    13.9 + * the terms of the GNU General Public License as published by the Free Software
   13.10 + * Foundation, version 2 of the License.
   13.11 + *
   13.12 + * This program is distributed in the hope that it will be useful, but WITHOUT
   13.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   13.14 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
   13.15 + * details.
   13.16 + *
   13.17 + * You should have received a copy of the GNU General Public License along with
   13.18 + * this program. Look for COPYING file in the top folder. If not, see
   13.19 + * http://opensource.org/licenses/GPL-2.0.
   13.20 + */
   13.21 +package net.java.html.canvas;
   13.22 +
   13.23 +/**
   13.24 + *
   13.25 + * @author antonepple
   13.26 + */
   13.27 +public interface Pattern {
   13.28 +    
   13.29 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/RadialGradient.java	Wed May 22 16:37:51 2013 +0200
    14.3 @@ -0,0 +1,28 @@
    14.4 +/**
    14.5 + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
    14.6 + * <jaroslav.tulach@apidesign.org>
    14.7 + *
    14.8 + * This program is free software: you can redistribute it and/or modify it under
    14.9 + * the terms of the GNU General Public License as published by the Free Software
   14.10 + * Foundation, version 2 of the License.
   14.11 + *
   14.12 + * This program is distributed in the hope that it will be useful, but WITHOUT
   14.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   14.14 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
   14.15 + * details.
   14.16 + *
   14.17 + * You should have received a copy of the GNU General Public License along with
   14.18 + * this program. Look for COPYING file in the top folder. If not, see
   14.19 + * http://opensource.org/licenses/GPL-2.0.
   14.20 + */
   14.21 +package net.java.html.canvas;
   14.22 +
   14.23 +/**
   14.24 + *
   14.25 + * @author antonepple
   14.26 + */
   14.27 +public interface RadialGradient extends LinearGradient{
   14.28 +
   14.29 +    void addColorStop(double position, String color);
   14.30 +    
   14.31 +}