1
|
=== added file 'src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.strokes.js'
|
2
|
--- src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.strokes.js 1970-01-01 00:00:00 +0000
|
3
|
+++ src/com/goldencode/p2j/ui/client/chui/driver/web/res/p2j.strokes.js 2015-08-27 07:41:59 +0000
|
4
|
@@ -0,0 +1,15 @@
|
5
|
+/*
|
6
|
+** Module : p2j.strokes.js
|
7
|
+** Abstract : CHUI line strokes module
|
8
|
+**
|
9
|
+** Copyright (c) 2014-2015, Golden Code Development Corporation.
|
10
|
+** ALL RIGHTS RESERVED. Use is subject to license terms.
|
11
|
+**
|
12
|
+** Golden Code Development Corporation
|
13
|
+** CONFIDENTIAL
|
14
|
+**
|
15
|
+** -#- -I- --Date-- ------------------------------Description----------------------------------
|
16
|
+** 001 SBI 20150827 The first version defines the empty sub module.
|
17
|
+*/
|
18
|
+
|
19
|
+"use strict";
|
20
|
|
21
|
=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js'
|
22
|
--- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-08-26 22:39:14 +0000
|
23
|
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-08-27 07:18:20 +0000
|
24
|
@@ -925,6 +925,7 @@
|
25
|
var y1 = p2j.socket.readInt32BinaryMessage(message, idx + 5);
|
26
|
var x2 = p2j.socket.readInt32BinaryMessage(message, idx + 9);
|
27
|
var y2 = p2j.socket.readInt32BinaryMessage(message, idx + 13);
|
28
|
+ extra = " x1 = " + x1 +"; y1 = " + y1 + "; x2 = " + x2 + "; y2 = " + y2;
|
29
|
path = this.drawLine(this.ctx, x1, y1, x2, y2, this.rawColor);
|
30
|
|
31
|
strokesManager.applyStrokeToPath(this.ctx,
|
32
|
@@ -932,7 +933,6 @@
|
33
|
this.strokeWidth,
|
34
|
this.rawColor,
|
35
|
path);
|
36
|
- this.ctx.stroke();
|
37
|
break;
|
38
|
case ops.DRAW_RECT:
|
39
|
x = p2j.socket.readInt32BinaryMessage(message, idx + 1);
|
40
|
@@ -954,6 +954,7 @@
|
41
|
width = p2j.socket.readInt32BinaryMessage(message, idx + 9);
|
42
|
height = p2j.socket.readInt32BinaryMessage(message, idx + 13);
|
43
|
diameter = p2j.socket.readInt32BinaryMessage(message, idx + 17);
|
44
|
+ extra = " x = " + x +"; y = " + y + "; width = " + width + "; height = " + height + "; diameter = " + diameter;
|
45
|
this.drawRoundRect(ctx, x, y, width, height, diameter, this.rawColor, false);
|
46
|
break;
|
47
|
case ops.DRAW_IMAGE:
|
48
|
@@ -1014,7 +1015,13 @@
|
49
|
yPoints[j] = p2j.socket.readInt32BinaryMessage(message, offset);
|
50
|
}
|
51
|
|
52
|
- this.drawPolygon(this.ctx, xPoints, yPoints, numPoints, this.rawColor, true);
|
53
|
+ var path = this.drawPolygon(this.ctx, xPoints, yPoints, numPoints, this.rawColor, true);
|
54
|
+ strokesManager.applyStrokeToPath(this.ctx,
|
55
|
+ this.strokeStyleId,
|
56
|
+ this.strokeWidth,
|
57
|
+ this.rawColor,
|
58
|
+ path);
|
59
|
+
|
60
|
break;
|
61
|
case ops.DRAW_3D_RECT:
|
62
|
case ops.FILL_3D_RECT:
|
63
|
@@ -1090,6 +1097,7 @@
|
64
|
y = p2j.socket.readInt32BinaryMessage(message, idx + 5);
|
65
|
this.canvas.style.left = x.toString() + "px";
|
66
|
this.canvas.style.top = y.toString() + "px";
|
67
|
+ extra = " x = " + x +"; y = " + y;
|
68
|
break;
|
69
|
case ops.RESIZE_WINDOW:
|
70
|
width = p2j.socket.readInt32BinaryMessage(message, idx + 1);
|
71
|
@@ -1128,7 +1136,6 @@
|
72
|
}
|
73
|
|
74
|
logstack.push("PaintPrimitives." + ops[type] + " " + extra);
|
75
|
-
|
76
|
idx += sz;
|
77
|
}
|
78
|
|
79
|
@@ -1546,23 +1553,25 @@
|
80
|
ctx.beginPath();
|
81
|
ctx.rect(x, y, width - inset, height - inset);
|
82
|
renderClosedPath(ctx, fill);
|
83
|
- }
|
84
|
-
|
85
|
- // now overdraw the stroked portion to eliminate anti-aliasing, we draw in a
|
86
|
- // clockwise direction (since we are not using paths, this is not strictly necessary)
|
87
|
- var path = this.drawLine(ctx, x, y, x + width - inset, y, color);
|
88
|
-
|
89
|
- var more = this.drawLine(ctx, x + width - inset, y + 1, x + width - inset, y + height - inset, color);
|
90
|
- Array.prototype.push.apply(path, more);
|
91
|
-
|
92
|
- more = this.drawLine(ctx, x + width - 1 - inset, y + height - inset, x + 1, y + height - inset, color);
|
93
|
- Array.prototype.push.apply(path, more);
|
94
|
-
|
95
|
- // close the path
|
96
|
- more = this.drawLine(ctx, x, y + height - inset, x, y + 1, color);
|
97
|
- Array.prototype.push.apply(path, more);
|
98
|
-
|
99
|
- return path;
|
100
|
+ return [];
|
101
|
+ }
|
102
|
+ else
|
103
|
+ {
|
104
|
+ // now overdraw the stroked portion to eliminate anti-aliasing, we draw in a
|
105
|
+ // clockwise direction (since we are not using paths, this is not strictly necessary)
|
106
|
+ var path = this.drawLine(ctx, x, y, x + width - inset, y, color);
|
107
|
+
|
108
|
+ var more = this.drawLine(ctx, x + width - inset, y + 1, x + width - inset, y + height - inset, color);
|
109
|
+ Array.prototype.push.apply(path, more);
|
110
|
+
|
111
|
+ more = this.drawLine(ctx, x + width - 1 - inset, y + height - inset, x + 1, y + height - inset, color);
|
112
|
+ Array.prototype.push.apply(path, more);
|
113
|
+
|
114
|
+ // close the path
|
115
|
+ more = this.drawLine(ctx, x, y + height - inset, x, y + 1, color);
|
116
|
+ Array.prototype.push.apply(path, more);
|
117
|
+ return path;
|
118
|
+ }
|
119
|
};
|
120
|
|
121
|
/**
|
122
|
@@ -1842,10 +1851,19 @@
|
123
|
renderClosedPath(ctx, fill);
|
124
|
|
125
|
// overdraw the anti-aliased line segments
|
126
|
- this.drawLine(ctx, topLeftX, topLeftY, topRightX, topRightY, color);
|
127
|
- this.drawLine(ctx, rightUpX, rightUpY, rightDownX, rightDownY, color);
|
128
|
- this.drawLine(ctx, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY, color);
|
129
|
- this.drawLine(ctx, leftUpX, leftUpY, leftDownX, leftDownY, color);
|
130
|
+
|
131
|
+ var path = this.drawLine(ctx, topLeftX, topLeftY, topRightX, topRightY, color);
|
132
|
+ var more = this.drawLine(ctx, rightUpX, rightUpY, rightDownX, rightDownY, color);
|
133
|
+ Array.prototype.push.apply(path, more);
|
134
|
+ more = this.drawLine(ctx, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY, color);
|
135
|
+ Array.prototype.push.apply(path, more);
|
136
|
+ more = this.drawLine(ctx, leftUpX, leftUpY, leftDownX, leftDownY, color);
|
137
|
+ Array.prototype.push.apply(path, more);
|
138
|
+ strokesManager.applyStrokeToPath(this.ctx,
|
139
|
+ this.strokeStyleId,
|
140
|
+ this.strokeWidth,
|
141
|
+ color,
|
142
|
+ path);
|
143
|
};
|
144
|
|
145
|
/**
|
146
|
@@ -1916,14 +1934,26 @@
|
147
|
|
148
|
// draw the top and left sides in the contrasting color (raised mode) or the darker color
|
149
|
// otherwise
|
150
|
- this.drawLine(ctx, x, y, x + width - 2 - inset, y, current);
|
151
|
- this.drawLine(ctx, x, y + 1, x, y + height - 1 - inset, current);
|
152
|
-
|
153
|
+ var path = this.drawLine(ctx, x, y, x + width - 2 - inset, y, current);
|
154
|
+ var more = this.drawLine(ctx, x, y + 1, x, y + height - 1 - inset, current);
|
155
|
+ Array.prototype.push.apply(path, more);
|
156
|
+ strokesManager.applyStrokeToPath(this.ctx,
|
157
|
+ this.strokeStyleId,
|
158
|
+ this.strokeWidth,
|
159
|
+ current,
|
160
|
+ path);
|
161
|
+
|
162
|
// draw the bottom and right sides in the darker color (raised mode) or the contrasting
|
163
|
// color otherwise
|
164
|
current = raised ? darker : lighter;
|
165
|
- this.drawLine(ctx, x + 1, y + height - 1 - inset, x + width - 1 - inset, y + height - 1 - inset, current);
|
166
|
- this.drawLine(ctx, x + width - 1 - inset, y, x + width - 1 - inset, y + height - 2, current);
|
167
|
+ path = this.drawLine(ctx, x + 1, y + height - 1 - inset, x + width - 1 - inset, y + height - 1 - inset, current);
|
168
|
+ more = this.drawLine(ctx, x + width - 1 - inset, y, x + width - 1 - inset, y + height - 2, current);
|
169
|
+ Array.prototype.push.apply(path, more);
|
170
|
+ strokesManager.applyStrokeToPath(this.ctx,
|
171
|
+ this.strokeStyleId,
|
172
|
+ this.strokeWidth,
|
173
|
+ current,
|
174
|
+ path);
|
175
|
|
176
|
// clear the clipping region
|
177
|
ctx.restore();
|
178
|
@@ -1966,12 +1996,14 @@
|
179
|
ctx.closePath();
|
180
|
renderClosedPath(ctx, fill);
|
181
|
}
|
182
|
-
|
183
|
+ var path = [];
|
184
|
// now overdraw the stroked portion
|
185
|
for (i = 0; i < (num - 1); i++)
|
186
|
{
|
187
|
- this.drawLine(ctx, xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1], color);
|
188
|
+ var more = this.drawLine(ctx, xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1], color);
|
189
|
+ Array.prototype.push.apply(path, more);
|
190
|
}
|
191
|
+ return path;
|
192
|
};
|
193
|
|
194
|
/**
|
195
|
|