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;
25 public interface GraphicsContext {
27 public void arc(double centerX,
34 public void arcTo(double x1,
40 public boolean isPointInPath(double x, double y);
46 public void beginPath();
48 public void closePath();
52 public void moveTo(double x, double y);
54 public void lineTo(double x, double y);
56 public void quadraticCurveTo(double cpx, double cpy, double x, double y);
58 public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
60 public void fillRect(double x, double y, double width, double height);
62 public void strokeRect(double x, double y, double width, double height);
64 public void clearRect(double x, double y, double width, double height);
66 public void rect(double x, double y, double width, double height);
70 public void restore();
72 public void rotate(double angle);
74 public void transform(double a, double b, double c, double d, double e, double f);
76 public void setTransform(double a, double b, double c, double d, double e, double f);
78 public void translate(double x, double y);
80 public void scale(double x, double y);
82 public void drawImage(Image image, double x, double y);
84 public void drawImage(Image image, double x, double y, double width, double height);
86 public void drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
88 public void setFillStyle(String style);
90 public String getFillStyle();
92 public void setFillStyle(LinearGradient style);
94 public void setFillStyle(RadialGradient style);
96 public void setFillStyle(Pattern style);
98 public void setStrokeStyle(String style);
100 public void setStrokeStyle(LinearGradient style);
102 public void setStrokeStyle(RadialGradient style);
104 public void setStrokeStyle(Pattern style);
106 public void setShadowColor(String color);
108 public void setShadowBlur(double blur);
110 public void setShadowOffsetX(double x);
112 public void setShadowOffsetY(double y);
114 public String getStrokeStyle();
116 public String getShadowColor();
118 public double getShadowBlur();
120 public double getShadowOffsetX();
122 public double getShadowOffsetY();
124 public String getLineCap();
126 public void setLineCap(String style);
128 public String getLineJoin();
130 public void setLineJoin(String style);
132 public double getLineWidth();
134 public void setLineWidth(double width);
136 public double getMiterLimit();
138 public void setMiterLimit(double limit);
140 public String getFont();
142 public void setFont(String font);
144 public String getTextAlign();
146 public void setTextAlign(String textAlign);
148 public String getTextBaseline();
150 public void setTextBaseline(String textbaseline);
152 public void fillText(String text, double x, double y);
154 public void fillText(String text, double x, double y, double maxWidth);
156 public TextMetrics measureText(String text);
158 public void strokeText(String text, double x, double y);
160 public void strokeText(String text, double x, double y, double maxWidth);
162 public ImageData createImageData(double x, double y);
164 public ImageData createImageData(ImageData imageData);
166 public ImageData getImageData(double x, double y, double width, double height);
168 public void putImageData(ImageData imageData, double x, double y);
170 public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
172 public void setGlobalAlpha(double alpha);
174 public double getGlobalAlpha();
176 public void setGlobalCompositeOperation(String operation);
178 public String getGlobalCompositeOperation();
180 public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1);
182 public Pattern createPattern(Image image, String repeat);
184 public RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
186 public Image getImageForPath(String path);