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