javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java
author toni.epple@eppleton.de
Fri, 17 May 2013 12:06:36 +0200
branchcanvas
changeset 1111 8c88d0f187d8
parent 1109 b17053d0671d
child 1121 dbc985f7226e
permissions -rw-r--r--
Extracting interfaces from JavaQuery API. Removed first (automatic) refactoring attempt and redid it manually.
     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 org.apidesign.bck2brwsr.core.JavaScriptBody;
    21 
    22 /**
    23  *
    24  * @author antonepple
    25  */
    26 public interface GraphicsContext {
    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(LinearGradient style);
    94 
    95     public void setFillStyle(RadialGradient style);
    96 
    97     public void setFillStyle(Pattern style);
    98 
    99     public void setStrokeStyle(String style);
   100 
   101     public void setStrokeStyle(LinearGradient style);
   102 
   103     public void setStrokeStyle(RadialGradient style);
   104 
   105     public void setStrokeStyle(Pattern style);
   106 
   107     public void setShadowColor(String color);
   108 
   109     public void setShadowBlur(double blur);
   110 
   111     public void setShadowOffsetX(double x);
   112 
   113     public void setShadowOffsetY(double y);
   114 
   115     public String getStrokeStyle();
   116 
   117     public String getShadowColor();
   118 
   119     public double getShadowBlur();
   120 
   121     public double getShadowOffsetX();
   122 
   123     public double getShadowOffsetY();
   124 
   125     public String getLineCap();
   126 
   127     public void setLineCap(String style);
   128 
   129     public String getLineJoin();
   130 
   131     public void setLineJoin(String style);
   132 
   133     public double getLineWidth();
   134 
   135     public void setLineWidth(double width);
   136 
   137     public double getMiterLimit();
   138 
   139     public void setMiterLimit(double limit);
   140 
   141     public String getFont();
   142 
   143     public void setFont(String font);
   144 
   145     public String getTextAlign();
   146 
   147     public void setTextAlign(String textAlign);
   148 
   149     public String getTextBaseline();
   150 
   151     public void setTextBaseline(String textbaseline);
   152 
   153     public void fillText(String text, double x, double y);
   154 
   155     public void fillText(String text, double x, double y, double maxWidth);
   156 
   157     public TextMetrics measureText(String text);
   158 
   159     public void strokeText(String text, double x, double y);
   160 
   161     public void strokeText(String text, double x, double y, double maxWidth);
   162 
   163     public ImageData createImageData(double x, double y);
   164 
   165     public ImageData createImageData(ImageData imageData);
   166 
   167     public ImageData getImageData(double x, double y, double width, double height);
   168 
   169     public void putImageData(ImageData imageData, double x, double y);
   170 
   171     public void putImageData(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
   172 
   173     public void setGlobalAlpha(double alpha);
   174 
   175     public double getGlobalAlpha();
   176 
   177     public void setGlobalCompositeOperation(String operation);
   178 
   179     public String getGlobalCompositeOperation();
   180 
   181     public LinearGradient createLinearGradient(double x0, double y0, double x1, double y1);
   182 
   183     public Pattern createPattern(Image image, String repeat);
   184 
   185     public RadialGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
   186 }