Clover icon

Coverage Report

  1. Project Clover database Thu Dec 4 2025 16:11:35 GMT
  2. Package swingjs.api.js

File HTML5CanvasContext2D.java

 

Coverage histogram

../../../img/srcFileCovDistChart0.png
60% of files have more coverage

Code metrics

4
10
6
2
164
73
8
0.8
1.67
3
1.33

Classes

Class Line # Actions
HTML5CanvasContext2D 6 10 8
0.00%
HTML5CanvasContext2D.ImageData 8 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package swingjs.api.js;
2   
3    import java.awt.geom.AffineTransform;
4    import java.awt.geom.Point2D.Float;
5   
 
6    public abstract class HTML5CanvasContext2D {
7   
 
8    public class ImageData {
9    public int[] data;
10    }
11   
12    public ImageData imageData;
13   
14    public Object[][] _aSaved;
15   
16    public double lineWidth;
17   
18    public String font, fillStyle, strokeStyle;
19   
20    public float globalAlpha;
21   
22    public abstract void drawImage(DOMNode img, double sx,
23    double sy, double swidth, double sheight, double dx, double dy, double width, double height);
24   
25    public abstract ImageData getImageData(int x, int y, int width, int height);
26   
27    public abstract void beginPath();
28   
29    public abstract void moveTo(double x0, double y0);
30   
31    public abstract void lineTo(double x1, double y1);
32   
33    public abstract void stroke();
34   
35    public abstract void save();
36   
37    public abstract void scale(double f, double g);
38   
39    public abstract void arc(double centerX, double centerY, double radius, double startAngle, double endAngle, boolean counterclockwise);
40   
41    public abstract void closePath();
42   
43    public abstract void restore();
44   
45    public abstract void translate(double x, double y);
46   
47    public abstract void rotate(double radians);
48   
49    public abstract void fill();
50   
51   
52    public abstract void fill(String winding);
53   
54    public abstract void rect(double x, double y, double width, double height);
55   
56    public abstract void fillText(String s, double x, double y);
57   
58    public abstract void fillRect(double x, double y, double width, double height);
59   
60    public abstract void clearRect(double i, double j, double windowWidth, double windowHeight);
61   
62    public abstract void setLineDash(int[] dash);
63   
64    public abstract void clip();
65   
66    public abstract void quadraticCurveTo(double d, double e, double f, double g);
67   
68    public abstract void bezierCurveTo(double d, double e, double f, double g, double h, double i);
69   
70    public abstract void drawImage(DOMNode img, double x, double y, double width, double height);
71   
72    public abstract void putImageData(Object imageData, double x, double y);
73   
74    public abstract void transform(double d, double shx, double e, double shy, double f, double g);
75   
76   
77    /**
78    * pull one save structure onto the stack array ctx._aSaved
79    *
80    * @param ctx
81    * @return the length of the stack array after the push
82    */
 
83  0 toggle public static int push(HTML5CanvasContext2D ctx, Object[] map) {
84    /**
85    * @j2sNative
86    *
87    * (ctx._aSaved || (ctx._aSaved = [])).push(map);
88    * return ctx._aSaved.length;
89    */
90    {
91  0 return 0;
92    }
93    }
94   
95    /**
96    * pull one save structure off the stack array ctx._aSaved
97    *
98    * @param ctx
99    * @return
100    */
 
101  0 toggle public static Object[] pop(HTML5CanvasContext2D ctx) {
102    /**
103    * @j2sNative
104    *
105    * return (ctx._aSaved && ctx._aSaved.length > 0 ? ctx._aSaved.pop() : null);
106    */
107    {
108  0 return null;
109    }
110    }
111   
 
112  0 toggle public static int getSavedLevel(HTML5CanvasContext2D ctx) {
113    /**
114    * @j2sNative
115    *
116    * return (ctx._aSaved ? ctx._aSaved.length : 0);
117    */
118    {
119  0 return 0;
120    }
121    }
122   
 
123  0 toggle public static Object[][] getSavedStack(HTML5CanvasContext2D ctx) {
124    /**
125    * @j2sNative
126    *
127    * return (ctx._aSaved || []);
128    */
129    {
130  0 return null;
131    }
132   
133    }
134   
 
135  0 toggle public static double[] setMatrix(HTML5CanvasContext2D ctx, AffineTransform transform) {
136  0 double[] m = /** @j2sNative ctx._m || */ null;
137  0 if (transform == null) {
138    /** @j2sNative ctx._m = null; */
139  0 return null;
140    }
141  0 if (m == null) {
142    /**
143    * @j2sNative
144    * ctx._m = m = new Array(6);
145    */
146  0 transform.getMatrix(m);
147    }
148  0 return m;
149    }
150   
 
151  0 toggle public static void createLinearGradient(HTML5CanvasContext2D ctx, Float p1, Float p2, String css1, String css2) {
152    /**
153    * @j2sNative
154    *
155    * var grd = ctx.createLinearGradient(p1.x, p1.y, p2.x, p2.y);
156    * grd.addColorStop(0,css1);
157    * grd.addColorStop(1,css2);
158    * ctx.fillStyle = grd;
159    */
160    }
161   
162    abstract public void drawImage(DOMNode domNode, int x, int y);
163   
164    }