752
|
1 |
"
|
877
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
3 |
|
1155
|
4 |
New code and modifications done at SWING Research Group [1]:
|
1152
|
5 |
|
877
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
7 |
SWING Research Group, Czech Technical University in Prague
|
|
8 |
|
752
|
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.
|
877
|
15 |
|
1155
|
16 |
[1] Code written at SWING Research Group contains a signature
|
|
17 |
of one of the above copright owners. For exact set of such code,
|
|
18 |
see the differences between this version and version stx:libjava
|
1152
|
19 |
as of 1.9.2010
|
752
|
20 |
"
|
|
21 |
"{ Package: 'stx:libjava' }"
|
|
22 |
|
|
23 |
View subclass:#JavaView
|
|
24 |
instanceVariableNames:'eventReceiver updateRegions javaPeer'
|
|
25 |
classVariableNames:''
|
|
26 |
poolDictionaries:''
|
|
27 |
category:'Languages-Java-Views-Support'
|
|
28 |
!
|
|
29 |
|
|
30 |
!JavaView class methodsFor:'documentation'!
|
|
31 |
|
|
32 |
copyright
|
|
33 |
"
|
877
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
35 |
|
1155
|
36 |
New code and modifications done at SWING Research Group [1]:
|
1152
|
37 |
|
877
|
38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
39 |
SWING Research Group, Czech Technical University in Prague
|
|
40 |
|
752
|
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.
|
877
|
47 |
|
1155
|
48 |
[1] Code written at SWING Research Group contains a signature
|
|
49 |
of one of the above copright owners. For exact set of such code,
|
|
50 |
see the differences between this version and version stx:libjava
|
1152
|
51 |
as of 1.9.2010
|
877
|
52 |
|
|
53 |
"
|
752
|
54 |
! !
|
|
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"
|
|
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"
|
|
92 |
! !
|
|
93 |
|
|
94 |
!JavaView methodsFor:'event handling'!
|
|
95 |
|
|
96 |
buttonMotion:state x:x y:y
|
|
97 |
"/ req'd if running as embeddedApplet ...
|
|
98 |
|
|
99 |
|ev sensor|
|
|
100 |
|
|
101 |
"/ 'JavaView buttonMotion' printCR.
|
|
102 |
|
|
103 |
sensor := self sensor.
|
|
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).
|
|
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.
|
|
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).
|
|
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.
|
|
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).
|
|
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.
|
|
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 |
|
|
176 |
exposeX:x y:y width:w height:h
|
|
177 |
|ev rect|
|
|
178 |
|
|
179 |
rect := Rectangle left:x top:y width:w height:h.
|
|
180 |
|
|
181 |
"/ ('JavaView exposeX:' , x printString , ' y:' , y printString , ' width:' , w printString , ' height:' , h printString) printCR.
|
|
182 |
|
|
183 |
updateRegions isNil ifTrue:[
|
|
184 |
updateRegions := OrderedCollection new.
|
|
185 |
].
|
|
186 |
updateRegions add:rect.
|
|
187 |
eventReceiver notNil ifTrue:[
|
|
188 |
ev := WindowEvent
|
|
189 |
damageFor:self
|
|
190 |
rectangle:rect.
|
|
191 |
eventReceiver processEvent:ev.
|
|
192 |
].
|
|
193 |
"/ super exposeX:x y:y width:w height:h
|
|
194 |
|
|
195 |
"Created: / 18.8.1997 / 15:00:24 / cg"
|
|
196 |
"Modified: / 19.10.1998 / 23:10:15 / cg"
|
|
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"
|
|
235 |
! !
|
|
236 |
|
|
237 |
!JavaView methodsFor:'initialization'!
|
|
238 |
|
|
239 |
initialize
|
|
240 |
super initialize.
|
|
241 |
|
|
242 |
self enableMotionEvents.
|
|
243 |
(superView notNil and:[superView isMemberOf:JavaEmbeddedFrameView])
|
|
244 |
ifTrue:[
|
|
245 |
self viewBackground:superView viewBackground
|
|
246 |
]
|
|
247 |
|
|
248 |
"Created: / 21.8.1997 / 16:37:45 / cg"
|
|
249 |
"Modified: / 13.1.1998 / 14:29:30 / cg"
|
|
250 |
! !
|
|
251 |
|
|
252 |
!JavaView methodsFor:'queries'!
|
|
253 |
|
|
254 |
isJavaView
|
|
255 |
^ true
|
|
256 |
|
|
257 |
"Created: / 4.12.1998 / 14:09:30 / cg"
|
|
258 |
! !
|
|
259 |
|
|
260 |
!JavaView class methodsFor:'documentation'!
|
|
261 |
|
|
262 |
version
|
1022
|
263 |
^ '$Id$'
|
752
|
264 |
!
|
|
265 |
|
|
266 |
version_SVN
|
1022
|
267 |
^ '$Id$'
|
1152
|
268 |
! !
|