javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java
author toni.epple@eppleton.de
Tue, 21 May 2013 15:27:19 +0200
branchcanvas
changeset 1123 99e875d14a97
parent 1121 dbc985f7226e
permissions -rw-r--r--
removed dependencies on bck2brwsr
     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 
    21 /**
    22  *
    23  * @author antonepple
    24  */
    25 public interface GraphicsContext {
    26 
    27     public void arc(double centerX,
    28             double centerY,
    29             double startAngle,
    30             double radius,
    31             double endAngle,
    32             boolean ccw);
    33 
    34     public void arcTo(double x1,
    35             double y1,
    36             double x2,
    37             double y2,
    38             double r);
    39 
    40     public boolean isPointInPath(double x, double y);
    41 
    42     public void fill();
    43 
    44     public void stroke();
    45 
    46     public void beginPath();
    47 
    48     public void closePath();
    49 
    50     public void clip();
    51 
    52     public void moveTo(double x, double y);
    53 
    54     public void lineTo(double x, double y);
    55 
    56     public void quadraticCurveTo(double cpx, double cpy, double x, double y);
    57 
    58     public void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
    59 
    60     public void fillRect(double x, double y, double width, double height);
    61 
    62     public void strokeRect(double x, double y, double width, double height);
    63 
    64     public void clearRect(double x, double y, double width, double height);
    65 
    66     public void rect(double x, double y, double width, double height);
    67 
    68     public void save();
    69 
    70     public void restore();
    71 
    72     public void rotate(double angle);
    73 
    74     public void transform(double a, double b, double c, double d, double e, double f);
    75 
    76     public void setTransform(double a, double b, double c, double d, double e, double f);
    77 
    78     public void translate(double x, double y);
    79 
    80     public void scale(double x, double y);
    81 
    82     public void drawImage(Image image, double x, double y);
    83 
    84     public void drawImage(Image image, double x, double y, double width, double height);
    85 
    86     public void drawImage(Image image, double sx, double sy, double sWidth, double sHeight, double x, double y, double width, double height);
    87 
    88     public void setFillStyle(String style);
    89 
    90     public String getFillStyle();
    91 
    92     public void setFillStyle(LinearGradient style);
    93 
    94     public void setFillStyle(RadialGradient style);
    95 
    96     public void setFillStyle(Pattern style);
    97 
    98     public void setStrokeStyle(String style);
    99 
   100     public void setStrokeStyle(LinearGradient style);
   101 
   102     public void setStrokeStyle(RadialGradient style);
   103 
   104     public void setStrokeStyle(Pattern style);
   105 
   106     public void setShadowColor(String color);
   107 
   108     public void setShadowBlur(double blur);
   109 
   110     public void setShadowOffsetX(double x);
   111 
   112     public void setShadowOffsetY(double y);
   113 
   114     public String getStrokeStyle();
   115 
   116     public String getShadowColor();
   117 
   118     public double getShadowBlur();
   119 
   120     public double getShadowOffsetX();
   121 
   122     public double getShadowOffsetY();
   123 
   124     public String getLineCap();
   125 
   126     public void setLineCap(String style);
   127 
   128     public String getLineJoin();
   129 
   130     public void setLineJoin(String style);
   131 
   132     public double getLineWidth();
   133 
   134     public void setLineWidth(double width);
   135 
   136     public double getMiterLimit();
   137 
   138     public void setMiterLimit(double limit);
   139 
   140     public String getFont();
   141 
   142     public void setFont(String font);
   143 
   144     public String getTextAlign();
   145 
   146     public void setTextAlign(String textAlign);
   147 
   148     public String getTextBaseline();
   149 
   150     public void setTextBaseline(String textbaseline);
   151 
   152     public void fillText(String text, double x, double y);
   153 
   154     public void fillText(String text, double x, double y, double maxWidth);
   155 
   156     public TextMetrics measureText(String text);
   157 
   158     public void strokeText(String text, double x, double y);
   159 
   160     public void strokeText(String text, double x, double y, double maxWidth);
   161 
   162     public ImageData createImageData(double x, double y);
   163 
   164     public ImageData createImageData(ImageData imageData);
   165 
   166     public ImageData getImageData(double x, double y, double width, double height);
   167 
   168     public void putImageData(ImageData imageData, double x, double y);
   169 
   170     public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
   171 
   172     public void setGlobalAlpha(double alpha);
   173 
   174     public double getGlobalAlpha();
   175 
   176     public void setGlobalCompositeOperation(String operation);
   177 
   178     public String getGlobalCompositeOperation();
   179 
   180     public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1);
   181 
   182     public Pattern createPattern(Image image, String repeat);
   183 
   184     public RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
   185     
   186     public Image getImageForPath(String path);
   187 }