1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Thu May 23 15:36:42 2013 +0200
1.3 @@ -0,0 +1,184 @@
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.spi;
1.22 +
1.23 +import java.awt.Dimension;
1.24 +import net.java.html.canvas.ImageData;
1.25 +import net.java.html.canvas.Style;
1.26 +
1.27 +/**
1.28 + * Provider API for Canvas. Implement this to add support for your platform.
1.29 + * @author antonepple
1.30 + */
1.31 +public interface GraphicsEnvironment {
1.32 +
1.33 + public void arc(double centerX,
1.34 + double centerY,
1.35 + double startAngle,
1.36 + double radius,
1.37 + double endAngle,
1.38 + boolean ccw);
1.39 +
1.40 + public void arcTo(double x1,
1.41 + double y1,
1.42 + double x2,
1.43 + double y2,
1.44 + double r);
1.45 +
1.46 + public boolean isPointInPath(double x, double y);
1.47 +
1.48 + public void fill();
1.49 +
1.50 + public void stroke();
1.51 +
1.52 + public void beginPath();
1.53 +
1.54 + public void closePath();
1.55 +
1.56 + public void clip();
1.57 +
1.58 + public void moveTo(double x, double y);
1.59 +
1.60 + public void lineTo(double x, double y);
1.61 +
1.62 + public void quadraticCurveTo(double cpx, double cpy, double x, double y);
1.63 +
1.64 + public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
1.65 +
1.66 + public void fillRect(double x, double y, double width, double height);
1.67 +
1.68 + public void strokeRect(double x, double y, double width, double height);
1.69 +
1.70 + public void clearRect(double x, double y, double width, double height);
1.71 +
1.72 + public void rect(double x, double y, double width, double height);
1.73 +
1.74 + public void save();
1.75 +
1.76 + public void restore();
1.77 +
1.78 + public void rotate(double angle);
1.79 +
1.80 + public void transform(double a, double b, double c, double d, double e, double f);
1.81 +
1.82 + public void setTransform(double a, double b, double c, double d, double e, double f);
1.83 +
1.84 + public void translate(double x, double y);
1.85 +
1.86 + public void scale(double x, double y);
1.87 +
1.88 + public void drawImage(ImageData image, double x, double y);
1.89 +
1.90 + public void drawImage(ImageData image, double x, double y, double width, double height);
1.91 +
1.92 + public void drawImage(ImageData image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
1.93 +
1.94 + public void setFillStyle(String style);
1.95 +
1.96 + public String getFillStyle();
1.97 +
1.98 + public void setFillStyle(Style style);
1.99 +
1.100 + public void setStrokeStyle(String style);
1.101 +
1.102 + public void setStrokeStyle(Style style);
1.103 +
1.104 + public void setShadowColor(String color);
1.105 +
1.106 + public void setShadowBlur(double blur);
1.107 +
1.108 + public void setShadowOffsetX(double x);
1.109 +
1.110 + public void setShadowOffsetY(double y);
1.111 +
1.112 + public String getStrokeStyle();
1.113 +
1.114 + public String getShadowColor();
1.115 +
1.116 + public double getShadowBlur();
1.117 +
1.118 + public double getShadowOffsetX();
1.119 +
1.120 + public double getShadowOffsetY();
1.121 +
1.122 + public String getLineCap();
1.123 +
1.124 + public void setLineCap(String style);
1.125 +
1.126 + public String getLineJoin();
1.127 +
1.128 + public void setLineJoin(String style);
1.129 +
1.130 + public double getLineWidth();
1.131 +
1.132 + public void setLineWidth(double width);
1.133 +
1.134 + public double getMiterLimit();
1.135 +
1.136 + public void setMiterLimit(double limit);
1.137 +
1.138 + public String getFont();
1.139 +
1.140 + public void setFont(String font);
1.141 +
1.142 + public String getTextAlign();
1.143 +
1.144 + public void setTextAlign(String textAlign);
1.145 +
1.146 + public String getTextBaseline();
1.147 +
1.148 + public void setTextBaseline(String textbaseline);
1.149 +
1.150 + public void fillText(String text, double x, double y);
1.151 +
1.152 + public void fillText(String text, double x, double y, double maxWidth);
1.153 +
1.154 + public Dimension measureText(String text);
1.155 +
1.156 + public void strokeText(String text, double x, double y);
1.157 +
1.158 + public void strokeText(String text, double x, double y, double maxWidth);
1.159 +
1.160 +// public ImageData createImageData(double x, double y);
1.161 +//
1.162 +// public ImageData createImageData(ImageData imageData);
1.163 +//
1.164 +// public ImageData getImageData(double x, double y, double width, double height);
1.165 +//
1.166 +// public void putImageData(ImageData imageData, double x, double y);
1.167 +//
1.168 +// public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
1.169 +
1.170 + public void setGlobalAlpha(double alpha);
1.171 +
1.172 + public double getGlobalAlpha();
1.173 +
1.174 + public void setGlobalCompositeOperation(String operation);
1.175 +
1.176 + public String getGlobalCompositeOperation();
1.177 +
1.178 +// public ImageData getImageForPath(String path);
1.179 +
1.180 + public int getHeight();
1.181 +
1.182 + public int getWidth();
1.183 +
1.184 + public void setHeight(int height);
1.185 +
1.186 + public void setWidth(int width);
1.187 +}