toni@1129
|
1 |
/**
|
toni@1129
|
2 |
* Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
|
toni@1129
|
3 |
* <jaroslav.tulach@apidesign.org>
|
toni@1129
|
4 |
*
|
toni@1129
|
5 |
* This program is free software: you can redistribute it and/or modify it under
|
toni@1129
|
6 |
* the terms of the GNU General Public License as published by the Free Software
|
toni@1129
|
7 |
* Foundation, version 2 of the License.
|
toni@1129
|
8 |
*
|
toni@1129
|
9 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
toni@1129
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
toni@1129
|
11 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
toni@1129
|
12 |
* details.
|
toni@1129
|
13 |
*
|
toni@1129
|
14 |
* You should have received a copy of the GNU General Public License along with
|
toni@1129
|
15 |
* this program. Look for COPYING file in the top folder. If not, see
|
toni@1129
|
16 |
* http://opensource.org/licenses/GPL-2.0.
|
toni@1128
|
17 |
*/
|
toni@1136
|
18 |
package net.java.html.canvas.spi;
|
toni@1128
|
19 |
|
toni@1137
|
20 |
import net.java.html.canvas.Dimension;
|
toni@1136
|
21 |
import net.java.html.canvas.Style;
|
toni@1128
|
22 |
|
toni@1128
|
23 |
/**
|
toni@1136
|
24 |
* Provider API for Canvas. Implement this to add support for your platform.
|
toni@1128
|
25 |
* @author antonepple
|
toni@1128
|
26 |
*/
|
toni@1128
|
27 |
public interface GraphicsEnvironment {
|
toni@1129
|
28 |
|
toni@1128
|
29 |
public void arc(double centerX,
|
toni@1128
|
30 |
double centerY,
|
toni@1128
|
31 |
double startAngle,
|
toni@1128
|
32 |
double radius,
|
toni@1128
|
33 |
double endAngle,
|
toni@1128
|
34 |
boolean ccw);
|
toni@1128
|
35 |
|
toni@1128
|
36 |
public void arcTo(double x1,
|
toni@1128
|
37 |
double y1,
|
toni@1128
|
38 |
double x2,
|
toni@1128
|
39 |
double y2,
|
toni@1128
|
40 |
double r);
|
toni@1128
|
41 |
|
toni@1128
|
42 |
public boolean isPointInPath(double x, double y);
|
toni@1128
|
43 |
|
toni@1128
|
44 |
public void fill();
|
toni@1128
|
45 |
|
toni@1128
|
46 |
public void stroke();
|
toni@1128
|
47 |
|
toni@1128
|
48 |
public void beginPath();
|
toni@1128
|
49 |
|
toni@1128
|
50 |
public void closePath();
|
toni@1128
|
51 |
|
toni@1128
|
52 |
public void clip();
|
toni@1128
|
53 |
|
toni@1128
|
54 |
public void moveTo(double x, double y);
|
toni@1128
|
55 |
|
toni@1128
|
56 |
public void lineTo(double x, double y);
|
toni@1128
|
57 |
|
toni@1128
|
58 |
public void quadraticCurveTo(double cpx, double cpy, double x, double y);
|
toni@1128
|
59 |
|
toni@1128
|
60 |
public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
|
toni@1128
|
61 |
|
toni@1128
|
62 |
public void fillRect(double x, double y, double width, double height);
|
toni@1128
|
63 |
|
toni@1128
|
64 |
public void strokeRect(double x, double y, double width, double height);
|
toni@1128
|
65 |
|
toni@1128
|
66 |
public void clearRect(double x, double y, double width, double height);
|
toni@1128
|
67 |
|
toni@1128
|
68 |
public void rect(double x, double y, double width, double height);
|
toni@1128
|
69 |
|
toni@1128
|
70 |
public void save();
|
toni@1128
|
71 |
|
toni@1128
|
72 |
public void restore();
|
toni@1128
|
73 |
|
toni@1128
|
74 |
public void rotate(double angle);
|
toni@1128
|
75 |
|
toni@1128
|
76 |
public void transform(double a, double b, double c, double d, double e, double f);
|
toni@1128
|
77 |
|
toni@1128
|
78 |
public void setTransform(double a, double b, double c, double d, double e, double f);
|
toni@1128
|
79 |
|
toni@1128
|
80 |
public void translate(double x, double y);
|
toni@1128
|
81 |
|
toni@1128
|
82 |
public void scale(double x, double y);
|
toni@1128
|
83 |
|
toni@1137
|
84 |
//// public void drawImage(ImageData image, double x, double y);
|
toni@1137
|
85 |
////
|
toni@1137
|
86 |
//// public void drawImage(ImageData image, double x, double y, double width, double height);
|
toni@1137
|
87 |
////
|
toni@1137
|
88 |
//// public void drawImage(ImageData image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
|
toni@1137
|
89 |
//
|
toni@1128
|
90 |
public void setFillStyle(String style);
|
toni@1128
|
91 |
|
toni@1128
|
92 |
public String getFillStyle();
|
toni@1128
|
93 |
|
toni@1129
|
94 |
public void setFillStyle(Style style);
|
toni@1128
|
95 |
|
toni@1128
|
96 |
public void setStrokeStyle(String style);
|
toni@1128
|
97 |
|
toni@1130
|
98 |
public void setStrokeStyle(Style style);
|
toni@1128
|
99 |
|
toni@1128
|
100 |
public void setShadowColor(String color);
|
toni@1128
|
101 |
|
toni@1128
|
102 |
public void setShadowBlur(double blur);
|
toni@1128
|
103 |
|
toni@1128
|
104 |
public void setShadowOffsetX(double x);
|
toni@1128
|
105 |
|
toni@1128
|
106 |
public void setShadowOffsetY(double y);
|
toni@1128
|
107 |
|
toni@1128
|
108 |
public String getStrokeStyle();
|
toni@1128
|
109 |
|
toni@1128
|
110 |
public String getShadowColor();
|
toni@1128
|
111 |
|
toni@1128
|
112 |
public double getShadowBlur();
|
toni@1128
|
113 |
|
toni@1128
|
114 |
public double getShadowOffsetX();
|
toni@1128
|
115 |
|
toni@1128
|
116 |
public double getShadowOffsetY();
|
toni@1128
|
117 |
|
toni@1128
|
118 |
public String getLineCap();
|
toni@1128
|
119 |
|
toni@1128
|
120 |
public void setLineCap(String style);
|
toni@1128
|
121 |
|
toni@1128
|
122 |
public String getLineJoin();
|
toni@1128
|
123 |
|
toni@1128
|
124 |
public void setLineJoin(String style);
|
toni@1128
|
125 |
|
toni@1128
|
126 |
public double getLineWidth();
|
toni@1128
|
127 |
|
toni@1128
|
128 |
public void setLineWidth(double width);
|
toni@1128
|
129 |
|
toni@1128
|
130 |
public double getMiterLimit();
|
toni@1128
|
131 |
|
toni@1128
|
132 |
public void setMiterLimit(double limit);
|
toni@1128
|
133 |
|
toni@1128
|
134 |
public String getFont();
|
toni@1128
|
135 |
|
toni@1128
|
136 |
public void setFont(String font);
|
toni@1128
|
137 |
|
toni@1128
|
138 |
public String getTextAlign();
|
toni@1128
|
139 |
|
toni@1128
|
140 |
public void setTextAlign(String textAlign);
|
toni@1128
|
141 |
|
toni@1128
|
142 |
public String getTextBaseline();
|
toni@1128
|
143 |
|
toni@1128
|
144 |
public void setTextBaseline(String textbaseline);
|
toni@1128
|
145 |
|
toni@1128
|
146 |
public void fillText(String text, double x, double y);
|
toni@1128
|
147 |
|
toni@1128
|
148 |
public void fillText(String text, double x, double y, double maxWidth);
|
toni@1128
|
149 |
|
toni@1128
|
150 |
public Dimension measureText(String text);
|
toni@1128
|
151 |
|
toni@1128
|
152 |
public void strokeText(String text, double x, double y);
|
toni@1128
|
153 |
|
toni@1128
|
154 |
public void strokeText(String text, double x, double y, double maxWidth);
|
toni@1128
|
155 |
|
toni@1137
|
156 |
//// public ImageData createImageData(double x, double y);
|
toni@1137
|
157 |
////
|
toni@1137
|
158 |
//// public ImageData createImageData(ImageData imageData);
|
toni@1137
|
159 |
////
|
toni@1137
|
160 |
//// public ImageData getImageData(double x, double y, double width, double height);
|
toni@1137
|
161 |
////
|
toni@1137
|
162 |
//// public void putImageData(ImageData imageData, double x, double y);
|
toni@1137
|
163 |
////
|
toni@1137
|
164 |
//// public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
|
toni@1128
|
165 |
|
toni@1128
|
166 |
public void setGlobalAlpha(double alpha);
|
toni@1128
|
167 |
|
toni@1128
|
168 |
public double getGlobalAlpha();
|
toni@1128
|
169 |
|
toni@1128
|
170 |
public void setGlobalCompositeOperation(String operation);
|
toni@1128
|
171 |
|
toni@1128
|
172 |
public String getGlobalCompositeOperation();
|
toni@1128
|
173 |
|
toni@1137
|
174 |
//// public ImageData getImageForPath(String path);
|
toni@1129
|
175 |
|
toni@1128
|
176 |
public int getHeight();
|
toni@1128
|
177 |
|
toni@1128
|
178 |
public int getWidth();
|
toni@1128
|
179 |
|
toni@1128
|
180 |
public void setHeight(int height);
|
toni@1128
|
181 |
|
toni@1128
|
182 |
public void setWidth(int width);
|
toni@1128
|
183 |
}
|