diff -r 0ae830f00e0c -r 591d06d8e06f javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Thu May 23 15:36:42 2013 +0200 @@ -0,0 +1,184 @@ +/** + * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach + * + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. Look for COPYING file in the top folder. If not, see + * http://opensource.org/licenses/GPL-2.0. + */ +package net.java.html.canvas.spi; + +import java.awt.Dimension; +import net.java.html.canvas.ImageData; +import net.java.html.canvas.Style; + +/** + * Provider API for Canvas. Implement this to add support for your platform. + * @author antonepple + */ +public interface GraphicsEnvironment { + + public void arc(double centerX, + double centerY, + double startAngle, + double radius, + double endAngle, + boolean ccw); + + public void arcTo(double x1, + double y1, + double x2, + double y2, + double r); + + public boolean isPointInPath(double x, double y); + + public void fill(); + + public void stroke(); + + public void beginPath(); + + public void closePath(); + + public void clip(); + + public void moveTo(double x, double y); + + public void lineTo(double x, double y); + + public void quadraticCurveTo(double cpx, double cpy, double x, double y); + + public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y); + + public void fillRect(double x, double y, double width, double height); + + public void strokeRect(double x, double y, double width, double height); + + public void clearRect(double x, double y, double width, double height); + + public void rect(double x, double y, double width, double height); + + public void save(); + + public void restore(); + + public void rotate(double angle); + + public void transform(double a, double b, double c, double d, double e, double f); + + public void setTransform(double a, double b, double c, double d, double e, double f); + + public void translate(double x, double y); + + public void scale(double x, double y); + + public void drawImage(ImageData image, double x, double y); + + public void drawImage(ImageData image, double x, double y, double width, double height); + + public void drawImage(ImageData image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height); + + public void setFillStyle(String style); + + public String getFillStyle(); + + public void setFillStyle(Style style); + + public void setStrokeStyle(String style); + + public void setStrokeStyle(Style style); + + public void setShadowColor(String color); + + public void setShadowBlur(double blur); + + public void setShadowOffsetX(double x); + + public void setShadowOffsetY(double y); + + public String getStrokeStyle(); + + public String getShadowColor(); + + public double getShadowBlur(); + + public double getShadowOffsetX(); + + public double getShadowOffsetY(); + + public String getLineCap(); + + public void setLineCap(String style); + + public String getLineJoin(); + + public void setLineJoin(String style); + + public double getLineWidth(); + + public void setLineWidth(double width); + + public double getMiterLimit(); + + public void setMiterLimit(double limit); + + public String getFont(); + + public void setFont(String font); + + public String getTextAlign(); + + public void setTextAlign(String textAlign); + + public String getTextBaseline(); + + public void setTextBaseline(String textbaseline); + + public void fillText(String text, double x, double y); + + public void fillText(String text, double x, double y, double maxWidth); + + public Dimension measureText(String text); + + public void strokeText(String text, double x, double y); + + public void strokeText(String text, double x, double y, double maxWidth); + +// public ImageData createImageData(double x, double y); +// +// public ImageData createImageData(ImageData imageData); +// +// public ImageData getImageData(double x, double y, double width, double height); +// +// public void putImageData(ImageData imageData, double x, double y); +// +// public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight); + + public void setGlobalAlpha(double alpha); + + public double getGlobalAlpha(); + + public void setGlobalCompositeOperation(String operation); + + public String getGlobalCompositeOperation(); + +// public ImageData getImageForPath(String path); + + public int getHeight(); + + public int getWidth(); + + public void setHeight(int height); + + public void setWidth(int width); +}