2 * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
3 * <jaroslav.tulach@apidesign.org>
5 * This program is free software: you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation, version 2 of the License.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14 * You should have received a copy of the GNU General Public License along with
15 * this program. Look for COPYING file in the top folder. If not, see
16 * http://opensource.org/licenses/GPL-2.0.
18 package net.java.html.canvas.spi;
20 import java.awt.Dimension;
21 import net.java.html.canvas.ImageData;
22 import net.java.html.canvas.Style;
25 * Provider API for Canvas. Implement this to add support for your platform.
28 public interface GraphicsEnvironment {
30 public void arc(double centerX,
37 public void arcTo(double x1,
43 public boolean isPointInPath(double x, double y);
49 public void beginPath();
51 public void closePath();
55 public void moveTo(double x, double y);
57 public void lineTo(double x, double y);
59 public void quadraticCurveTo(double cpx, double cpy, double x, double y);
61 public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
63 public void fillRect(double x, double y, double width, double height);
65 public void strokeRect(double x, double y, double width, double height);
67 public void clearRect(double x, double y, double width, double height);
69 public void rect(double x, double y, double width, double height);
73 public void restore();
75 public void rotate(double angle);
77 public void transform(double a, double b, double c, double d, double e, double f);
79 public void setTransform(double a, double b, double c, double d, double e, double f);
81 public void translate(double x, double y);
83 public void scale(double x, double y);
85 public void drawImage(ImageData image, double x, double y);
87 public void drawImage(ImageData image, double x, double y, double width, double height);
89 public void drawImage(ImageData image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
91 public void setFillStyle(String style);
93 public String getFillStyle();
95 public void setFillStyle(Style style);
97 public void setStrokeStyle(String style);
99 public void setStrokeStyle(Style style);
101 public void setShadowColor(String color);
103 public void setShadowBlur(double blur);
105 public void setShadowOffsetX(double x);
107 public void setShadowOffsetY(double y);
109 public String getStrokeStyle();
111 public String getShadowColor();
113 public double getShadowBlur();
115 public double getShadowOffsetX();
117 public double getShadowOffsetY();
119 public String getLineCap();
121 public void setLineCap(String style);
123 public String getLineJoin();
125 public void setLineJoin(String style);
127 public double getLineWidth();
129 public void setLineWidth(double width);
131 public double getMiterLimit();
133 public void setMiterLimit(double limit);
135 public String getFont();
137 public void setFont(String font);
139 public String getTextAlign();
141 public void setTextAlign(String textAlign);
143 public String getTextBaseline();
145 public void setTextBaseline(String textbaseline);
147 public void fillText(String text, double x, double y);
149 public void fillText(String text, double x, double y, double maxWidth);
151 public Dimension measureText(String text);
153 public void strokeText(String text, double x, double y);
155 public void strokeText(String text, double x, double y, double maxWidth);
157 // public ImageData createImageData(double x, double y);
159 // public ImageData createImageData(ImageData imageData);
161 // public ImageData getImageData(double x, double y, double width, double height);
163 // public void putImageData(ImageData imageData, double x, double y);
165 // public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
167 public void setGlobalAlpha(double alpha);
169 public double getGlobalAlpha();
171 public void setGlobalCompositeOperation(String operation);
173 public String getGlobalCompositeOperation();
175 // public ImageData getImageForPath(String path);
177 public int getHeight();
179 public int getWidth();
181 public void setHeight(int height);
183 public void setWidth(int width);