author | convert-repo |
Tue, 31 Dec 2019 04:28:27 +0000 | |
changeset 3995 | d65488cfad3c |
parent 3412 | df11bb428463 |
child 3881 | 5c40bce376ed |
permissions | -rw-r--r-- |
545 | 1 |
" |
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
2 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
545 | 3 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
5 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
7 |
SWING Research Group, Czech Technical University in Prague |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
8 |
|
545 | 9 |
This software is furnished under a license and may be used |
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
15 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
19 |
as of 1.9.2010 |
2151 | 20 |
" |
709 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
231 | 23 |
View subclass:#JavaView |
242 | 24 |
instanceVariableNames:'eventReceiver updateRegions javaPeer' |
231 | 25 |
classVariableNames:'' |
26 |
poolDictionaries:'' |
|
2108 | 27 |
category:'Languages-Java-Views-Support' |
231 | 28 |
! |
29 |
||
545 | 30 |
!JavaView class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
34 |
COPYRIGHT (c) 1996-2015 by Claus Gittinger |
545 | 35 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
36 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
37 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
38 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
39 |
SWING Research Group, Czech Technical University in Prague |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
40 |
|
545 | 41 |
This software is furnished under a license and may be used |
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
48 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
49 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
50 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
51 |
as of 1.9.2010 |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
52 |
|
545 | 53 |
" |
54 |
! ! |
|
231 | 55 |
|
56 |
!JavaView methodsFor:'accessing'! |
|
57 |
||
58 |
delegate:anObject |
|
59 |
super delegate:anObject. |
|
60 |
eventReceiver := anObject. |
|
61 |
||
62 |
"Created: 18.8.1997 / 15:22:20 / cg" |
|
63 |
! |
|
64 |
||
65 |
getNextUpdateRectangle |
|
66 |
|r| |
|
67 |
||
68 |
updateRegions size == 0 ifTrue:[^ nil]. |
|
69 |
r := updateRegions removeFirst. |
|
70 |
updateRegions size == 0 ifTrue:[updateRegions := nil]. |
|
71 |
^ r |
|
72 |
||
73 |
"Created: 18.8.1997 / 15:37:31 / cg" |
|
242 | 74 |
! |
75 |
||
76 |
javaPeer |
|
77 |
"for debugging support - here is a handle to the corresponding |
|
78 |
javaPeer" |
|
79 |
||
80 |
^ javaPeer |
|
81 |
||
82 |
"Created: 18.8.1997 / 22:34:35 / cg" |
|
83 |
! |
|
84 |
||
85 |
javaPeer:aJavaView |
|
86 |
"for debugging support - here is a handle to the corresponding |
|
87 |
javaPeer" |
|
88 |
||
89 |
javaPeer := aJavaView |
|
90 |
||
91 |
"Created: 18.8.1997 / 22:34:30 / cg" |
|
231 | 92 |
! ! |
93 |
||
94 |
!JavaView methodsFor:'event handling'! |
|
95 |
||
491 | 96 |
buttonMotion:state x:x y:y |
97 |
"/ req'd if running as embeddedApplet ... |
|
98 |
||
709 | 99 |
|ev sensor| |
491 | 100 |
|
101 |
"/ 'JavaView buttonMotion' printCR. |
|
102 |
||
709 | 103 |
sensor := self sensor. |
491 | 104 |
eventReceiver notNil ifTrue:[ |
105 |
ev := WindowEvent buttonEvent |
|
106 |
for:self |
|
107 |
type:#buttonMotion:x:y: |
|
108 |
arguments:(Array with:state with:x with:y). |
|
709 | 109 |
ev hasShift:sensor shiftDown |
110 |
ctrl:sensor ctrlDown |
|
111 |
alt:sensor altDown |
|
112 |
meta:sensor metaDown |
|
113 |
button1:sensor leftButtonPressed |
|
114 |
button2:sensor middleButtonPressed |
|
115 |
button3:sensor rightButtonPressed. |
|
491 | 116 |
eventReceiver processEvent:ev. |
117 |
]. |
|
118 |
||
119 |
"Modified: / 12.11.1998 / 16:30:50 / cg" |
|
120 |
"Created: / 10.12.1998 / 19:35:40 / cg" |
|
121 |
! |
|
122 |
||
123 |
buttonPress:button x:x y:y |
|
124 |
"/ req'd if running as embeddedApplet ... |
|
125 |
||
126 |
|ev| |
|
127 |
||
128 |
"/ 'JavaView buttonPress' printCR. |
|
129 |
||
130 |
eventReceiver notNil ifTrue:[ |
|
131 |
ev := WindowEvent buttonEvent |
|
132 |
for:self |
|
133 |
type:#buttonPress:x:y: |
|
134 |
arguments:(Array with:button with:x with:y). |
|
563 | 135 |
ev hasShift:self sensor shiftDown |
136 |
ctrl:self sensor ctrlDown |
|
137 |
alt:self sensor altDown |
|
138 |
meta:self sensor metaDown |
|
139 |
button1:self sensor leftButtonPressed |
|
140 |
button2:self sensor middleButtonPressed |
|
141 |
button3:self sensor rightButtonPressed. |
|
491 | 142 |
eventReceiver processEvent:ev. |
143 |
]. |
|
144 |
||
145 |
"Modified: / 6.2.1998 / 00:56:56 / cg" |
|
146 |
"Created: / 10.12.1998 / 19:35:58 / cg" |
|
147 |
! |
|
148 |
||
149 |
buttonRelease:button x:x y:y |
|
150 |
"/ req'd if running as embeddedApplet ... |
|
151 |
||
152 |
|ev| |
|
153 |
||
154 |
"/ 'JavaView buttonRelease' printCR. |
|
155 |
||
156 |
eventReceiver notNil ifTrue:[ |
|
157 |
ev := WindowEvent buttonEvent |
|
158 |
for:self |
|
159 |
type:#buttonRelease:x:y: |
|
160 |
arguments:(Array with:button with:x with:y). |
|
563 | 161 |
|
162 |
ev hasShift:self sensor shiftDown |
|
163 |
ctrl:self sensor ctrlDown |
|
164 |
alt:self sensor altDown |
|
165 |
meta:self sensor metaDown |
|
166 |
button1:self sensor leftButtonPressed |
|
167 |
button2:self sensor middleButtonPressed |
|
168 |
button3:self sensor rightButtonPressed. |
|
491 | 169 |
eventReceiver processEvent:ev. |
170 |
]. |
|
171 |
||
172 |
"Modified: / 6.2.1998 / 00:57:00 / cg" |
|
173 |
"Created: / 10.12.1998 / 19:36:11 / cg" |
|
174 |
! |
|
175 |
||
231 | 176 |
exposeX:x y:y width:w height:h |
391 | 177 |
|ev rect| |
178 |
||
179 |
rect := Rectangle left:x top:y width:w height:h. |
|
248 | 180 |
|
647 | 181 |
"/ ('JavaView exposeX:' , x printString , ' y:' , y printString , ' width:' , w printString , ' height:' , h printString) printCR. |
255 | 182 |
|
231 | 183 |
updateRegions isNil ifTrue:[ |
184 |
updateRegions := OrderedCollection new. |
|
185 |
]. |
|
391 | 186 |
updateRegions add:rect. |
240 | 187 |
eventReceiver notNil ifTrue:[ |
248 | 188 |
ev := WindowEvent |
189 |
damageFor:self |
|
391 | 190 |
rectangle:rect. |
248 | 191 |
eventReceiver processEvent:ev. |
240 | 192 |
]. |
391 | 193 |
"/ super exposeX:x y:y width:w height:h |
231 | 194 |
|
255 | 195 |
"Created: / 18.8.1997 / 15:00:24 / cg" |
391 | 196 |
"Modified: / 19.10.1998 / 23:10:15 / cg" |
491 | 197 |
! |
198 |
||
199 |
keyPress:key x:x y:y |
|
200 |
"/ req'd if running as embeddedApplet ... |
|
201 |
||
202 |
|ev| |
|
203 |
||
204 |
"/ 'JavaView keyPress' printCR. |
|
205 |
||
206 |
eventReceiver notNil ifTrue:[ |
|
207 |
ev := WindowEvent keyboardEvent |
|
208 |
for:self |
|
209 |
type:#keyPress:x:y: |
|
210 |
arguments:(Array with:key with:x with:y). |
|
211 |
eventReceiver processEvent:ev. |
|
212 |
]. |
|
213 |
||
214 |
"Modified: / 6.2.1998 / 00:57:08 / cg" |
|
215 |
"Created: / 10.12.1998 / 19:36:24 / cg" |
|
216 |
! |
|
217 |
||
218 |
keyRelease:key x:x y:y |
|
219 |
"/ req'd if running as embeddedApplet ... |
|
220 |
||
221 |
|ev| |
|
222 |
||
223 |
"/ 'JavaView keyRelease' printCR. |
|
224 |
||
225 |
eventReceiver notNil ifTrue:[ |
|
226 |
ev := WindowEvent keyboardEvent |
|
227 |
for:self |
|
228 |
type:#keyRelease:x:y: |
|
229 |
arguments:(Array with:key with:x with:y). |
|
230 |
eventReceiver processEvent:ev. |
|
231 |
]. |
|
232 |
||
233 |
"Modified: / 6.2.1998 / 00:57:16 / cg" |
|
234 |
"Created: / 10.12.1998 / 19:36:38 / cg" |
|
231 | 235 |
! ! |
236 |
||
245 | 237 |
!JavaView methodsFor:'initialization'! |
238 |
||
239 |
initialize |
|
240 |
super initialize. |
|
261 | 241 |
|
242 |
self enableMotionEvents. |
|
245 | 243 |
(superView notNil and:[superView isMemberOf:JavaEmbeddedFrameView]) |
244 |
ifTrue:[ |
|
245 |
self viewBackground:superView viewBackground |
|
246 |
] |
|
247 |
||
261 | 248 |
"Created: / 21.8.1997 / 16:37:45 / cg" |
249 |
"Modified: / 13.1.1998 / 14:29:30 / cg" |
|
245 | 250 |
! ! |
251 |
||
482 | 252 |
!JavaView methodsFor:'queries'! |
253 |
||
254 |
isJavaView |
|
255 |
^ true |
|
256 |
||
257 |
"Created: / 4.12.1998 / 14:09:30 / cg" |
|
258 |
! ! |
|
259 |
||
231 | 260 |
!JavaView class methodsFor:'documentation'! |
261 |
||
262 |
version |
|
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
263 |
^ '$Header: /cvs/stx/stx/libjava/JavaView.st,v 1.30 2015-03-20 12:08:00 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
264 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
265 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
266 |
version_CVS |
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
267 |
^ '$Header: /cvs/stx/stx/libjava/JavaView.st,v 1.30 2015-03-20 12:08:00 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
268 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
269 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
270 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
271 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
272 |
^ '$Changeset: <not expanded> $' |
2151 | 273 |
! |
274 |
||
275 |
version_SVN |
|
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
276 |
^ 'Id' |
2103 | 277 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
278 |