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;
20 import java.awt.Dimension;
26 public interface GraphicsEnvironment {
28 public void arc(double centerX,
35 public void arcTo(double x1,
41 public boolean isPointInPath(double x, double y);
47 public void beginPath();
49 public void closePath();
53 public void moveTo(double x, double y);
55 public void lineTo(double x, double y);
57 public void quadraticCurveTo(double cpx, double cpy, double x, double y);
59 public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
61 public void fillRect(double x, double y, double width, double height);
63 public void strokeRect(double x, double y, double width, double height);
65 public void clearRect(double x, double y, double width, double height);
67 public void rect(double x, double y, double width, double height);
71 public void restore();
73 public void rotate(double angle);
75 public void transform(double a, double b, double c, double d, double e, double f);
77 public void setTransform(double a, double b, double c, double d, double e, double f);
79 public void translate(double x, double y);
81 public void scale(double x, double y);
83 public void drawImage(ImageData image, double x, double y);
85 public void drawImage(ImageData image, double x, double y, double width, double height);
87 public void drawImage(ImageData image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
89 public void setFillStyle(String style);
91 public String getFillStyle();
93 public void setFillStyle(Style style);
95 public void setStrokeStyle(String style);
97 public void setStrokeStyle(Style style);
99 public void setShadowColor(String color);
101 public void setShadowBlur(double blur);
103 public void setShadowOffsetX(double x);
105 public void setShadowOffsetY(double y);
107 public String getStrokeStyle();
109 public String getShadowColor();
111 public double getShadowBlur();
113 public double getShadowOffsetX();
115 public double getShadowOffsetY();
117 public String getLineCap();
119 public void setLineCap(String style);
121 public String getLineJoin();
123 public void setLineJoin(String style);
125 public double getLineWidth();
127 public void setLineWidth(double width);
129 public double getMiterLimit();
131 public void setMiterLimit(double limit);
133 public String getFont();
135 public void setFont(String font);
137 public String getTextAlign();
139 public void setTextAlign(String textAlign);
141 public String getTextBaseline();
143 public void setTextBaseline(String textbaseline);
145 public void fillText(String text, double x, double y);
147 public void fillText(String text, double x, double y, double maxWidth);
149 public Dimension measureText(String text);
151 public void strokeText(String text, double x, double y);
153 public void strokeText(String text, double x, double y, double maxWidth);
155 public ImageData createImageData(double x, double y);
157 public ImageData createImageData(ImageData imageData);
159 public ImageData getImageData(double x, double y, double width, double height);
161 public void putImageData(ImageData imageData, double x, double y);
163 public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
165 public void setGlobalAlpha(double alpha);
167 public double getGlobalAlpha();
169 public void setGlobalCompositeOperation(String operation);
171 public String getGlobalCompositeOperation();
173 public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1);
175 public Pattern createPattern(ImageData image, String repeat);
177 public RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
179 public void addColorStop(LinearGradient gradient, double position, String color);
181 public ImageData getImageDataForPath(String path);
183 public int getHeight();
185 public int getWidth();
187 public void setHeight(int height);
189 public void setWidth(int width);