author | Claus Gittinger <cg@exept.de> |
Sat, 08 Dec 2001 01:36:32 +0100 | |
changeset 1537 | 364eabac0aec |
parent 1220 | 39e5e28042da |
child 1789 | f52f0a0d8448 |
permissions | -rw-r--r-- |
251 | 1 |
" |
2 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
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 |
||
14 |
||
15 |
||
16 |
||
17 |
Wrapper subclass:#GeometricWrapper |
|
404
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
18 |
instanceVariableNames:'foregroundColor backgroundColor' |
251 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
category:'Graphics-Display Objects' |
|
22 |
! |
|
23 |
||
24 |
!GeometricWrapper class methodsFor:'documentation'! |
|
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
||
39 |
||
40 |
||
41 |
||
42 |
! |
|
43 |
||
44 |
documentation |
|
45 |
" |
|
46 |
abstract class for wrappers of geometric objects. |
|
47 |
These allows any geometric thingy to be used as a component in a view. |
|
48 |
||
254 | 49 |
(background info: geometrics are mathematical objects - they do not |
50 |
keep any color or lineStyle attributes. Wrappers add this information |
|
51 |
and can also be used as components of a view) |
|
52 |
||
265 | 53 |
Notice: |
54 |
this class was implemented using protocol information |
|
365 | 55 |
from alpha testers, from reading PD programs and |
56 |
from the Hopkins/Horan book. |
|
265 | 57 |
- it may not be complete or compatible to the corresponding ST-80 class. |
58 |
If you encounter any incompatibilities, please forward a note |
|
59 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
60 |
||
251 | 61 |
[see also:] |
62 |
StrokingWrapper FillingWrapper |
|
63 |
Geometric GraphicsContext |
|
64 |
||
65 |
[author:] |
|
66 |
Claus Gittinger |
|
67 |
" |
|
68 |
||
69 |
||
70 |
||
71 |
! ! |
|
72 |
||
279 | 73 |
!GeometricWrapper methodsFor:'accessing'! |
74 |
||
404
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
75 |
backgroundColor |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
76 |
"return the value of the instance variable 'backgroundColor' (automatically generated)" |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
77 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
78 |
^ backgroundColor |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
79 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
80 |
"Created: 10.2.1997 / 14:22:14 / cg" |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
81 |
! |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
82 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
83 |
backgroundColor:something |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
84 |
"set the value of the instance variable 'backgroundColor' (automatically generated)" |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
85 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
86 |
backgroundColor := something. |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
87 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
88 |
"Created: 10.2.1997 / 14:22:14 / cg" |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
89 |
! |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
90 |
|
279 | 91 |
component:someComponent |
92 |
"set the wrappers component. |
|
93 |
Redefined to not set the components container - we know, those |
|
94 |
Geometrics dont know about containers." |
|
95 |
||
96 |
component := someComponent. |
|
97 |
||
98 |
"Created: 28.5.1996 / 23:02:36 / cg" |
|
99 |
"Modified: 28.5.1996 / 23:02:52 / cg" |
|
404
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
100 |
! |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
101 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
102 |
foregroundColor |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
103 |
"return the value of the instance variable 'foregroundColor' (automatically generated)" |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
104 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
105 |
^ foregroundColor |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
106 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
107 |
"Created: 10.2.1997 / 14:22:10 / cg" |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
108 |
! |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
109 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
110 |
foregroundColor:something |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
111 |
"set the value of the instance variable 'foregroundColor' (automatically generated)" |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
112 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
113 |
foregroundColor := something. |
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
114 |
|
502b2dc1b0ba
moved fgColor/bgColor down the hierarchy
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
115 |
"Created: 10.2.1997 / 14:22:10 / cg" |
279 | 116 |
! ! |
117 |
||
251 | 118 |
!GeometricWrapper methodsFor:'accessing - bounds'! |
119 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
120 |
bounds |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
121 |
"return the components bounds as default bounds" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
122 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
123 |
bounds notNil ifTrue:[^ bounds]. |
295 | 124 |
^ component bounds rounded |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
125 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
126 |
"Created: 5.6.1996 / 02:29:10 / cg" |
295 | 127 |
"Modified: 5.6.1996 / 20:30:50 / cg" |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
128 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
129 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
130 |
bounds:newBounds |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
131 |
"set my bounds" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
132 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
133 |
bounds := newBounds |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
134 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
135 |
"Created: 5.6.1996 / 02:30:00 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
136 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
137 |
|
251 | 138 |
preferredBounds |
139 |
"return the components bounds as preferredBounds" |
|
140 |
||
295 | 141 |
^ component bounds rounded |
251 | 142 |
|
143 |
"Created: 9.5.1996 / 10:28:10 / cg" |
|
295 | 144 |
"Modified: 5.6.1996 / 20:30:54 / cg" |
251 | 145 |
! ! |
146 |
||
418 | 147 |
!GeometricWrapper methodsFor:'initialize / release'! |
148 |
||
149 |
flushCoordinateCaches |
|
642 | 150 |
"/ geometrics are not interested in that |
418 | 151 |
|
152 |
"Created: 12.2.1997 / 11:56:07 / cg" |
|
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
153 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
154 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
155 |
initialize |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
156 |
foregroundColor := Color black. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
157 |
|
418 | 158 |
! ! |
159 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
160 |
!GeometricWrapper methodsFor:'view protocol mimicri'! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
161 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
162 |
realize |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
163 |
"my container realized itself. Ignored here" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
164 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
165 |
"Created: 5.6.1996 / 02:32:39 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
166 |
! ! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
279
diff
changeset
|
167 |
|
251 | 168 |
!GeometricWrapper class methodsFor:'documentation'! |
169 |
||
170 |
version |
|
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
171 |
^ '$Header: /cvs/stx/stx/libview2/GeometricWrapper.st,v 1.11 1999-08-18 19:50:07 cg Exp $' |
251 | 172 |
! ! |