javaquery/canvas/src/main/java/net/java/html/canvas/GraphicsContext.java
author toni.epple@eppleton.de
Fri, 17 May 2013 11:00:23 +0200
branchcanvas
changeset 1109 b17053d0671d
parent 871 javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/GraphicsContext.java@6168fb585ab4
child 1111 8c88d0f187d8
permissions -rw-r--r--
Started extracting GraphicsContext interface from JavaQuery API. First extracting methods with primitive parameters and return type.
toni@1109
     1
/*
toni@1109
     2
 * To change this template, choose Tools | Templates
toni@1109
     3
 * and open the template in the editor.
toni@521
     4
 */
toni@1109
     5
package net.java.html.canvas;
toni@521
     6
toni@521
     7
import org.apidesign.bck2brwsr.core.JavaScriptBody;
toni@521
     8
toni@521
     9
/**
toni@521
    10
 *
toni@1109
    11
 * @author antonepple
toni@521
    12
 */
toni@1109
    13
public interface GraphicsContext {
toni@521
    14
toni@1109
    15
    @JavaScriptBody(args = {"centerx", "centery", "radius", "startangle", "endangle", "ccw"}, body = "this._context().arc(centerx,centery, radius, startangle, endangle,ccw);")
toni@1109
    16
    void arc(double centerX, double centerY, double startAngle, double radius, double endAngle, boolean ccw);
toni@521
    17
toni@1109
    18
    @JavaScriptBody(args = {"x1", "y1", "x2", "y2", "r"}, body = "this._context().arcTo(x1,y1,x2,y2,r);")
toni@1109
    19
    void arcTo(double x1, double y1, double x2, double y2, double r);
toni@521
    20
toni@1109
    21
    @JavaScriptBody(args = {}, body = "this._context().beginPath();")
toni@1109
    22
    void beginPath();
toni@521
    23
toni@1109
    24
    @JavaScriptBody(args = {"cp1x", "cp1y", "cp2x", "cp2y", "x", "y"}, body = "this._context().bezierCurveTo(cp1x,cp1y,cp2x,cp2y,x,y);")
toni@1109
    25
    void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
toni@521
    26
toni@1109
    27
    @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().clearRect(x,y,width,height);")
toni@1109
    28
    void clearRect(double x, double y, double width, double height);
toni@1109
    29
toni@1109
    30
    @JavaScriptBody(args = {}, body = "this._context().clip();")
toni@1109
    31
    void clip();
toni@1109
    32
toni@1109
    33
    @JavaScriptBody(args = {}, body = "this._context().closePath();")
toni@1109
    34
    void closePath();
toni@521
    35
jaroslav@592
    36
    @JavaScriptBody(args = {}, body = "this._context().fill();")
toni@1109
    37
    void fill();
toni@1109
    38
toni@1109
    39
    @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().fillRect(x,y,width,height);")
toni@1109
    40
    void fillRect(double x, double y, double width, double height);
toni@1109
    41
toni@1109
    42
    @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().fillText(text,x,y);")
toni@1109
    43
    void fillText(String text, double x, double y);
toni@1109
    44
toni@1109
    45
    @JavaScriptBody(args = {"text", "x", "y", "maxwidth"}, body = "this._context().fillText(text,x,y,maxwidth);")
toni@1109
    46
    void fillText(String text, double x, double y, double maxWidth);
toni@1109
    47
toni@1109
    48
    @JavaScriptBody(args = {}, body = "return this._context().fillStyle;")
toni@1109
    49
    String getFillStyle();
toni@1109
    50
toni@1109
    51
    @JavaScriptBody(args = {}, body = "return this._context().font;")
toni@1109
    52
    String getFont();
toni@1109
    53
toni@1109
    54
    @JavaScriptBody(args = {}, body = "return this._context().globalAlpha;")
toni@1109
    55
    double getGlobalAlpha();
toni@1109
    56
toni@1109
    57
    @JavaScriptBody(args = {}, body = "return this._context().globalCompositeOperation;")
toni@1109
    58
    String getGlobalCompositeOperation();
toni@1109
    59
toni@1109
    60
    @JavaScriptBody(args = {}, body = "return this._context().lineCap;")
toni@1109
    61
    String getLineCap();
toni@1109
    62
toni@1109
    63
    @JavaScriptBody(args = {}, body = "return this._context().lineJoin;")
toni@1109
    64
    String getLineJoin();
toni@1109
    65
toni@1109
    66
    @JavaScriptBody(args = {}, body = "return this._context().lineWidth;")
toni@1109
    67
    double getLineWidth();
toni@1109
    68
toni@1109
    69
    @JavaScriptBody(args = {}, body = "return this._context().miterLimit;")
toni@1109
    70
    double getMiterLimit();
toni@1109
    71
toni@1109
    72
    @JavaScriptBody(args = {}, body = "return this._context().shadowBlur;")
toni@1109
    73
    double getShadowBlur();
toni@1109
    74
toni@1109
    75
    @JavaScriptBody(args = {}, body = "return this._context().shadowColor;")
toni@1109
    76
    String getShadowColor();
toni@1109
    77
toni@1109
    78
    @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetX;")
toni@1109
    79
    double getShadowOffsetX();
toni@1109
    80
toni@1109
    81
    @JavaScriptBody(args = {}, body = "return this._context().shadowOffsetY;")
toni@1109
    82
    double getShadowOffsetY();
toni@1109
    83
toni@1109
    84
    @JavaScriptBody(args = {}, body = "return this._context().strokeStyle;")
toni@1109
    85
    String getStrokeStyle();
toni@1109
    86
toni@1109
    87
    @JavaScriptBody(args = {}, body = "return this._context().textAlign;")
toni@1109
    88
    String getTextAlign();
toni@1109
    89
toni@1109
    90
    @JavaScriptBody(args = {}, body = "return this._context().textBaseline;")
toni@1109
    91
    String getTextBaseline();
toni@1109
    92
toni@1109
    93
    @JavaScriptBody(args = {"x", "y"}, body = "return this._context().isPointInPath(x,y);")
toni@1109
    94
    boolean isPointInPath(double x, double y);
toni@1109
    95
toni@1109
    96
    @JavaScriptBody(args = {"x", "y"}, body = "this._context().lineTo(x,y);")
toni@1109
    97
    void lineTo(double x, double y);
toni@1109
    98
toni@1109
    99
    @JavaScriptBody(args = {"x", "y"}, body = "this._context().moveTo(x,y);")
toni@1109
   100
    void moveTo(double x, double y);
toni@1109
   101
toni@1109
   102
    @JavaScriptBody(args = {"cpx", "cpy", "x", "y"}, body = "this._context().quadraticCurveTo(cpx,cpy,x,y);")
toni@1109
   103
    void quadraticCurveTo(double cpx, double cpy, double x, double y);
toni@1109
   104
toni@1109
   105
    @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().rectect(x,y,width,height);")
toni@1109
   106
    void rect(double x, double y, double width, double height);
toni@1109
   107
toni@1109
   108
    @JavaScriptBody(args = {}, body = "this._context().restore();")
toni@1109
   109
    void restore();
toni@1109
   110
toni@1109
   111
    @JavaScriptBody(args = {"angle"}, body = "this._context().rotate(angle);")
toni@1109
   112
    void rotate(double angle);
toni@1109
   113
toni@1109
   114
    @JavaScriptBody(args = {}, body = "this._context().save();")
toni@1109
   115
    void save();
toni@1109
   116
toni@1109
   117
    @JavaScriptBody(args = {"x", "y"}, body = "this._context().scale(x,y);")
toni@1109
   118
    void scale(double x, double y);
toni@1109
   119
toni@1109
   120
    @JavaScriptBody(args = {"style"}, body = "this._context().fillStyle=style.valueOf();")
toni@1109
   121
    void setFillStyle(String style);
toni@1109
   122
toni@1109
   123
    @JavaScriptBody(args = {"font"}, body = "this._context().font=font.valueOf();")
toni@1109
   124
    void setFont(String font);
toni@1109
   125
toni@1109
   126
    @JavaScriptBody(args = {"alpha"}, body = "this._context().globalAlpha=alpha;")
toni@1109
   127
    void setGlobalAlpha(double alpha);
toni@1109
   128
toni@1109
   129
    @JavaScriptBody(args = {"operation"}, body = "this._context().globalCompositeOperation=operation.valueOf();")
toni@1109
   130
    void setGlobalCompositeOperation(String operation);
toni@1109
   131
toni@1109
   132
    @JavaScriptBody(args = {"style"}, body = "this._context().lineCap=style.valueOf();")
toni@1109
   133
    void setLineCap(String style);
toni@1109
   134
toni@1109
   135
    @JavaScriptBody(args = {"style"}, body = "this._context().lineJoin=style.valueOf();")
toni@1109
   136
    void setLineJoin(String style);
toni@1109
   137
toni@1109
   138
    @JavaScriptBody(args = {"width"}, body = "this._context().lineWidth=width;")
toni@1109
   139
    void setLineWidth(double width);
toni@1109
   140
toni@1109
   141
    @JavaScriptBody(args = {"limit"}, body = "this._context().miterLimit=limit;")
toni@1109
   142
    void setMiterLimit(double limit);
toni@1109
   143
toni@1109
   144
    @JavaScriptBody(args = {"blur"}, body = "this._context().shadowBlur=blur;")
toni@1109
   145
    void setShadowBlur(double blur);
toni@1109
   146
toni@1109
   147
    @JavaScriptBody(args = {"color"}, body = "this._context().shadowColor=color.valueOf();")
toni@1109
   148
    void setShadowColor(String color);
toni@1109
   149
toni@1109
   150
    @JavaScriptBody(args = {"x"}, body = "this._context().shadowOffsetX=x;")
toni@1109
   151
    void setShadowOffsetX(double x);
toni@1109
   152
toni@1109
   153
    @JavaScriptBody(args = {"y"}, body = "this._context().shadowOffsetY=y;")
toni@1109
   154
    void setShadowOffsetY(double y);
toni@1109
   155
toni@1109
   156
    @JavaScriptBody(args = {"style"}, body = "this._context().strokeStyle=style.valueOf();")
toni@1109
   157
    void setStrokeStyle(String style);
toni@1109
   158
toni@1109
   159
    @JavaScriptBody(args = {"textalign"}, body = "this._context().textAlign=textalign.valueOf();")
toni@1109
   160
    void setTextAlign(String textAlign);
toni@1109
   161
toni@1109
   162
    @JavaScriptBody(args = {"textbaseline"}, body = "this._context().textBaseline=textbaseline.valueOf();")
toni@1109
   163
    void setTextBaseline(String textbaseline);
toni@1109
   164
toni@1109
   165
    @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().setTransform(a,b,c,d,e,f);")
toni@1109
   166
    void setTransform(double a, double b, double c, double d, double e, double f);
toni@521
   167
jaroslav@592
   168
    @JavaScriptBody(args = {}, body = "this._context().stroke();")
toni@1109
   169
    void stroke();
toni@521
   170
jaroslav@592
   171
    @JavaScriptBody(args = {"x", "y", "width", "height"}, body = "this._context().strokeRect(x,y,width,height);")
toni@1109
   172
    void strokeRect(double x, double y, double width, double height);
toni@521
   173
toni@1109
   174
    @JavaScriptBody(args = {"text", "x", "y"}, body = "this._context().strokeText(text,x,y);")
toni@1109
   175
    void strokeText(String text, double x, double y);
toni@521
   176
toni@1109
   177
    @JavaScriptBody(args = {"text", "x", "y", "maxWidth"}, body = "this._context().strokeText(text,x,y,maxWidth);")
toni@1109
   178
    void strokeText(String text, double x, double y, double maxWidth);
toni@521
   179
jaroslav@592
   180
    @JavaScriptBody(args = {"a", "b", "c", "d", "e", "f"}, body = "this._context().transform(a,b,c,d,e,f);")
toni@1109
   181
    void transform(double a, double b, double c, double d, double e, double f);
toni@521
   182
jaroslav@592
   183
    @JavaScriptBody(args = {"x", "y"}, body = "this._context().translate(x,y);")
toni@1109
   184
    void translate(double x, double y);
toni@521
   185
    
toni@521
   186
}