javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsEnvironment.java
author Anton Epple <toni.epple@eppleton.de>
Thu, 23 May 2013 09:56:49 +0200
branchcanvas
changeset 1133 0ae830f00e0c
parent 1132 368626597f1a
permissions -rw-r--r--
temporarily disabled ImageData before we found a nice solution. Maybe introduce PixelReader PixelWriter for GraphicsContext.
     1 /**
     2  * Back 2 Browser Bytecode Translator Copyright (C) 2012 Jaroslav Tulach
     3  * <jaroslav.tulach@apidesign.org>
     4  *
     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.
     8  *
     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
    12  * details.
    13  *
    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.
    17  */
    18 package net.java.html.canvas;
    19 
    20 import java.awt.Dimension;
    21 
    22 /**
    23  *
    24  * @author antonepple
    25  */
    26 public interface GraphicsEnvironment {
    27 
    28     public void arc(double centerX,
    29             double centerY,
    30             double startAngle,
    31             double radius,
    32             double endAngle,
    33             boolean ccw);
    34 
    35     public void arcTo(double x1,
    36             double y1,
    37             double x2,
    38             double y2,
    39             double r);
    40 
    41     public boolean isPointInPath(double x, double y);
    42 
    43     public void fill();
    44 
    45     public void stroke();
    46 
    47     public void beginPath();
    48 
    49     public void closePath();
    50 
    51     public void clip();
    52 
    53     public void moveTo(double x, double y);
    54 
    55     public void lineTo(double x, double y);
    56 
    57     public void quadraticCurveTo(double cpx, double cpy, double x, double y);
    58 
    59     public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
    60 
    61     public void fillRect(double x, double y, double width, double height);
    62 
    63     public void strokeRect(double x, double y, double width, double height);
    64 
    65     public void clearRect(double x, double y, double width, double height);
    66 
    67     public void rect(double x, double y, double width, double height);
    68 
    69     public void save();
    70 
    71     public void restore();
    72 
    73     public void rotate(double angle);
    74 
    75     public void transform(double a, double b, double c, double d, double e, double f);
    76 
    77     public void setTransform(double a, double b, double c, double d, double e, double f);
    78 
    79     public void translate(double x, double y);
    80 
    81     public void scale(double x, double y);
    82 
    83     public void drawImage(Image image, double x, double y);
    84 
    85     public void drawImage(Image image, double x, double y, double width, double height);
    86 
    87     public void drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
    88 
    89     public void setFillStyle(String style);
    90 
    91     public String getFillStyle();
    92 
    93     public void setFillStyle(Style style);
    94 
    95     public void setStrokeStyle(String style);
    96 
    97     public void setStrokeStyle(Style style);
    98 
    99     public void setShadowColor(String color);
   100 
   101     public void setShadowBlur(double blur);
   102 
   103     public void setShadowOffsetX(double x);
   104 
   105     public void setShadowOffsetY(double y);
   106 
   107     public String getStrokeStyle();
   108 
   109     public String getShadowColor();
   110 
   111     public double getShadowBlur();
   112 
   113     public double getShadowOffsetX();
   114 
   115     public double getShadowOffsetY();
   116 
   117     public String getLineCap();
   118 
   119     public void setLineCap(String style);
   120 
   121     public String getLineJoin();
   122 
   123     public void setLineJoin(String style);
   124 
   125     public double getLineWidth();
   126 
   127     public void setLineWidth(double width);
   128 
   129     public double getMiterLimit();
   130 
   131     public void setMiterLimit(double limit);
   132 
   133     public String getFont();
   134 
   135     public void setFont(String font);
   136 
   137     public String getTextAlign();
   138 
   139     public void setTextAlign(String textAlign);
   140 
   141     public String getTextBaseline();
   142 
   143     public void setTextBaseline(String textbaseline);
   144 
   145     public void fillText(String text, double x, double y);
   146 
   147     public void fillText(String text, double x, double y, double maxWidth);
   148 
   149     public Dimension measureText(String text);
   150 
   151     public void strokeText(String text, double x, double y);
   152 
   153     public void strokeText(String text, double x, double y, double maxWidth);
   154 
   155 //    public ImageData createImageData(double x, double y);
   156 //
   157 //    public ImageData createImageData(Image imageData);
   158 //
   159 //    public ImageData getImageData(double x, double y, double width, double height);
   160 //
   161 //    public void putImageData(ImageData imageData, double x, double y);
   162 //
   163 //    public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
   164 
   165     public void setGlobalAlpha(double alpha);
   166 
   167     public double getGlobalAlpha();
   168 
   169     public void setGlobalCompositeOperation(String operation);
   170 
   171     public String getGlobalCompositeOperation();
   172 
   173     public Image getImageForPath(String path);
   174 
   175     public int getHeight();
   176 
   177     public int getWidth();
   178 
   179     public void setHeight(int height);
   180 
   181     public void setWidth(int width);
   182 }