author | ca |
Thu, 13 Feb 1997 22:55:41 +0100 | |
changeset 1346 | 619cd027ce68 |
parent 1319 | 4f21750c19bf |
child 1431 | d84f96e80223 |
permissions | -rw-r--r-- |
0 | 1 |
" |
6 | 2 |
COPYRIGHT (c) 1992 by Claus Gittinger |
71 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
Object subclass:#GraphicsContext |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
14 |
instanceVariableNames:'device paint bgPaint function font lineStyle lineWidth joinStyle |
716
b83fee8ff1b3
moved clipRect up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
15 |
capStyle mask maskOrigin transformation clipRect' |
519 | 16 |
classVariableNames:'White Black DefaultFont' |
17 |
poolDictionaries:'' |
|
18 |
category:'Graphics-Support' |
|
0 | 19 |
! |
20 |
||
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
21 |
!GraphicsContext class methodsFor:'documentation'! |
46 | 22 |
|
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1992 by Claus Gittinger |
|
71 | 26 |
All Rights Reserved |
46 | 27 |
|
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
this is an abstract superclass for all kinds of graphic drawables - |
|
40 |
both windows and printed pages (i.e. printers) are inheriting from |
|
41 |
this class (even drawables not at all associated with any device would do so). |
|
42 |
||
76 | 43 |
Drawing is done in paint/bgPaint colors, which can be true colors (i.e. |
44 |
directly supported by the underlying hardware) or simulated colors |
|
45 |
(i.e. dithered colors or images). |
|
46 |
The paint/bgPaint instance variables are set to the logical colors, |
|
47 |
device specific drawable may like to keep actual colors in addition. |
|
71 | 48 |
|
49 |
The transformation instance variable is typically nil, for a 1-to-1 |
|
50 |
coordinate mapping (i.e. x/y coordinates are pixels in the drawable). |
|
51 |
If nonNil, the transformation must be an instance of WindowingTransformation |
|
52 |
and offers both a scale-factor and a translation. |
|
53 |
Also, drawing in metric- or inch-units can be done using transformations. |
|
54 |
(see instance creation methods of WindowingTransformation, and examples |
|
55 |
in 'doc/coding'). |
|
46 | 56 |
|
57 |
All drawing is defined upon a few basic drawing methods, which must be |
|
58 |
implemented by subclasses (some subclasses also redefine the others for |
|
59 |
more performance) |
|
60 |
||
611 | 61 |
[Instance variables:] |
46 | 62 |
|
611 | 63 |
paint <Color> the paint used for drawing |
64 |
bgPaint <Color> the background used for drawing texts and bitmaps |
|
65 |
function <Symbol> the drawing function (i.e. #copy, #or, #xor ...) |
|
66 |
- not all Drawables support every function |
|
67 |
(i.e. paper only allows #copy) |
|
68 |
font <Font> the current font to be used for drawing |
|
69 |
lineStyle <Symbol> the lineStyle (i.e. #solid, #dashed, #doubleDashed) |
|
70 |
lineWidth <SmallInteger> the lineWidth (device dependent, usually pixels) |
|
71 |
joinStyle <Symbol> the style in which lines (in polygons) |
|
72 |
are joined (i.e. #miter, #bevel, #round) |
|
73 |
capStyle <Symbol> the style in which the last point of a line is drawn |
|
74 |
(i.e. #notLast, #butt, #round, #projecting) |
|
75 |
mask <Form> a mask used for drawing |
|
76 |
- not all Drawables support it |
|
77 |
maskOrigin <Point> the origin of the mask relative to |
|
78 |
the drawables origin |
|
716
b83fee8ff1b3
moved clipRect up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
79 |
transformation |
b83fee8ff1b3
moved clipRect up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
80 |
<WindowingTransformation> |
b83fee8ff1b3
moved clipRect up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
81 |
controls scale & translation of nonNil |
b83fee8ff1b3
moved clipRect up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
82 |
|
b83fee8ff1b3
moved clipRect up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
83 |
clipRect <Rectangle> a clip rectangle (device dep. usually pixels or inches) |
b83fee8ff1b3
moved clipRect up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
84 |
or nil. |
46 | 85 |
|
611 | 86 |
[Class variables:[ |
87 |
||
88 |
White <Color> cached white color - its needed so often |
|
89 |
Black <Color> cached black color - its needed so often |
|
46 | 90 |
|
611 | 91 |
DefaultFont <Font> default font to use |
46 | 92 |
|
611 | 93 |
[author:] |
94 |
Claus Gittinger |
|
657 | 95 |
|
96 |
[see also:] |
|
97 |
Color Font Form Image |
|
98 |
Geometric |
|
99 |
DeviceWorkstation |
|
46 | 100 |
" |
563 | 101 |
! |
102 |
||
103 |
examples |
|
104 |
" |
|
105 |
drawing uses a paint color (which may be a dithered one) which is |
|
106 |
used like a `pen'. |
|
107 |
A few drawing operations (opaqueForm and opaqueString drawing) |
|
108 |
use two colors, the paint and a backgroundPaint. For example, |
|
109 |
normal string drawing (#displayString:...) only draws the fonts |
|
110 |
on-pixels in the current paint, leaving off-pixels unchanged. |
|
111 |
In contrast, #drawOpaqueString:.. also changes these to the bgPaint color. |
|
112 |
The bgPaint can be changed with #backgroundPaint: or #paint:on: (which modifies both). |
|
113 |
||
114 |
lets try it in a view: |
|
619 | 115 |
[exBegin] |
563 | 116 |
|v| |
117 |
||
118 |
v := View new. |
|
119 |
v openAndWait. |
|
120 |
||
121 |
v paint:(Color red). |
|
122 |
v displayString:'hello' x:10 y:50 |
|
619 | 123 |
[exEnd] |
563 | 124 |
|
125 |
the same using opaque drawing: |
|
619 | 126 |
[exBegin] |
563 | 127 |
|v| |
128 |
||
129 |
v := View new. |
|
130 |
v openAndWait. |
|
131 |
||
132 |
v paint:(Color red) on:(Color yellow). |
|
133 |
v displayOpaqueString:'hello' x:10 y:50 |
|
619 | 134 |
[exEnd] |
563 | 135 |
|
136 |
||
137 |
||
138 |
Lines are drawn using the paint color (if solid) or both paint and bgPaint |
|
139 |
(dashed lines). The look of the line is controlled by joinStyle, capStyle, |
|
140 |
lineWidth and lineStyle. |
|
141 |
`lineStyle' can be one of #solid, #dashed, #doubleDashed |
|
142 |
where: #solid - is for solid lines, drawn with the current paint color |
|
143 |
||
144 |
#dashed - for dashed lines, where only the on-dashes are drawn |
|
145 |
with the current paint color |
|
146 |
||
147 |
#doubleDashed - dashed lines, draws on-dashes with paint color, |
|
148 |
off-dashes with bgPaint |
|
149 |
||
150 |
for example: |
|
619 | 151 |
[exBegin] |
563 | 152 |
|v| |
153 |
||
154 |
v := View new. |
|
155 |
v openAndWait. |
|
156 |
||
157 |
v paint:(Color red) on:(Color blue). |
|
158 |
v displayLineFrom:(10@10) to:(90@90). |
|
159 |
||
160 |
v lineStyle:#dashed. |
|
161 |
v displayLineFrom:(90@10) to:(10@90). |
|
162 |
||
163 |
v lineStyle:#doubleDashed. |
|
164 |
v displayRectangle:((5@5) corner:(95@95)). |
|
619 | 165 |
[exEnd] |
563 | 166 |
|
167 |
changing the line-width: |
|
619 | 168 |
[exBegin] |
563 | 169 |
|v| |
170 |
||
171 |
v := View new. |
|
172 |
v openAndWait. |
|
173 |
||
174 |
v paint:(Color red). |
|
175 |
v displayLineFrom:(20@20) to:(80@80). |
|
176 |
||
177 |
v lineWidth:5. |
|
178 |
v displayLineFrom:(80@20) to:(20@80). |
|
179 |
||
180 |
v lineWidth:8. |
|
181 |
v displayRectangle:((5@5) corner:(95@95)). |
|
619 | 182 |
[exEnd] |
563 | 183 |
|
184 |
with wide lines, the corners (of polygons or rectangles) can be |
|
185 |
one of the joinStyles: #miter, #bevel, #round. The default is #miter. |
|
619 | 186 |
[exBegin] |
563 | 187 |
|v| |
188 |
||
189 |
v := View new extent:200@200. |
|
190 |
v openAndWait. |
|
191 |
||
192 |
v lineWidth:15. |
|
193 |
v paint:(Color red). |
|
194 |
||
195 |
v displayRectangle:((65@65) corner:(135@135)). |
|
196 |
||
197 |
v joinStyle:#bevel. |
|
198 |
v displayRectangle:((45@45) corner:(155@155)). |
|
199 |
||
200 |
v joinStyle:#round. |
|
201 |
v displayRectangle:((25@25) corner:(175@175)). |
|
619 | 202 |
[exEnd] |
563 | 203 |
|
204 |
||
205 |
the endPoints look is controlled with capStyle; |
|
206 |
possible values are: #notLast, #butt, #round, #projecting. |
|
207 |
The default is #butt. |
|
208 |
#notLast is mostly useful when exoring (inverting): it will not draw the |
|
209 |
endPoint, to allow another line to join the previous line without inverting |
|
210 |
this point twice. (See the X manual for more info). |
|
619 | 211 |
[exBegin] |
563 | 212 |
|v| |
213 |
||
214 |
v := View new extent:200@200. |
|
215 |
v openAndWait. |
|
216 |
||
217 |
v lineWidth:15. |
|
218 |
v paint:(Color red). |
|
219 |
||
220 |
v displayLineFrom:(25@25) to:(175@25). |
|
221 |
||
222 |
v capStyle:#round. |
|
223 |
v displayLineFrom:(25@55) to:(175@55). |
|
224 |
||
225 |
v capStyle:#projecting. |
|
226 |
v displayLineFrom:(25@85) to:(175@85). |
|
619 | 227 |
[exEnd] |
563 | 228 |
|
229 |
||
230 |
You can use a bitmap as a point color: |
|
231 |
(this may be slow on some graphics devices, though) |
|
619 | 232 |
[exBegin] |
563 | 233 |
|v| |
234 |
||
235 |
v := View new extent:200@200. |
|
236 |
v openAndWait. |
|
237 |
||
238 |
v lineWidth:15. |
|
239 |
v paint:(Image fromFile:'granite_small.tiff'). |
|
240 |
||
241 |
v displayLineFrom:(25@25) to:(175@25). |
|
242 |
||
243 |
v capStyle:#round. |
|
244 |
v displayLineFrom:(25@55) to:(175@55). |
|
245 |
||
246 |
v capStyle:#projecting. |
|
247 |
v displayLineFrom:(25@85) to:(175@85). |
|
619 | 248 |
[exEnd] |
563 | 249 |
|
250 |
all views support a translation and scale, so you can draw in another |
|
251 |
coordinate system: |
|
619 | 252 |
[exBegin] |
563 | 253 |
|v| |
254 |
||
255 |
v := View new extent:200@200. |
|
256 |
v openAndWait. |
|
257 |
||
258 |
v displayForm:(Image fromFile:'SBrowser.xbm') x:10 y:10. |
|
259 |
||
260 |
v scale:(2@2); translation:50. |
|
261 |
v displayForm:(Image fromFile:'SBrowser.xbm') x:10 y:10. |
|
262 |
||
263 |
v scale:(0.5@0.5); translation:0. |
|
264 |
v displayForm:(Image fromFile:'SBrowser.xbm') x:10 y:10. |
|
619 | 265 |
[exEnd] |
563 | 266 |
|
267 |
if scaling is on, it is often useful to be able to draw individual |
|
268 |
things unscaled - this still translates the position, but |
|
269 |
uses the unscaled font (for example, to draw strings in a graphic): |
|
619 | 270 |
[exBegin] |
563 | 271 |
|v| |
272 |
||
273 |
v := View new extent:200@200. |
|
274 |
v openAndWait. |
|
275 |
||
276 |
v displayForm:(Image fromFile:'SBrowser.xbm') x:10 y:10. |
|
277 |
v displayString:'hello' x:50 y:40. |
|
278 |
||
279 |
v scale:(2@4). |
|
280 |
v displayForm:(Image fromFile:'SBrowser.xbm') x:10 y:10. |
|
281 |
v displayUnscaledString:'hello' x:50 y:40. |
|
619 | 282 |
[exEnd] |
563 | 283 |
|
284 |
Filled objects are drawin using the #fillXXX methods; for example, |
|
285 |
displayRectangleXXX draws the outline, while fillRectangleXXX draws a |
|
286 |
filled one: |
|
619 | 287 |
[exBegin] |
563 | 288 |
|v| |
289 |
||
290 |
v := View new extent:200@200. |
|
291 |
v openAndWait. |
|
292 |
||
293 |
v displayArcIn:(20@20 corner:50@50) from:0 angle:180. |
|
294 |
v paint:Color yellow. |
|
295 |
v fillArcIn:(120@120 corner:150@150) from:0 angle:180. |
|
296 |
||
297 |
v paint:Color red. |
|
298 |
v displayCircle:150@50 radius:30. |
|
299 |
v paint:Color blue. |
|
300 |
v fillCircle:50@150 radius:30. |
|
619 | 301 |
[exEnd] |
302 |
||
303 |
polygons: |
|
304 |
[exBegin] |
|
305 |
|v poly1 poly2| |
|
306 |
||
307 |
poly1 := OrderedCollection new. |
|
308 |
poly1 add:(10 @ 10). |
|
309 |
poly1 add:(100 @ 50). |
|
310 |
poly1 add:(50 @ 50). |
|
311 |
poly1 add:(20 @ 100). |
|
312 |
poly1 add:(10 @ 100). |
|
313 |
||
314 |
poly2 := poly1 copy. |
|
315 |
poly2 add:(poly2 first). |
|
316 |
||
317 |
v := View new extent:200@200. |
|
318 |
v openAndWait. |
|
319 |
||
320 |
v scale:2. |
|
321 |
v paint:Color red. |
|
322 |
v fillPolygon:poly1. |
|
323 |
||
324 |
v scale:1. |
|
325 |
v paint:Color blue. |
|
326 |
v displayPolygon:poly2. |
|
327 |
||
328 |
v scale:0.5. |
|
329 |
v paint:Color yellow. |
|
330 |
v fillPolygon:poly1. |
|
331 |
||
332 |
[exEnd] |
|
563 | 333 |
" |
46 | 334 |
! ! |
335 |
||
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
336 |
!GraphicsContext class methodsFor:'initialization'! |
0 | 337 |
|
338 |
initialize |
|
339 |
"setup some defaults - these are usually redefined |
|
340 |
during startup." |
|
341 |
||
134 | 342 |
White isNil ifTrue:[ |
386 | 343 |
Color isNil ifTrue:[^ self]. |
344 |
Display isNil ifTrue:[^ self]. |
|
345 |
||
134 | 346 |
Color initialize. |
46 | 347 |
|
134 | 348 |
White := Color white on:Display. |
349 |
Black := Color black on:Display. |
|
0 | 350 |
|
134 | 351 |
Font initialize. |
352 |
DefaultFont := Font family:'courier' face:'medium' style:'roman' size:12 |
|
353 |
] |
|
0 | 354 |
! ! |
355 |
||
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
356 |
!GraphicsContext class methodsFor:'instance creation'! |
0 | 357 |
|
519 | 358 |
new |
359 |
"return a new instance of myself. Redefined to initialize |
|
360 |
the new thingy" |
|
12 | 361 |
|
519 | 362 |
^ self basicNew initialize |
363 |
! ! |
|
364 |
||
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
365 |
!GraphicsContext class methodsFor:'accessing defaults'! |
0 | 366 |
|
367 |
defaultFont |
|
12 | 368 |
"get the default font used for drawing" |
369 |
||
71 | 370 |
DefaultFont isNil ifTrue:[ |
371 |
DefaultFont := Font family:'courier' face:'medium' style:'roman' size:12 |
|
372 |
]. |
|
0 | 373 |
^ DefaultFont |
519 | 374 |
! |
375 |
||
376 |
defaultFont:aFont |
|
377 |
"set the default font used for drawing" |
|
378 |
||
379 |
DefaultFont := aFont |
|
0 | 380 |
! ! |
381 |
||
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
382 |
!GraphicsContext class methodsFor:'constants'! |
0 | 383 |
|
519 | 384 |
capButt |
385 |
"return a constant to specify butt cap" |
|
0 | 386 |
|
519 | 387 |
^ #butt |
0 | 388 |
! |
389 |
||
390 |
capNotLast |
|
391 |
"return a constant to specify not-last cap" |
|
392 |
||
393 |
^ #notLast |
|
394 |
! |
|
395 |
||
396 |
capProjecting |
|
397 |
"return a constant to specify projecting cap" |
|
398 |
||
399 |
^ #projecting |
|
400 |
! |
|
401 |
||
402 |
capRound |
|
403 |
"return a constant to specify round cap" |
|
404 |
||
405 |
^ #round |
|
406 |
! |
|
407 |
||
519 | 408 |
joinBevel |
409 |
"return a constant to specify bevel join" |
|
410 |
||
411 |
^ #bevel |
|
412 |
! |
|
0 | 413 |
|
519 | 414 |
joinMiter |
415 |
"return a constant to specify miter join" |
|
416 |
||
417 |
^ #miter |
|
418 |
! |
|
419 |
||
420 |
joinRound |
|
421 |
"return a constant to specify round join" |
|
422 |
||
423 |
^ #round |
|
0 | 424 |
! ! |
425 |
||
519 | 426 |
!GraphicsContext methodsFor:'ST-80 compatibility'! |
427 |
||
428 |
findFont:aFontDescription |
|
585 | 429 |
"given a fontDescription, return a device font for it |
430 |
on my device." |
|
431 |
||
742 | 432 |
^ aFontDescription on:device |
585 | 433 |
|
742 | 434 |
"Modified: 28.5.1996 / 20:22:29 / cg" |
519 | 435 |
! |
0 | 436 |
|
785
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
437 |
phase |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
438 |
"return the origin within the mask (used to draw with patterns). |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
439 |
This is an alias for ST/X's #maskOrigin" |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
440 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
441 |
^ self maskOrigin |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
442 |
! |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
443 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
444 |
phase:aPoint |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
445 |
"set the origin within the mask (used to draw with patterns). |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
446 |
This is an alias for ST/X's #maskOrigin:" |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
447 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
448 |
^ self maskOrigin:aPoint |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
449 |
! |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
450 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
451 |
tilePhase |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
452 |
"return the origin within the mask (used to draw with patterns). |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
453 |
This is an alias for ST/X's #maskOrigin" |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
454 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
455 |
^ self maskOrigin |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
456 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
457 |
"Created: 4.6.1996 / 15:26:39 / cg" |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
458 |
! |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
459 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
460 |
tilePhase:aPoint |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
461 |
"set the origin within the mask (used to draw with patterns). |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
462 |
This is an alias for ST/X's #maskOrigin" |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
463 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
464 |
^ self maskOrigin:aPoint |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
465 |
|
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
466 |
"Created: 4.6.1996 / 15:26:49 / cg" |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
467 |
! |
6112ccde457f
added #tilePhase / #tilePhase: for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
468 |
|
519 | 469 |
widthOfString:aString |
585 | 470 |
"given a string, return its width in pixels if |
471 |
drawn on the receivers device." |
|
472 |
||
742 | 473 |
^ (font on:device) widthOf:aString |
585 | 474 |
|
742 | 475 |
"Modified: 28.5.1996 / 20:22:22 / cg" |
519 | 476 |
! |
109 | 477 |
|
519 | 478 |
widthOfString:aString from:start to:stop |
585 | 479 |
"given a string, return the width in pixels if |
480 |
a substring is drawn on the receivers device." |
|
481 |
||
742 | 482 |
^ (font on:device) widthOf:aString from:start to:stop |
585 | 483 |
|
742 | 484 |
"Modified: 28.5.1996 / 20:22:18 / cg" |
0 | 485 |
! ! |
486 |
||
519 | 487 |
!GraphicsContext methodsFor:'ST-80 displaying'! |
488 |
||
489 |
displayArc:origin radius:radius from:startAngle angle:angle |
|
490 |
"draw an arc around a point" |
|
491 |
||
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
492 |
self |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
493 |
displayArcX:(origin x - radius) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
494 |
y:(origin y - radius) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
495 |
width:(radius * 2) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
496 |
height:(radius * 2) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
497 |
from:startAngle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
498 |
angle:angle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
499 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
500 |
"Modified: 8.5.1996 / 08:34:43 / cg" |
519 | 501 |
! |
0 | 502 |
|
519 | 503 |
displayArcBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle at:origin |
504 |
"draw an arc/circle/ellipse - ST-80 compatibility" |
|
505 |
||
506 |
^ self displayArcX:(boundingBox left + origin x) |
|
507 |
y:(boundingBox top + origin y) |
|
508 |
width:(boundingBox width) |
|
509 |
height:(boundingBox height) |
|
510 |
from:startAngle |
|
511 |
angle:sweepAngle |
|
512 |
! |
|
513 |
||
514 |
displayLineFrom:startPoint to:endPoint translateBy:anOffset |
|
515 |
"draw a line - ST-80 compatibility" |
|
0 | 516 |
|
519 | 517 |
self displayLineFrom:(startPoint + anOffset) |
518 |
to:(endPoint + anOffset) |
|
519 |
! |
|
520 |
||
521 |
displayPolyline:aPolygon |
|
522 |
"draw a polygon - ST-80 compatibility" |
|
523 |
||
524 |
^ self displayPolygon:aPolygon |
|
525 |
! |
|
526 |
||
527 |
displayRectangularBorder:aRectangle at:aPoint |
|
528 |
"draw a rectangle - ST-80 compatibility" |
|
0 | 529 |
|
519 | 530 |
self displayRectangle:(aRectangle translateBy:aPoint) |
531 |
! |
|
532 |
||
1280 | 533 |
displayWedgeBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle |
534 |
"fill an arc/circle/ellipse - ST-80 compatibility" |
|
535 |
||
536 |
^ self fillArcX:(boundingBox left) |
|
537 |
y:(boundingBox top) |
|
538 |
width:(boundingBox width) |
|
539 |
height:(boundingBox height) |
|
540 |
from:startAngle |
|
541 |
angle:sweepAngle |
|
542 |
||
543 |
"Created: 27.1.1997 / 15:50:14 / cg" |
|
544 |
! |
|
545 |
||
519 | 546 |
displayWedgeBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle at:origin |
547 |
"fill an arc/circle/ellipse - ST-80 compatibility" |
|
2 | 548 |
|
519 | 549 |
^ self fillArcX:(boundingBox left + origin x) |
550 |
y:(boundingBox top + origin y) |
|
551 |
width:(boundingBox width) |
|
552 |
height:(boundingBox height) |
|
553 |
from:startAngle |
|
554 |
angle:sweepAngle |
|
2 | 555 |
! ! |
556 |
||
0 | 557 |
!GraphicsContext methodsFor:'accessing'! |
558 |
||
559 |
backgroundPaint |
|
560 |
"return the background paint color. |
|
561 |
(used for opaqueForms and opaqueStrings)" |
|
562 |
||
563 |
^ bgPaint |
|
564 |
! |
|
565 |
||
566 |
backgroundPaint:aColor |
|
567 |
"set the background painting color (which is used for |
|
568 |
opaqueForms and opaqueStrings). aColor can be a dithered one." |
|
569 |
||
678 | 570 |
bgPaint := aColor |
571 |
||
572 |
"Modified: 12.5.1996 / 22:25:17 / cg" |
|
0 | 573 |
! |
574 |
||
575 |
capStyle |
|
576 |
"return the current cap-style for line-drawing" |
|
577 |
||
578 |
^ capStyle |
|
579 |
! |
|
580 |
||
581 |
capStyle:aStyleSymbol |
|
582 |
"set the cap-style for line-drawing; |
|
583 |
possible styles are: #notLast, #butt, #round, #projecting" |
|
584 |
||
678 | 585 |
aStyleSymbol isNil ifTrue:[ |
586 |
capStyle := #butt |
|
587 |
] ifFalse:[ |
|
588 |
capStyle := aStyleSymbol |
|
589 |
] |
|
590 |
||
591 |
"Modified: 12.5.1996 / 22:24:30 / cg" |
|
0 | 592 |
! |
593 |
||
76 | 594 |
clipRect |
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
595 |
"return the clip-rectangle for drawing. |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
596 |
If there is currently no active clip, return the underlying |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
597 |
displaySurfaces (i.e. views) bounds. Added for ST-80 compatibility." |
76 | 598 |
|
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
599 |
self obsoleteMethodWarning:'use #clippingBounds'. |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
600 |
^ self clippingBounds. |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
601 |
|
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
602 |
"Modified: 28.5.1996 / 14:14:53 / cg" |
76 | 603 |
! |
604 |
||
0 | 605 |
clipRect:aRectangle |
606 |
"set the drawing clip-rectangle" |
|
607 |
||
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
608 |
self obsoleteMethodWarning:'use #clippingRectangle:'. |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
609 |
^ self clippingRectangle:aRectangle |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
610 |
|
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
611 |
"Modified: 28.5.1996 / 14:13:09 / cg" |
0 | 612 |
! |
613 |
||
76 | 614 |
clippingBounds |
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
615 |
"return the clip-rectangle for drawing. |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
616 |
If there is currently no active clip, return the underlying |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
617 |
displaySurfaces (i.e. views) bounds. Added for ST-80 compatibility." |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
618 |
|
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
619 |
|rect| |
76 | 620 |
|
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
621 |
clipRect isNil ifTrue:[ |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
622 |
rect := 0@0 extent:(self medium extent). |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
623 |
transformation notNil ifTrue:[ |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
624 |
rect := transformation applyInverseTo:rect. |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
625 |
]. |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
626 |
^ rect |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
627 |
]. |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
628 |
^ clipRect |
563 | 629 |
|
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
630 |
"Modified: 28.5.1996 / 14:05:15 / cg" |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
631 |
! |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
632 |
|
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
633 |
clippingRectangle:aRectangleOrNil |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
634 |
"set the clipping rectangle for drawing (in logical coordinates); |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
635 |
a nil argument turn off clipping (i.e. whole view is drawable)" |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
636 |
|
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
637 |
clipRect := aRectangleOrNil |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
638 |
|
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
639 |
"Modified: 22.5.1996 / 13:12:07 / cg" |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
640 |
"Created: 28.5.1996 / 14:09:27 / cg" |
76 | 641 |
! |
642 |
||
561
3c1ec7798f77
added #clippingRectangleOrNil for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
519
diff
changeset
|
643 |
clippingRectangleOrNil |
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
644 |
"return the clipping rectangle for drawing, nil if there is none." |
563 | 645 |
|
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
646 |
^ clipRect |
561
3c1ec7798f77
added #clippingRectangleOrNil for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
519
diff
changeset
|
647 |
|
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
648 |
"Created: 10.4.1996 / 14:32:02 / cg" |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
649 |
"Modified: 28.5.1996 / 14:08:19 / cg" |
561
3c1ec7798f77
added #clippingRectangleOrNil for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
519
diff
changeset
|
650 |
! |
3c1ec7798f77
added #clippingRectangleOrNil for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
519
diff
changeset
|
651 |
|
786 | 652 |
dashStyle:aDashList offset:dashOffset |
653 |
"define dashes. Each element of the dashList specifies the length |
|
654 |
of a corresponding dash. For example, setting it to [4 4] |
|
655 |
defines 4on-4off dashing; |
|
656 |
Setting it to [1 2 4 2] defines 1on-2off-4on-2off dashes. |
|
657 |
The dashOffset specifies where in the dashList the dashing starts. |
|
658 |
Ignored here - this may not be supported by all graphics devices." |
|
659 |
||
660 |
^ self |
|
661 |
||
662 |
"Created: 4.6.1996 / 18:59:34 / cg" |
|
663 |
"Modified: 4.6.1996 / 19:03:38 / cg" |
|
664 |
! |
|
665 |
||
519 | 666 |
font |
667 |
"return the current drawing font" |
|
668 |
||
669 |
^ font |
|
670 |
! |
|
671 |
||
672 |
font:aFont |
|
673 |
"set the drawing font" |
|
674 |
||
675 |
^ self subclassResponsibility |
|
676 |
! |
|
677 |
||
678 |
function |
|
679 |
"return the current drawing function" |
|
680 |
||
681 |
^ function |
|
682 |
! |
|
683 |
||
684 |
function:aFunctionSymbol |
|
685 |
"set the drawing function" |
|
686 |
||
687 |
^ self subclassResponsibility |
|
688 |
! |
|
689 |
||
735 | 690 |
graphicsContext |
691 |
"for ST-80 compatibility" |
|
692 |
||
693 |
^ self |
|
694 |
! |
|
695 |
||
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
696 |
graphicsDevice |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
697 |
"same as #device, for ST-80 compatibility" |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
698 |
|
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
699 |
^ device |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
700 |
! |
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
701 |
|
519 | 702 |
joinStyle |
703 |
"return the current join-style for polygon-drawing" |
|
704 |
||
705 |
^ joinStyle |
|
706 |
! |
|
12 | 707 |
|
519 | 708 |
joinStyle:aStyleSymbol |
709 |
"set the join-style of lines in polygon-drawing; |
|
710 |
possible styles are: #miter, #bevel, #round" |
|
711 |
||
678 | 712 |
aStyleSymbol isNil ifTrue:[ |
713 |
joinStyle := #miter |
|
714 |
] ifFalse:[ |
|
715 |
joinStyle := aStyleSymbol |
|
716 |
] |
|
717 |
||
718 |
"Modified: 12.5.1996 / 22:24:14 / cg" |
|
519 | 719 |
! |
720 |
||
721 |
lineStyle |
|
722 |
"return the current line-drawing-style" |
|
723 |
||
724 |
^ lineStyle |
|
2 | 725 |
! |
726 |
||
519 | 727 |
lineStyle:aStyleSymbol |
728 |
"set the line-drawing-style; |
|
729 |
possible styles are: #solid, #dashed, #doubleDashed" |
|
151 | 730 |
|
678 | 731 |
aStyleSymbol isNil ifTrue:[ |
732 |
lineStyle := #solid |
|
733 |
] ifFalse:[ |
|
734 |
lineStyle := aStyleSymbol |
|
735 |
] |
|
736 |
||
737 |
"Modified: 12.5.1996 / 22:19:25 / cg" |
|
519 | 738 |
! |
739 |
||
740 |
lineWidth |
|
741 |
"return the current drawing linewidth" |
|
742 |
||
743 |
^ lineWidth |
|
151 | 744 |
! |
745 |
||
519 | 746 |
lineWidth:aNumber |
747 |
"set the line drawing width in pixels" |
|
748 |
||
749 |
lineWidth := aNumber |
|
750 |
! |
|
151 | 751 |
|
519 | 752 |
mask |
753 |
"return the current drawing mask" |
|
754 |
||
755 |
^ mask |
|
756 |
! |
|
757 |
||
758 |
mask:aForm |
|
759 |
"set the drawing mask" |
|
760 |
||
761 |
^ self subclassResponsibility |
|
151 | 762 |
! |
763 |
||
764 |
maskOrigin |
|
765 |
"return the origin within the mask (used to draw with patterns). |
|
766 |
Should be redefined in classes which support it. |
|
767 |
This is an alias for ST-80's #phase" |
|
768 |
||
769 |
^ maskOrigin |
|
770 |
! |
|
771 |
||
772 |
maskOrigin:aPoint |
|
773 |
"set the origin within the mask (used to draw with patterns). |
|
774 |
Should be redefined in classes which support it. |
|
775 |
This is an alias for ST-80's #phase:" |
|
776 |
||
777 |
^ self maskOriginX:aPoint x y:aPoint y |
|
778 |
! |
|
779 |
||
780 |
maskOriginX:x y:y |
|
781 |
"set the origin within the mask (used to draw with patterns). |
|
782 |
Should be redefined in classes which support it. |
|
783 |
This is an alias for ST-80's #phase:" |
|
109 | 784 |
|
12 | 785 |
^ self |
786 |
! |
|
787 |
||
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
788 |
medium |
1346 | 789 |
"return the destination medium i.e. the underlying graphics device" |
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
790 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
726
diff
changeset
|
791 |
^ device |
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
792 |
|
720 | 793 |
"Modified: 28.5.1996 / 14:26:03 / cg" |
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
794 |
! |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
795 |
|
519 | 796 |
paint |
797 |
"return the current paint drawing color" |
|
798 |
||
799 |
^ paint |
|
800 |
! |
|
801 |
||
802 |
paint:aColor |
|
803 |
"set the drawing painting color, aColor can be a dithered one" |
|
804 |
||
805 |
paint := aColor |
|
806 |
! |
|
807 |
||
808 |
paint:fgColor on:bgColor |
|
563 | 809 |
"set the paint and backgroundPaint, used for text and bitmaps. |
810 |
Both colors may be dithered colors" |
|
519 | 811 |
|
671 | 812 |
fgColor ~~ paint ifTrue:[ |
813 |
self paint:fgColor. |
|
814 |
]. |
|
519 | 815 |
bgPaint := bgColor |
563 | 816 |
|
671 | 817 |
"Modified: 12.5.1996 / 19:40:43 / cg" |
519 | 818 |
! |
819 |
||
151 | 820 |
setMaskOrigin:aPoint |
821 |
"set the origin within the mask (used to draw with patterns). |
|
822 |
OBSOLETE: use #maskOrigin: or #phase:" |
|
823 |
||
824 |
^ self maskOrigin:aPoint |
|
825 |
! |
|
826 |
||
2 | 827 |
setMaskOriginX:x y:y |
109 | 828 |
"set the origin within the mask (used to draw with patterns). |
151 | 829 |
OBSOLETE: use #maskOriginX:y: or #phase:" |
109 | 830 |
|
151 | 831 |
^ self maskOriginX:x y:y |
2 | 832 |
! |
833 |
||
519 | 834 |
viewOrigin |
835 |
"return the drawables visible origin (for scrolling)" |
|
836 |
||
837 |
^ 0@0 |
|
418
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
838 |
! ! |
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
839 |
|
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
840 |
!GraphicsContext methodsFor:'accessing-transformation'! |
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
841 |
|
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
842 |
scale |
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
843 |
"return the scale factor (as point) of the transformation" |
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
844 |
|
707 | 845 |
transformation isNil ifTrue:[^ 1@1]. |
418
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
846 |
^ transformation scale |
707 | 847 |
|
848 |
"Modified: 21.5.1996 / 21:16:47 / cg" |
|
418
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
849 |
! |
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
850 |
|
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
851 |
scale:aPoint |
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
852 |
"set the scale factor of the transformation" |
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
853 |
|
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
854 |
transformation isNil ifTrue:[ |
619 | 855 |
aPoint = 1 ifTrue:[^ self]. |
856 |
transformation := WindowingTransformation scale:aPoint translation:0 |
|
857 |
] ifFalse:[ |
|
858 |
transformation scale:aPoint. |
|
859 |
] |
|
418
0e10e256d5b2
scale access methods moved from SimpleView
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
860 |
|
619 | 861 |
"Modified: 27.4.1996 / 18:47:38 / cg" |
76 | 862 |
! |
863 |
||
864 |
transformation |
|
865 |
"return the transformation" |
|
866 |
||
867 |
^ transformation |
|
868 |
! |
|
869 |
||
870 |
transformation:aTransformation |
|
871 |
"set the transformation" |
|
872 |
||
873 |
transformation := aTransformation |
|
619 | 874 |
! |
875 |
||
1319 | 876 |
translateBy:aPoint |
877 |
"add to the translation offset of the transformation" |
|
878 |
||
879 |
transformation isNil ifTrue:[ |
|
880 |
aPoint = 0 ifTrue:[^ self]. |
|
881 |
transformation := WindowingTransformation scale:1 translation:aPoint |
|
882 |
] ifFalse:[ |
|
883 |
transformation translateBy:aPoint |
|
884 |
] |
|
885 |
||
886 |
"Created: 10.2.1997 / 13:50:22 / cg" |
|
887 |
! |
|
888 |
||
619 | 889 |
translation |
890 |
"return the translation factor (as point) of the transformation" |
|
891 |
||
892 |
transformation isNil ifTrue:[^ 0@0]. |
|
893 |
^ transformation translation |
|
894 |
||
895 |
"Created: 27.4.1996 / 18:46:41 / cg" |
|
896 |
! |
|
897 |
||
898 |
translation:aPoint |
|
899 |
"set the translation offset of the transformation" |
|
900 |
||
901 |
transformation isNil ifTrue:[ |
|
902 |
aPoint = 0 ifTrue:[^ self]. |
|
903 |
transformation := WindowingTransformation scale:1 translation:aPoint |
|
904 |
] ifFalse:[ |
|
905 |
transformation translation:aPoint. |
|
906 |
] |
|
907 |
||
908 |
"Created: 27.4.1996 / 18:47:28 / cg" |
|
0 | 909 |
! ! |
910 |
||
755 | 911 |
!GraphicsContext methodsFor:'backward compatibility'! |
912 |
||
913 |
withPattern:aPattern do:aBlock |
|
914 |
|old| |
|
915 |
||
916 |
aPattern isColor ifTrue:[ |
|
917 |
old := paint. |
|
918 |
self paint:aPattern. |
|
919 |
aBlock value. |
|
920 |
self paint:old |
|
921 |
] ifFalse:[ |
|
922 |
old := mask. |
|
923 |
self mask:aPattern. |
|
924 |
aBlock value. |
|
925 |
self mask:old |
|
926 |
] |
|
927 |
||
928 |
"Modified: 28.5.1996 / 22:45:40 / cg" |
|
929 |
! ! |
|
930 |
||
71 | 931 |
!GraphicsContext methodsFor:'basic displaying'! |
0 | 932 |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
933 |
displayArcX:x y:y width:width height:height from:startAngle angle:angle |
0 | 934 |
"draw an arc in a box |
935 |
- this could be recoded to draw using displayLine" |
|
936 |
||
937 |
^ self subclassResponsibility |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
938 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
939 |
"Created: 8.5.1996 / 08:47:06 / cg" |
0 | 940 |
! |
941 |
||
726 | 942 |
displayLineFromX:x0 y:y0 toX:x1 y:y1 |
943 |
"draw a line from x0/y0 to x1/y1" |
|
0 | 944 |
|
726 | 945 |
^ self subclassResponsibility |
71 | 946 |
|
726 | 947 |
"Created: 28.5.1996 / 17:12:37 / cg" |
0 | 948 |
! |
949 |
||
26 | 950 |
displayOpaqueForm:aForm x:x y:y |
0 | 951 |
"draw a form at x/y; if the form has depth 1, 1's in the form are |
952 |
drawn in current fg, 0's in current bg color. |
|
953 |
If the form has depth ~~ 1, it is copied as is onto the receiver" |
|
954 |
||
955 |
^ self subclassResponsibility |
|
956 |
! |
|
957 |
||
958 |
displayOpaqueString:aString from:index1 to:index2 x:x y:y |
|
959 |
"draw part of a string with both fg and bg at x/y in current font" |
|
960 |
||
961 |
^ self subclassResponsibility |
|
962 |
! |
|
963 |
||
519 | 964 |
displayPolygon:aPolygon |
965 |
"draw a polygon |
|
966 |
- this could be recoded to draw using displayLine" |
|
967 |
||
968 |
^ self subclassResponsibility |
|
969 |
! |
|
970 |
||
971 |
displayRectangleX:x y:y width:w height:h |
|
972 |
"draw a rectangle |
|
973 |
- this could be recoded to draw using displayLine" |
|
974 |
||
975 |
^ self subclassResponsibility |
|
976 |
! |
|
977 |
||
0 | 978 |
displayString:aString from:index1 to:index2 x:x y:y |
979 |
"draw part of a string with fg at x/y in current font" |
|
980 |
||
981 |
^ self subclassResponsibility |
|
982 |
! ! |
|
983 |
||
519 | 984 |
!GraphicsContext methodsFor:'basic filling'! |
0 | 985 |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
986 |
fillArcX:x y:y width:w height:h from:start angle:angle |
519 | 987 |
"fill an arc with current paint color" |
0 | 988 |
|
519 | 989 |
^ self subclassResponsibility |
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
990 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
991 |
"Created: 8.5.1996 / 08:47:44 / cg" |
0 | 992 |
! |
993 |
||
519 | 994 |
fillPolygon:points |
995 |
"fill a polygon with current paint color" |
|
0 | 996 |
|
519 | 997 |
^ self subclassResponsibility |
157 | 998 |
! |
999 |
||
519 | 1000 |
fillRectangleX:x y:y width:w height:h |
1001 |
"fill a rectangle with current paint color" |
|
0 | 1002 |
|
519 | 1003 |
^ self subclassResponsibility |
1004 |
! ! |
|
0 | 1005 |
|
519 | 1006 |
!GraphicsContext methodsFor:'bit blitting'! |
0 | 1007 |
|
519 | 1008 |
copyFrom:aGC toX:dstX y:dstY |
1009 |
"copy from a drawable - maybe self" |
|
0 | 1010 |
|
519 | 1011 |
self copyFrom:aGC x:0 y:0 toX:dstX y:dstY width:aGC width height:aGC height |
0 | 1012 |
! |
1013 |
||
519 | 1014 |
copyFrom:aGC x:srcX y:srcY toX:dstX y:dstY width:w height:h |
1015 |
"copy from a drawable - maybe self" |
|
0 | 1016 |
|
519 | 1017 |
^ self subclassResponsibility |
0 | 1018 |
! |
1019 |
||
519 | 1020 |
copyFrom:aGC x:dstX y:dstY width:w height:h |
1021 |
"copy from a drawable - maybe self" |
|
0 | 1022 |
|
519 | 1023 |
self copyFrom:aGC x:0 y:0 toX:dstX y:dstY width:w height:h |
1024 |
! ! |
|
0 | 1025 |
|
519 | 1026 |
!GraphicsContext methodsFor:'drawing'! |
0 | 1027 |
|
719
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
1028 |
display:someObject at:aPoint |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
1029 |
"draw someObject - this must understand the #displayOn:at: message" |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
1030 |
|
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
1031 |
someObject displayOn:self at:aPoint |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
1032 |
|
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
1033 |
"Created: 28.5.1996 / 14:22:57 / cg" |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
1034 |
! |
62f1217f0084
prepare for separation of the view hierarchy; moved clipStuff up into here
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
1035 |
|
12 | 1036 |
displayArcIn:aRectangle from:startAngle angle:angle |
1037 |
"draw an arc in a box" |
|
0 | 1038 |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1039 |
self |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1040 |
displayArcX:(aRectangle left) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1041 |
y:(aRectangle top) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1042 |
width:(aRectangle width) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1043 |
height:(aRectangle height) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1044 |
from:startAngle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1045 |
angle:angle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1046 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1047 |
"Modified: 8.5.1996 / 08:35:00 / cg" |
0 | 1048 |
! |
1049 |
||
12 | 1050 |
displayArcOrigin:origin corner:corner from:startAngle angle:angle |
1051 |
"draw an arc in a box" |
|
0 | 1052 |
|
1053 |
|left top right bot| |
|
1054 |
||
1055 |
left := origin x. |
|
1056 |
top := origin y. |
|
1057 |
right := corner x. |
|
1058 |
bot := corner y. |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1059 |
self |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1060 |
displayArcX:left |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1061 |
y:top |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1062 |
width:(right - left + 1) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1063 |
height:(bot - top + 1) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1064 |
from:startAngle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1065 |
angle:angle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1066 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1067 |
"Modified: 8.5.1996 / 08:35:25 / cg" |
0 | 1068 |
! |
1069 |
||
726 | 1070 |
displayArcX:x y:y w:w h:h from:startAngle angle:angle |
1071 |
"draw an arc; apply transformation if nonNil" |
|
1072 |
||
1073 |
self obsoleteMethodWarning:'use #displayArcX:y:width:height:from:angle:'. |
|
1074 |
self displayArcX:x y:y width:w height:h from:startAngle angle:angle |
|
1075 |
||
1076 |
"Modified: 8.5.1996 / 08:46:56 / cg" |
|
1077 |
! |
|
1078 |
||
519 | 1079 |
displayCircle:aPoint radius:r |
1080 |
"draw a circle around a center point" |
|
1081 |
||
1082 |
self displayCircleX:(aPoint x) y:(aPoint y) radius:r |
|
1083 |
! |
|
1084 |
||
12 | 1085 |
displayCircleIn:aRectangle |
0 | 1086 |
"draw a circle in a box" |
1087 |
||
1088 |
self |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1089 |
displayArcX:(aRectangle left) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1090 |
y:(aRectangle top) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1091 |
width:(aRectangle width) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1092 |
height:(aRectangle height) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1093 |
from:0 |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1094 |
angle:360 |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1095 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1096 |
"Modified: 8.5.1996 / 08:35:40 / cg" |
0 | 1097 |
! |
1098 |
||
12 | 1099 |
displayCircleX:x y:y radius:r |
1100 |
"draw a circle around a center point" |
|
0 | 1101 |
|
1102 |
|d| |
|
1103 |
d := 2 * r. |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1104 |
self |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1105 |
displayArcX:(x - r) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1106 |
y:(y - r) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1107 |
width:d |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1108 |
height:d |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1109 |
from:0 |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1110 |
angle:360 |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1111 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1112 |
"Modified: 8.5.1996 / 08:36:03 / cg" |
519 | 1113 |
! |
1114 |
||
1115 |
displayForm:aForm at:aPoint |
|
1116 |
"draw a form" |
|
1117 |
||
1118 |
self displayForm:aForm x:(aPoint x) y:(aPoint y) |
|
1119 |
! |
|
1120 |
||
726 | 1121 |
displayForm:aForm x:x y:y |
1122 |
"draw a form at x/y; if the form has depth 1, 1's in the form are |
|
1123 |
drawn in current paint color, 0's are ignored. |
|
1124 |
If the form has depth ~~ 1, the result is undefined" |
|
1125 |
||
1126 |
|fg bg f noColor| |
|
1127 |
||
1128 |
fg := paint. |
|
1129 |
bg := bgPaint. |
|
1130 |
f := function. |
|
1131 |
||
1132 |
f ~~ #copy ifTrue:[ |
|
1133 |
self error:'function not supported'. |
|
1134 |
^ self |
|
1135 |
]. |
|
1136 |
||
1137 |
noColor := Color noColor. |
|
1138 |
" |
|
1139 |
stamp out fg-pixels |
|
1140 |
" |
|
1141 |
self paint:noColor on:Color allColor function:#and. |
|
1142 |
self displayOpaqueForm:aForm x:x y:y. |
|
1143 |
" |
|
1144 |
or-in fg-pixels |
|
1145 |
" |
|
1146 |
self paint:fg on:Color noColor function:#or. |
|
1147 |
self displayOpaqueForm:aForm x:x y:y. |
|
1148 |
self paint:fg on:fg function:f. |
|
1149 |
||
1150 |
"Modified: 28.5.1996 / 17:10:28 / cg" |
|
1151 |
! |
|
1152 |
||
519 | 1153 |
displayLineFrom:point1 to:point2 |
1154 |
"draw a line" |
|
1155 |
||
1156 |
self displayLineFromX:(point1 x) y:(point1 y) |
|
1157 |
toX:(point2 x) y:(point2 y) |
|
1158 |
! |
|
1159 |
||
1160 |
displayOpaqueString:aString at:aPoint |
|
1161 |
"draw a string with both fg and bg" |
|
1162 |
||
1163 |
self displayOpaqueString:aString x:(aPoint x) y:(aPoint y) |
|
1164 |
! |
|
1165 |
||
1166 |
displayOpaqueString:aString from:start to:stop at:aPoint |
|
1167 |
"draw part of a string - drawing both fg and bg" |
|
1168 |
||
1169 |
^ self displayOpaqueString:aString from:start to:stop x:aPoint x y:aPoint y |
|
1170 |
! |
|
1171 |
||
1172 |
displayOpaqueString:aString x:x y:y |
|
1173 |
"draw a string with both fg and bg" |
|
1174 |
||
1175 |
self displayOpaqueString:aString from:1 to:(aString size) x:x y:y |
|
1176 |
! |
|
1177 |
||
1178 |
displayPoint:aPoint |
|
1179 |
"draw a pixel" |
|
1180 |
||
1181 |
self displayPointX:(aPoint x) y:(aPoint y) |
|
1182 |
! |
|
1183 |
||
1184 |
displayPointX:x y:y |
|
1185 |
"draw a point at x/y" |
|
1186 |
||
1187 |
self displayLineFromX:x y:y toX:x y:y |
|
1188 |
! |
|
1189 |
||
1190 |
displayRectangle:aRectangle |
|
1191 |
"draw a rectangle" |
|
1192 |
||
1193 |
self displayRectangleX:(aRectangle left) |
|
1194 |
y:(aRectangle top) |
|
1195 |
width:(aRectangle width) |
|
1196 |
height:(aRectangle height) |
|
1197 |
! |
|
1198 |
||
1199 |
displayRectangleOrigin:origin corner:corner |
|
1200 |
"draw a rectangle" |
|
1201 |
||
1202 |
|top left| |
|
1203 |
||
1204 |
left := origin x. |
|
1205 |
top := origin y. |
|
1206 |
self displayRectangleX:left y:top |
|
563 | 1207 |
width:(corner x - left) |
1208 |
height:(corner y - top) |
|
1209 |
||
1210 |
"Modified: 13.4.1996 / 20:58:31 / cg" |
|
519 | 1211 |
! |
1212 |
||
1213 |
displayString:aString at:aPoint |
|
1214 |
"draw a string - drawing fg only" |
|
1215 |
||
1216 |
self displayString:aString x:aPoint x y:aPoint y |
|
1217 |
! |
|
1218 |
||
1219 |
displayString:aString from:start to:stop at:aPoint |
|
1220 |
"draw part of a string - drawing fg only" |
|
1221 |
||
1222 |
^ self displayString:aString from:start to:stop x:aPoint x y:aPoint y |
|
1223 |
! |
|
1224 |
||
1225 |
displayString:aString x:x y:y |
|
1226 |
"draw a string - drawing fg only" |
|
1227 |
||
1228 |
self displayString:aString from:1 to:(aString size) x:x y:y |
|
726 | 1229 |
! |
1230 |
||
1231 |
fillArcX:x y:y w:w h:h from:startAngle angle:angle |
|
1232 |
"draw a filled arc; apply transformation if nonNil" |
|
1233 |
||
1234 |
self obsoleteMethodWarning:'use #fillArcX:y:width:height:from:angle:'. |
|
1235 |
self fillArcX:x y:y width:w height:h from:startAngle angle:angle |
|
1236 |
||
1237 |
"Modified: 8.5.1996 / 08:47:52 / cg" |
|
0 | 1238 |
! ! |
519 | 1239 |
|
1240 |
!GraphicsContext methodsFor:'drawing in device coordinates'! |
|
1241 |
||
1242 |
displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2 |
|
1243 |
"draw a line in device coordinates" |
|
1244 |
||
1245 |
|sav| |
|
1246 |
||
1247 |
sav := transformation. |
|
1248 |
transformation := nil. |
|
1249 |
self displayLineFromX:x1 y:y1 toX:x2 y:y2. |
|
1250 |
transformation := sav |
|
1251 |
! |
|
1252 |
||
1253 |
fillDeviceRectangleX:x y:y width:w height:h |
|
1254 |
"fill a rectangle with current paint color (device coordinates)" |
|
1255 |
||
1256 |
|sav| |
|
1257 |
||
1258 |
sav := transformation. |
|
1259 |
transformation := nil. |
|
1260 |
self fillRectangleX:x y:y width:w height:h. |
|
1261 |
transformation := sav |
|
1262 |
! ! |
|
1263 |
||
713 | 1264 |
!GraphicsContext methodsFor:'edge drawing'! |
1265 |
||
1266 |
drawEdgesForX:x y:y width:w height:h level:l |
|
1267 |
shadow:shadowColor light:lightColor |
|
1268 |
halfShadow:halfShadowColor halfLight:halfLightColor |
|
1269 |
style:edgeStyle |
|
1270 |
||
1271 |
"draw 3D edges into a rectangle" |
|
1272 |
||
1273 |
|topLeftFg botRightFg topLeftHalfFg botRightHalfFg |
|
1274 |
count "{ Class: SmallInteger }" |
|
1275 |
r "{ Class: SmallInteger }" |
|
1276 |
b "{ Class: SmallInteger }" |
|
1277 |
xi "{ Class: SmallInteger }" |
|
1278 |
yi "{ Class: SmallInteger }" |
|
1279 |
run paint| |
|
1280 |
||
1281 |
count := l. |
|
1282 |
(count < 0) ifTrue:[ |
|
1283 |
topLeftFg := shadowColor. |
|
1284 |
botRightFg := lightColor. |
|
1285 |
topLeftHalfFg := halfShadowColor. |
|
1286 |
botRightHalfFg := halfLightColor. |
|
1287 |
count := count negated |
|
1288 |
] ifFalse:[ |
|
1289 |
topLeftFg := lightColor. |
|
1290 |
botRightFg := shadowColor. |
|
1291 |
topLeftHalfFg := halfLightColor. |
|
1292 |
botRightHalfFg := halfShadowColor. |
|
1293 |
]. |
|
1294 |
topLeftHalfFg isNil ifTrue:[ |
|
1295 |
topLeftHalfFg := topLeftFg |
|
1296 |
]. |
|
1297 |
botRightHalfFg isNil ifTrue:[ |
|
1298 |
botRightHalfFg := botRightFg |
|
1299 |
]. |
|
1300 |
||
1301 |
r := x + w - 1. "right" |
|
1302 |
b := y + h - 1. "bottom" |
|
1303 |
||
1304 |
self lineWidth:0. |
|
1305 |
||
1306 |
"top and left edges" |
|
1307 |
((edgeStyle == #soft) and:["l" count > 0]) ifTrue:[ |
|
1308 |
paint := topLeftHalfFg |
|
1309 |
] ifFalse:[ |
|
1310 |
paint := topLeftFg |
|
1311 |
]. |
|
1312 |
self paint:paint. |
|
1313 |
||
1314 |
0 to:(count - 1) do:[:i | |
|
1315 |
run := y + i. |
|
1316 |
self displayDeviceLineFromX:x y:run toX:r y:run. "top" |
|
1317 |
run := x + i. |
|
1318 |
self displayDeviceLineFromX:run y:y toX:run y:b "left" |
|
1319 |
]. |
|
1320 |
(edgeStyle == #soft) ifTrue:[ |
|
1321 |
" |
|
1322 |
self paint:topLeftFg. |
|
1323 |
self displayDeviceLineFromX:x y:y toX:r y:y. |
|
1324 |
self displayDeviceLineFromX:x y:y toX:x y:b |
|
1325 |
" |
|
1326 |
(l > 2) ifTrue:[ |
|
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
1327 |
self paint:(device blackColor). |
713 | 1328 |
self displayDeviceLineFromX:x y:y toX:r y:y. |
1329 |
self displayDeviceLineFromX:x y:y toX:x y:b. |
|
1330 |
] |
|
1331 |
]. |
|
1332 |
||
1333 |
xi := x + 1. |
|
1334 |
yi := y + 1. |
|
1335 |
||
1336 |
"/ does not look good |
|
1337 |
"/ style == #st80 iftrue:[ |
|
1338 |
"/ yi := yi + 1 |
|
1339 |
"/ ]. |
|
1340 |
||
1341 |
"bottom and right edges" |
|
1342 |
(edgeStyle == #soft "new:" and:[count > 1]) ifTrue:[ |
|
1343 |
paint := botRightHalfFg |
|
1344 |
] ifFalse:[ |
|
1345 |
paint := botRightFg |
|
1346 |
]. |
|
1347 |
||
1348 |
self paint:paint. |
|
1349 |
0 to:(count - 1) do:[:i | |
|
1350 |
run := b - i. |
|
1351 |
self displayDeviceLineFromX:xi-1 y:run toX:r y:run. "bottom" |
|
1352 |
run := r - i. |
|
1353 |
self displayDeviceLineFromX:run y:yi-1 toX:run y:b. "right" |
|
1354 |
xi := xi + 1. |
|
1355 |
yi := yi + 1 |
|
1356 |
]. |
|
1357 |
((edgeStyle == #soft) and:[l > 1]) ifTrue:[ |
|
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
1358 |
self paint:(device blackColor) "shadowColor". |
713 | 1359 |
self displayDeviceLineFromX:(x + (1 - 1)) y:b toX:r y:b. |
1360 |
self displayDeviceLineFromX:r y:(y + (1 - 1)) toX:r y:b |
|
1361 |
] |
|
1362 |
||
1363 |
"Created: 24.5.1996 / 19:28:38 / cg" |
|
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
1364 |
"Modified: 13.1.1997 / 23:09:33 / cg" |
713 | 1365 |
! ! |
1366 |
||
519 | 1367 |
!GraphicsContext methodsFor:'filling'! |
1368 |
||
1369 |
fillArc:origin radius:r from:startAngle angle:angle |
|
1370 |
"draw a filled arc around a point" |
|
1371 |
||
1372 |
|d| |
|
1373 |
d := 2 * r. |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1374 |
self |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1375 |
fillArcX:(origin x - r) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1376 |
y:(origin y - r) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1377 |
width:d |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1378 |
height:d |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1379 |
from:startAngle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1380 |
angle:angle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1381 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1382 |
"Modified: 8.5.1996 / 08:41:54 / cg" |
519 | 1383 |
! |
1384 |
||
563 | 1385 |
fillArcIn:aRectangle from:startAngle angle:angle |
1386 |
"draw a filled arc in a box" |
|
1387 |
||
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1388 |
self |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1389 |
fillArcX:(aRectangle left) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1390 |
y:(aRectangle top) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1391 |
width:(aRectangle width) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1392 |
height:(aRectangle height) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1393 |
from:startAngle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1394 |
angle:angle |
563 | 1395 |
|
1396 |
"Created: 13.4.1996 / 20:56:03 / cg" |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1397 |
"Modified: 8.5.1996 / 08:42:13 / cg" |
563 | 1398 |
! |
1399 |
||
1400 |
fillArcOrigin:origin corner:corner from:startAngle angle:angle |
|
1401 |
"draw a filled arc in a box" |
|
1402 |
||
1403 |
|left top right bot| |
|
1404 |
||
1405 |
left := origin x. |
|
1406 |
top := origin y. |
|
1407 |
right := corner x. |
|
1408 |
bot := corner y. |
|
1409 |
self |
|
1410 |
fillArcX:left |
|
1411 |
y:top |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1412 |
width:(right - left + 1) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1413 |
height:(bot - top + 1) |
563 | 1414 |
from:startAngle |
1415 |
angle:angle |
|
1416 |
||
1417 |
"Created: 13.4.1996 / 20:56:56 / cg" |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1418 |
"Modified: 8.5.1996 / 08:42:23 / cg" |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1419 |
! |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1420 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1421 |
fillArcX:x y:y width:w height:h from:startAngle to:endAngle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1422 |
"draw a filled arc in a box, given startAngle and endAngle." |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1423 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1424 |
self |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1425 |
fillArcX:x |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1426 |
y:y |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1427 |
width:w |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1428 |
height:h |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1429 |
from:startAngle |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1430 |
angle:(endAngle - startAngle) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1431 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1432 |
"Created: 8.5.1996 / 08:52:41 / cg" |
563 | 1433 |
! |
1434 |
||
519 | 1435 |
fillCircle:aPoint radius:aNumber |
1436 |
"draw a filled circle around aPoint" |
|
1437 |
||
1438 |
self fillCircleX:(aPoint x) y:(aPoint y) radius:aNumber |
|
1439 |
! |
|
1440 |
||
563 | 1441 |
fillCircleIn:aRectangle |
1442 |
"draw a filled circle in a box" |
|
1443 |
||
1444 |
self |
|
1445 |
fillArcX:(aRectangle left) |
|
1446 |
y:(aRectangle top) |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1447 |
width:(aRectangle width) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1448 |
height:(aRectangle height) |
563 | 1449 |
from:0 |
1450 |
angle:360 |
|
1451 |
||
1452 |
"Created: 13.4.1996 / 20:57:41 / cg" |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1453 |
"Modified: 8.5.1996 / 08:42:38 / cg" |
563 | 1454 |
! |
1455 |
||
519 | 1456 |
fillCircleX:x y:y radius:r |
1457 |
"draw a filled circle around x@y" |
|
1458 |
||
1459 |
|d| |
|
1460 |
||
1461 |
d := 2 * r. |
|
653
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1462 |
self |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1463 |
fillArcX:(x - r) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1464 |
y:(y - r) |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1465 |
width:d |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1466 |
height:d |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1467 |
from:0 |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1468 |
angle:360 |
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1469 |
|
0ad3de022f8b
fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents:
619
diff
changeset
|
1470 |
"Modified: 8.5.1996 / 08:43:02 / cg" |
519 | 1471 |
! |
1472 |
||
1473 |
fillRectangle:aRectangle |
|
1474 |
"fill a rectangle with current paint color" |
|
1475 |
||
1476 |
self fillRectangleX:(aRectangle left) |
|
1477 |
y:(aRectangle top) |
|
1478 |
width:(aRectangle width) |
|
1479 |
height:(aRectangle height) |
|
563 | 1480 |
! |
1481 |
||
1482 |
fillRectangleOrigin:origin corner:corner |
|
1483 |
"draw a filled rectangle" |
|
1484 |
||
1485 |
|top left| |
|
1486 |
||
1487 |
left := origin x. |
|
1488 |
top := origin y. |
|
1489 |
self fillRectangleX:left y:top |
|
1490 |
width:(corner x - left) |
|
1491 |
height:(corner y - top) |
|
1492 |
||
1493 |
"Created: 13.4.1996 / 20:58:16 / cg" |
|
519 | 1494 |
! ! |
1495 |
||
1496 |
!GraphicsContext methodsFor:'initialization'! |
|
1497 |
||
1498 |
initialize |
|
1499 |
"set up some useful default values" |
|
1500 |
||
952 | 1501 |
paint isNil ifTrue:[paint := Black]. |
1502 |
bgPaint isNil ifTrue:[bgPaint := White]. |
|
519 | 1503 |
function := #copy. |
1504 |
lineWidth := 1. |
|
1505 |
lineStyle := #solid. |
|
1506 |
joinStyle := #miter. |
|
1507 |
capStyle := #butt. |
|
1508 |
font := DefaultFont. |
|
952 | 1509 |
|
1510 |
"Modified: 17.7.1996 / 13:00:12 / cg" |
|
519 | 1511 |
! ! |
1512 |
||
1513 |
!GraphicsContext methodsFor:'misc'! |
|
1514 |
||
1515 |
flush |
|
585 | 1516 |
"send all buffered drawing to the device." |
519 | 1517 |
|
742 | 1518 |
device flush |
585 | 1519 |
|
742 | 1520 |
"Modified: 28.5.1996 / 20:22:26 / cg" |
519 | 1521 |
! ! |
1522 |
||
1203
49dd13574c7d
dont use Black/White when drawing;
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
1523 |
!GraphicsContext class methodsFor:'documentation'! |
519 | 1524 |
|
1525 |
version |
|
1346 | 1526 |
^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.51 1997-02-13 21:55:41 ca Exp $' |
519 | 1527 |
! ! |
1528 |
GraphicsContext initialize! |