author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 26 Feb 2013 11:32:43 +0000 | |
branch | development |
changeset 2429 | ebece4dcaab9 |
parent 2380 | 9195eccdcbd9 |
parent 2396 | fadc6d7a2f5b |
child 2711 | a00302fe5083 |
permissions | -rw-r--r-- |
545 | 1 |
" |
2151 | 2 |
COPYRIGHT (c) 1996-2011 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 |
|
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 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
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 |
" |
|
2151 | 34 |
COPYRIGHT (c) 1996-2011 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 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
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 |
|
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
56 |
|
231 | 57 |
!JavaView methodsFor:'accessing'! |
58 |
||
59 |
delegate:anObject |
|
60 |
super delegate:anObject. |
|
61 |
eventReceiver := anObject. |
|
62 |
||
63 |
"Created: 18.8.1997 / 15:22:20 / cg" |
|
64 |
! |
|
65 |
||
66 |
getNextUpdateRectangle |
|
67 |
|r| |
|
68 |
||
69 |
updateRegions size == 0 ifTrue:[^ nil]. |
|
70 |
r := updateRegions removeFirst. |
|
71 |
updateRegions size == 0 ifTrue:[updateRegions := nil]. |
|
72 |
^ r |
|
73 |
||
74 |
"Created: 18.8.1997 / 15:37:31 / cg" |
|
242 | 75 |
! |
76 |
||
77 |
javaPeer |
|
78 |
"for debugging support - here is a handle to the corresponding |
|
79 |
javaPeer" |
|
80 |
||
81 |
^ javaPeer |
|
82 |
||
83 |
"Created: 18.8.1997 / 22:34:35 / cg" |
|
84 |
! |
|
85 |
||
86 |
javaPeer:aJavaView |
|
87 |
"for debugging support - here is a handle to the corresponding |
|
88 |
javaPeer" |
|
89 |
||
90 |
javaPeer := aJavaView |
|
91 |
||
92 |
"Created: 18.8.1997 / 22:34:30 / cg" |
|
231 | 93 |
! ! |
94 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
95 |
|
231 | 96 |
!JavaView methodsFor:'event handling'! |
97 |
||
491 | 98 |
buttonMotion:state x:x y:y |
99 |
"/ req'd if running as embeddedApplet ... |
|
100 |
||
709 | 101 |
|ev sensor| |
491 | 102 |
|
103 |
"/ 'JavaView buttonMotion' printCR. |
|
104 |
||
709 | 105 |
sensor := self sensor. |
491 | 106 |
eventReceiver notNil ifTrue:[ |
107 |
ev := WindowEvent buttonEvent |
|
108 |
for:self |
|
109 |
type:#buttonMotion:x:y: |
|
110 |
arguments:(Array with:state with:x with:y). |
|
709 | 111 |
ev hasShift:sensor shiftDown |
112 |
ctrl:sensor ctrlDown |
|
113 |
alt:sensor altDown |
|
114 |
meta:sensor metaDown |
|
115 |
button1:sensor leftButtonPressed |
|
116 |
button2:sensor middleButtonPressed |
|
117 |
button3:sensor rightButtonPressed. |
|
491 | 118 |
eventReceiver processEvent:ev. |
119 |
]. |
|
120 |
||
121 |
"Modified: / 12.11.1998 / 16:30:50 / cg" |
|
122 |
"Created: / 10.12.1998 / 19:35:40 / cg" |
|
123 |
! |
|
124 |
||
125 |
buttonPress:button x:x y:y |
|
126 |
"/ req'd if running as embeddedApplet ... |
|
127 |
||
128 |
|ev| |
|
129 |
||
130 |
"/ 'JavaView buttonPress' printCR. |
|
131 |
||
132 |
eventReceiver notNil ifTrue:[ |
|
133 |
ev := WindowEvent buttonEvent |
|
134 |
for:self |
|
135 |
type:#buttonPress:x:y: |
|
136 |
arguments:(Array with:button with:x with:y). |
|
563 | 137 |
ev hasShift:self sensor shiftDown |
138 |
ctrl:self sensor ctrlDown |
|
139 |
alt:self sensor altDown |
|
140 |
meta:self sensor metaDown |
|
141 |
button1:self sensor leftButtonPressed |
|
142 |
button2:self sensor middleButtonPressed |
|
143 |
button3:self sensor rightButtonPressed. |
|
491 | 144 |
eventReceiver processEvent:ev. |
145 |
]. |
|
146 |
||
147 |
"Modified: / 6.2.1998 / 00:56:56 / cg" |
|
148 |
"Created: / 10.12.1998 / 19:35:58 / cg" |
|
149 |
! |
|
150 |
||
151 |
buttonRelease:button x:x y:y |
|
152 |
"/ req'd if running as embeddedApplet ... |
|
153 |
||
154 |
|ev| |
|
155 |
||
156 |
"/ 'JavaView buttonRelease' printCR. |
|
157 |
||
158 |
eventReceiver notNil ifTrue:[ |
|
159 |
ev := WindowEvent buttonEvent |
|
160 |
for:self |
|
161 |
type:#buttonRelease:x:y: |
|
162 |
arguments:(Array with:button with:x with:y). |
|
563 | 163 |
|
164 |
ev hasShift:self sensor shiftDown |
|
165 |
ctrl:self sensor ctrlDown |
|
166 |
alt:self sensor altDown |
|
167 |
meta:self sensor metaDown |
|
168 |
button1:self sensor leftButtonPressed |
|
169 |
button2:self sensor middleButtonPressed |
|
170 |
button3:self sensor rightButtonPressed. |
|
491 | 171 |
eventReceiver processEvent:ev. |
172 |
]. |
|
173 |
||
174 |
"Modified: / 6.2.1998 / 00:57:00 / cg" |
|
175 |
"Created: / 10.12.1998 / 19:36:11 / cg" |
|
176 |
! |
|
177 |
||
231 | 178 |
exposeX:x y:y width:w height:h |
391 | 179 |
|ev rect| |
180 |
||
181 |
rect := Rectangle left:x top:y width:w height:h. |
|
248 | 182 |
|
647 | 183 |
"/ ('JavaView exposeX:' , x printString , ' y:' , y printString , ' width:' , w printString , ' height:' , h printString) printCR. |
255 | 184 |
|
231 | 185 |
updateRegions isNil ifTrue:[ |
186 |
updateRegions := OrderedCollection new. |
|
187 |
]. |
|
391 | 188 |
updateRegions add:rect. |
240 | 189 |
eventReceiver notNil ifTrue:[ |
248 | 190 |
ev := WindowEvent |
191 |
damageFor:self |
|
391 | 192 |
rectangle:rect. |
248 | 193 |
eventReceiver processEvent:ev. |
240 | 194 |
]. |
391 | 195 |
"/ super exposeX:x y:y width:w height:h |
231 | 196 |
|
255 | 197 |
"Created: / 18.8.1997 / 15:00:24 / cg" |
391 | 198 |
"Modified: / 19.10.1998 / 23:10:15 / cg" |
491 | 199 |
! |
200 |
||
201 |
keyPress:key x:x y:y |
|
202 |
"/ req'd if running as embeddedApplet ... |
|
203 |
||
204 |
|ev| |
|
205 |
||
206 |
"/ 'JavaView keyPress' printCR. |
|
207 |
||
208 |
eventReceiver notNil ifTrue:[ |
|
209 |
ev := WindowEvent keyboardEvent |
|
210 |
for:self |
|
211 |
type:#keyPress:x:y: |
|
212 |
arguments:(Array with:key with:x with:y). |
|
213 |
eventReceiver processEvent:ev. |
|
214 |
]. |
|
215 |
||
216 |
"Modified: / 6.2.1998 / 00:57:08 / cg" |
|
217 |
"Created: / 10.12.1998 / 19:36:24 / cg" |
|
218 |
! |
|
219 |
||
220 |
keyRelease:key x:x y:y |
|
221 |
"/ req'd if running as embeddedApplet ... |
|
222 |
||
223 |
|ev| |
|
224 |
||
225 |
"/ 'JavaView keyRelease' printCR. |
|
226 |
||
227 |
eventReceiver notNil ifTrue:[ |
|
228 |
ev := WindowEvent keyboardEvent |
|
229 |
for:self |
|
230 |
type:#keyRelease:x:y: |
|
231 |
arguments:(Array with:key with:x with:y). |
|
232 |
eventReceiver processEvent:ev. |
|
233 |
]. |
|
234 |
||
235 |
"Modified: / 6.2.1998 / 00:57:16 / cg" |
|
236 |
"Created: / 10.12.1998 / 19:36:38 / cg" |
|
231 | 237 |
! ! |
238 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
239 |
|
245 | 240 |
!JavaView methodsFor:'initialization'! |
241 |
||
242 |
initialize |
|
243 |
super initialize. |
|
261 | 244 |
|
245 |
self enableMotionEvents. |
|
245 | 246 |
(superView notNil and:[superView isMemberOf:JavaEmbeddedFrameView]) |
247 |
ifTrue:[ |
|
248 |
self viewBackground:superView viewBackground |
|
249 |
] |
|
250 |
||
261 | 251 |
"Created: / 21.8.1997 / 16:37:45 / cg" |
252 |
"Modified: / 13.1.1998 / 14:29:30 / cg" |
|
245 | 253 |
! ! |
254 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
255 |
|
482 | 256 |
!JavaView methodsFor:'queries'! |
257 |
||
258 |
isJavaView |
|
259 |
^ true |
|
260 |
||
261 |
"Created: / 4.12.1998 / 14:09:30 / cg" |
|
262 |
! ! |
|
263 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
264 |
|
231 | 265 |
!JavaView class methodsFor:'documentation'! |
266 |
||
267 |
version |
|
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
268 |
^ '$Header: /cvs/stx/stx/libjava/JavaView.st,v 1.27 2013-02-25 11:15:31 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
|
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 |
|
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 |
version_CVS |
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
272 |
^ '$Header: /cvs/stx/stx/libjava/JavaView.st,v 1.27 2013-02-25 11:15:31 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
|
273 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
274 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2163
diff
changeset
|
275 |
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
|
276 |
|
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 |
^ '$Changeset: <not expanded> $' |
2151 | 278 |
! |
279 |
||
280 |
version_SVN |
|
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 |
^ '§Id§' |
2103 | 282 |
! ! |
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
|
283 |