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 net.java.html.canvas.Dimension;
21 import net.java.html.canvas.Style;
24 * Provider API for Canvas. Implement this to add support for your platform.
27 public interface GraphicsEnvironment {
29 public void arc(double centerX,
36 public void arcTo(double x1,
42 public boolean isPointInPath(double x, double y);
48 public void beginPath();
50 public void closePath();
54 public void moveTo(double x, double y);
56 public void lineTo(double x, double y);
58 public void quadraticCurveTo(double cpx, double cpy, double x, double y);
60 public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
62 public void fillRect(double x, double y, double width, double height);
64 public void strokeRect(double x, double y, double width, double height);
66 public void clearRect(double x, double y, double width, double height);
68 public void rect(double x, double y, double width, double height);
72 public void restore();
74 public void rotate(double angle);
76 public void transform(double a, double b, double c, double d, double e, double f);
78 public void setTransform(double a, double b, double c, double d, double e, double f);
80 public void translate(double x, double y);
82 public void scale(double x, double y);
84 //// public void drawImage(ImageData image, double x, double y);
86 //// public void drawImage(ImageData image, double x, double y, double width, double height);
88 //// public void drawImage(ImageData image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
90 public void setFillStyle(String style);
92 public String getFillStyle();
94 public void setFillStyle(Style style);
96 public void setStrokeStyle(String style);
98 public void setStrokeStyle(Style style);
100 public void setShadowColor(String color);
102 public void setShadowBlur(double blur);
104 public void setShadowOffsetX(double x);
106 public void setShadowOffsetY(double y);
108 public String getStrokeStyle();
110 public String getShadowColor();
112 public double getShadowBlur();
114 public double getShadowOffsetX();
116 public double getShadowOffsetY();
118 public String getLineCap();
120 public void setLineCap(String style);
122 public String getLineJoin();
124 public void setLineJoin(String style);
126 public double getLineWidth();
128 public void setLineWidth(double width);
130 public double getMiterLimit();
132 public void setMiterLimit(double limit);
134 public String getFont();
136 public void setFont(String font);
138 public String getTextAlign();
140 public void setTextAlign(String textAlign);
142 public String getTextBaseline();
144 public void setTextBaseline(String textbaseline);
146 public void fillText(String text, double x, double y);
148 public void fillText(String text, double x, double y, double maxWidth);
150 public Dimension measureText(String text);
152 public void strokeText(String text, double x, double y);
154 public void strokeText(String text, double x, double y, double maxWidth);
156 //// public ImageData createImageData(double x, double y);
158 //// public ImageData createImageData(ImageData imageData);
160 //// public ImageData getImageData(double x, double y, double width, double height);
162 //// public void putImageData(ImageData imageData, double x, double y);
164 //// public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
166 public void setGlobalAlpha(double alpha);
168 public double getGlobalAlpha();
170 public void setGlobalCompositeOperation(String operation);
172 public String getGlobalCompositeOperation();
174 //// public ImageData getImageForPath(String path);
176 public int getHeight();
178 public int getWidth();
180 public void setHeight(int height);
182 public void setWidth(int width);