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