author | Claus Gittinger <cg@exept.de> |
Sat, 27 Apr 2013 14:31:24 +0200 | |
changeset 2562 | c0a608f4f88c |
parent 2396 | fadc6d7a2f5b |
child 2566 | f1cea8b752ba |
child 2678 | c865275e48a7 |
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:
2259
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:
2259
diff
changeset
|
5 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
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:
2259
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:
2259
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:
2259
diff
changeset
|
15 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
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:
2259
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:
2259
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:
2259
diff
changeset
|
19 |
as of 1.9.2010 |
2151 | 20 |
" |
681 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
233 | 23 |
JavaView subclass:#JavaEmbeddedFrameView |
282 | 24 |
instanceVariableNames:'codeURL codeBaseURL documentURL archiveURL parameterDictionary |
25 |
embeddedAppletFrame applet appletID appletThread |
|
288 | 26 |
infoDisplayReceiver autoSetupApplet autoStartApplet |
2087 | 27 |
autoDestroyApplet isNS40 attributeHashTable appletIsPreloaded' |
282 | 28 |
classVariableNames:'NextSequentialAppletID' |
233 | 29 |
poolDictionaries:'' |
2108 | 30 |
category:'Languages-Java-Views-Support' |
233 | 31 |
! |
32 |
||
545 | 33 |
!JavaEmbeddedFrameView class methodsFor:'documentation'! |
34 |
||
35 |
copyright |
|
36 |
" |
|
2151 | 37 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
545 | 38 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
39 |
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:
2259
diff
changeset
|
40 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
41 |
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:
2259
diff
changeset
|
42 |
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:
2259
diff
changeset
|
43 |
|
545 | 44 |
This software is furnished under a license and may be used |
45 |
only in accordance with the terms of that license and with the |
|
46 |
inclusion of the above copyright notice. This software may not |
|
47 |
be provided or otherwise made available to, or used by, any |
|
48 |
other person. No title to or ownership of the software is |
|
49 |
hereby transferred. |
|
50 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
51 |
[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:
2259
diff
changeset
|
52 |
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:
2259
diff
changeset
|
53 |
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:
2259
diff
changeset
|
54 |
as of 1.9.2010 |
545 | 55 |
|
56 |
" |
|
57 |
! ! |
|
233 | 58 |
|
397 | 59 |
!JavaEmbeddedFrameView class methodsFor:'support'! |
60 |
||
61 |
newAppletContext |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
62 |
| jMozillaAppletContextClass | |
397 | 63 |
|
64 |
"/ this makes it a modzilla applet context ... |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
65 |
jMozillaAppletContextClass := JavaVM |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
66 |
classForName: 'netscape.applet.MozillaAppletContext'. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
67 |
jMozillaAppletContextClass isNil ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
68 |
self warn: 'no netscape.applet.MozillaAppletContext class'. |
397 | 69 |
^ nil |
70 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
71 |
jMozillaAppletContextClass instVarNamed: 'debug' put: 1. |
397 | 72 |
^ jMozillaAppletContextClass new. |
73 |
||
74 |
"Created: / 20.10.1998 / 15:40:08 / cg" |
|
75 |
"Modified: / 20.10.1998 / 15:43:47 / cg" |
|
76 |
! ! |
|
77 |
||
282 | 78 |
!JavaEmbeddedFrameView methodsFor:'accessing'! |
79 |
||
545 | 80 |
applet |
81 |
^ applet |
|
82 |
||
83 |
"Created: / 26.1.1999 / 13:51:10 / cg" |
|
84 |
! |
|
85 |
||
282 | 86 |
appletID |
87 |
"return the value of the instance variable 'appletID' (automatically generated)" |
|
88 |
||
89 |
^ appletID |
|
90 |
||
91 |
"Created: / 28.1.1998 / 21:08:54 / cg" |
|
92 |
! |
|
93 |
||
94 |
appletID:something |
|
95 |
"set the value of the instance variable 'appletID' (automatically generated)" |
|
96 |
||
97 |
appletID := something. |
|
98 |
||
99 |
"Created: / 28.1.1998 / 21:08:54 / cg" |
|
100 |
! |
|
101 |
||
2087 | 102 |
appletIsPreloaded:aBoolean |
103 |
appletIsPreloaded := aBoolean. |
|
104 |
! |
|
105 |
||
282 | 106 |
appletThread |
107 |
^ appletThread |
|
108 |
||
109 |
"Created: / 28.1.1998 / 21:39:42 / cg" |
|
110 |
! |
|
111 |
||
112 |
archiveURL:anArchiveURLString |
|
113 |
archiveURL := anArchiveURLString |
|
114 |
||
115 |
"Created: / 28.1.1998 / 21:00:38 / cg" |
|
116 |
! |
|
117 |
||
118 |
codeBaseURL:aCodeBaseURLString |
|
119 |
codeBaseURL := aCodeBaseURLString |
|
120 |
||
121 |
"Created: / 28.1.1998 / 20:59:34 / cg" |
|
122 |
! |
|
123 |
||
124 |
codeURL:aCodeURLString |
|
125 |
codeURL := aCodeURLString |
|
126 |
||
127 |
"Created: / 28.1.1998 / 21:10:11 / cg" |
|
128 |
! |
|
129 |
||
130 |
documentURL:aDocumentURLString |
|
131 |
documentURL := aDocumentURLString |
|
132 |
||
133 |
"Created: / 28.1.1998 / 21:00:03 / cg" |
|
134 |
"Modified: / 28.1.1998 / 21:00:28 / cg" |
|
135 |
! |
|
136 |
||
137 |
embeddedAppletFrame |
|
138 |
^ embeddedAppletFrame |
|
139 |
||
140 |
"Created: / 28.1.1998 / 21:39:35 / cg" |
|
141 |
! |
|
142 |
||
143 |
infoDisplayReceiver |
|
144 |
"return the value of the instance variable 'infoDisplayReceiver' (automatically generated)" |
|
145 |
||
146 |
^ infoDisplayReceiver |
|
147 |
||
148 |
"Created: / 28.1.1998 / 21:43:54 / cg" |
|
149 |
! |
|
150 |
||
151 |
infoDisplayReceiver:something |
|
152 |
"set the value of the instance variable 'infoDisplayReceiver' (automatically generated)" |
|
153 |
||
154 |
infoDisplayReceiver := something. |
|
155 |
||
156 |
"Created: / 28.1.1998 / 21:43:54 / cg" |
|
157 |
! |
|
158 |
||
545 | 159 |
parameterAt:key put:valueString |
160 |
parameterDictionary isNil ifTrue:[ |
|
161 |
parameterDictionary := IdentityDictionary new. |
|
162 |
]. |
|
163 |
parameterDictionary at:key put:valueString. |
|
164 |
attributeHashTable |
|
165 |
perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' |
|
166 |
with:(Java as_String:key) |
|
167 |
with:(Java as_String:valueString) |
|
168 |
||
169 |
"Created: / 26.1.1999 / 13:46:01 / cg" |
|
170 |
"Modified: / 28.1.1999 / 17:59:36 / cg" |
|
171 |
! |
|
172 |
||
282 | 173 |
parameterDictionary:aParameterDictionary |
174 |
parameterDictionary := aParameterDictionary |
|
175 |
||
176 |
"Created: / 28.1.1998 / 21:01:20 / cg" |
|
177 |
! ! |
|
178 |
||
179 |
!JavaEmbeddedFrameView methodsFor:'applet control'! |
|
180 |
||
181 |
appletDESTROY |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
182 |
| ev | |
384 | 183 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
184 |
isNS40 ifTrue: [ |
451 | 185 |
"/ ev = netscape.applet.AppletEvent(APPLET_DESTROY); |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
186 |
ev := (JavaVM classForName: 'netscape.applet.AppletEvent') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
187 |
newWith_int: (embeddedAppletFrame class instVarNamed: 'APPLET_DESTROY'). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
188 |
embeddedAppletFrame perform: #'sendEvent(Lnetscape/applet/NEvent;)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
189 |
with: ev. |
384 | 190 |
^ self |
191 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
192 |
embeddedAppletFrame perform: #'sendEvent(I)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
193 |
with: (embeddedAppletFrame class instVarNamed: 'APPLET_DESTROY'). |
282 | 194 |
|
195 |
"Created: / 28.1.1998 / 21:41:45 / cg" |
|
451 | 196 |
"Modified: / 13.11.1998 / 14:19:49 / cg" |
282 | 197 |
! |
198 |
||
199 |
appletDISPOSE |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
200 |
| ev | |
384 | 201 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
202 |
isNS40 ifTrue: [ |
451 | 203 |
"/ ev = netscape.applet.AppletEvent(APPLET_DISPOSE); |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
204 |
ev := (JavaVM classForName: 'netscape.applet.AppletEvent') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
205 |
newWith_int: (embeddedAppletFrame class instVarNamed: 'APPLET_DISPOSE'). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
206 |
embeddedAppletFrame perform: #'sendEvent(Lnetscape/applet/NEvent;)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
207 |
with: ev. |
384 | 208 |
^ self |
209 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
210 |
embeddedAppletFrame perform: #'sendEvent(I)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
211 |
with: (embeddedAppletFrame class instVarNamed: 'APPLET_DISPOSE'). |
282 | 212 |
|
213 |
"Created: / 28.1.1998 / 21:41:57 / cg" |
|
451 | 214 |
"Modified: / 13.11.1998 / 14:19:43 / cg" |
282 | 215 |
! |
216 |
||
217 |
appletINIT |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
218 |
| ev | |
384 | 219 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
220 |
isNS40 ifTrue: [ |
451 | 221 |
"/ ev = netscape.applet.AppletEvent(APPLET_INIT); |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
222 |
ev := (JavaVM classForName: 'netscape.applet.AppletEvent') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
223 |
newWith_int: (embeddedAppletFrame class instVarNamed: 'APPLET_INIT'). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
224 |
embeddedAppletFrame perform: #'sendEvent(Lnetscape/applet/NEvent;)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
225 |
with: ev. |
384 | 226 |
^ self |
227 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
228 |
embeddedAppletFrame perform: #'sendEvent(I)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
229 |
with: (embeddedAppletFrame class instVarNamed: 'APPLET_INIT'). |
282 | 230 |
|
231 |
"Created: / 28.1.1998 / 21:17:51 / cg" |
|
451 | 232 |
"Modified: / 13.11.1998 / 14:19:35 / cg" |
282 | 233 |
! |
234 |
||
235 |
appletLOAD |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
236 |
| ev | |
384 | 237 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
238 |
isNS40 ifTrue: [ |
451 | 239 |
"/ ev = netscape.applet.AppletEvent(APPLET_LOAD); |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
240 |
ev := (JavaVM classForName: 'netscape.applet.AppletEvent') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
241 |
newWith_int: (embeddedAppletFrame class instVarNamed: 'APPLET_LOAD'). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
242 |
embeddedAppletFrame perform: #'sendEvent(Lnetscape/applet/NEvent;)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
243 |
with: ev. |
384 | 244 |
^ self |
245 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
246 |
embeddedAppletFrame perform: #'sendEvent(I)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
247 |
with: (embeddedAppletFrame class instVarNamed: 'APPLET_LOAD'). |
282 | 248 |
|
249 |
"Created: / 28.1.1998 / 21:17:37 / cg" |
|
451 | 250 |
"Modified: / 13.11.1998 / 14:19:31 / cg" |
282 | 251 |
! |
252 |
||
253 |
appletSTART |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
254 |
| ev | |
384 | 255 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
256 |
isNS40 ifTrue: [ |
451 | 257 |
"/ ev = netscape.applet.AppletEvent(APPLET_START); |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
258 |
ev := (JavaVM classForName: 'netscape.applet.AppletEvent') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
259 |
newWith_int: (embeddedAppletFrame class instVarNamed: 'APPLET_START'). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
260 |
embeddedAppletFrame perform: #'sendEvent(Lnetscape/applet/NEvent;)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
261 |
with: ev. |
384 | 262 |
^ self |
263 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
264 |
embeddedAppletFrame perform: #'sendEvent(I)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
265 |
with: (embeddedAppletFrame class instVarNamed: 'APPLET_START'). |
282 | 266 |
|
267 |
"Created: / 28.1.1998 / 21:18:01 / cg" |
|
451 | 268 |
"Modified: / 13.11.1998 / 14:19:21 / cg" |
282 | 269 |
! |
270 |
||
271 |
appletSTOP |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
272 |
| ev | |
384 | 273 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
274 |
isNS40 ifTrue: [ |
451 | 275 |
"/ ev = netscape.applet.AppletEvent(APPLET_STOP); |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
276 |
ev := (JavaVM classForName: 'netscape.applet.AppletEvent') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
277 |
newWith_int: (embeddedAppletFrame class instVarNamed: 'APPLET_STOP'). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
278 |
embeddedAppletFrame perform: #'sendEvent(Lnetscape/applet/NEvent;)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
279 |
with: ev. |
384 | 280 |
^ self |
281 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
282 |
embeddedAppletFrame perform: #'sendEvent(I)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
283 |
with: (embeddedAppletFrame class instVarNamed: 'APPLET_STOP'). |
282 | 284 |
|
285 |
"Created: / 28.1.1998 / 21:41:33 / cg" |
|
451 | 286 |
"Modified: / 13.11.1998 / 14:19:14 / cg" |
282 | 287 |
! |
288 |
||
288 | 289 |
autoDestroyApplet:aBoolean |
290 |
"set/clear the autoDestroy flag. |
|
291 |
If set, the applet will be shutDown whenever the I get destroyed. |
|
292 |
if clear, the applet is not automatically shutDown and must be |
|
293 |
terminated by someone else. |
|
294 |
The default is false." |
|
295 |
||
296 |
autoDestroyApplet := aBoolean. |
|
297 |
||
298 |
"Created: / 29.1.1998 / 15:18:50 / cg" |
|
299 |
"Modified: / 29.1.1998 / 15:21:01 / cg" |
|
300 |
! |
|
301 |
||
302 |
autoSetupApplet:aBoolean |
|
303 |
"set/clear the autoSetup flag. |
|
304 |
If set, the appletFrame will be setup whenever the I get realized |
|
305 |
for the first time. |
|
306 |
If clear, the frame is not automatically setup and must be |
|
307 |
setup by someone else. |
|
308 |
The default is true." |
|
309 |
||
310 |
||
311 |
autoSetupApplet := aBoolean. |
|
312 |
||
313 |
"Created: / 29.1.1998 / 15:18:41 / cg" |
|
314 |
"Modified: / 29.1.1998 / 20:45:37 / cg" |
|
315 |
! |
|
316 |
||
317 |
autoStartApplet:aBoolean |
|
318 |
"set/clear the autoStart flag. |
|
319 |
If set, the applet will be loaded & started whenever the I get realized |
|
320 |
for the first time. |
|
321 |
If clear, the applet is not automatically started and must be |
|
322 |
started by someone else. |
|
323 |
The default is false." |
|
324 |
||
325 |
||
326 |
autoStartApplet := aBoolean. |
|
327 |
||
328 |
"Created: / 29.1.1998 / 15:18:41 / cg" |
|
329 |
"Modified: / 29.1.1998 / 15:20:54 / cg" |
|
330 |
! |
|
331 |
||
282 | 332 |
startApplet |
681 | 333 |
"/ ensure its initialized when the first event comes; |
334 |
"/ therefore, raise my prio above the event dispatchers prio for a while. |
|
282 | 335 |
|
681 | 336 |
Processor activeProcess withPriority:(Processor activePriority + 1) |
337 |
do:[ |
|
338 |
self startAppletThread. |
|
339 |
||
2087 | 340 |
appletIsPreloaded ifFalse:[self appletLOAD]. |
681 | 341 |
self appletINIT. |
342 |
]. |
|
343 |
||
282 | 344 |
self appletSTART |
345 |
||
346 |
"Modified: / 28.1.1998 / 21:30:24 / cg" |
|
347 |
! |
|
348 |
||
349 |
startAppletThread |
|
350 |
|appletName| |
|
351 |
||
352 |
appletThread := JavaProcess |
|
353 |
for:[ |
|
354 |
"/ passnotifications to the documentFrame ... |
|
2562 | 355 |
UserInformation handle:[:ex | |
282 | 356 |
JavaVM javaConsoleStream showCR:ex errorString. |
357 |
ex proceed. |
|
358 |
] do:[ |
|
2562 | 359 |
ActivityNotification handle:[:ex | |
282 | 360 |
infoDisplayReceiver notNil ifTrue:[ |
361 |
infoDisplayReceiver infoDisplay:ex errorString. |
|
362 |
] ifFalse:[ |
|
363 |
Transcript showCR:ex errorString |
|
364 |
]. |
|
365 |
ex proceed. |
|
366 |
] do:[ |
|
367 |
[ |
|
2116
6178a12902ca
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
2108
diff
changeset
|
368 |
"/ Transcript showCR:(Timestamp now printString , ' start embeddedAppletFrame'). |
282 | 369 |
embeddedAppletFrame perform:#'run()V'. |
2116
6178a12902ca
Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents:
2108
diff
changeset
|
370 |
] ensure:[ |
690 | 371 |
appletThread notNil ifTrue:[ |
372 |
appletThread terminateAllSubprocesses. |
|
373 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
374 |
Logger log:'JAVA applet startup finished' severity: #info facility: 'JVM' |
282 | 375 |
] |
376 |
] |
|
377 |
] |
|
378 |
] |
|
681 | 379 |
priority:(Processor activePriority "- 1"). |
282 | 380 |
|
381 |
appletName := codeURL asFilename withoutSuffix baseName. |
|
417 | 382 |
appletThread name:('JAVA-' , appletName , '-applet' , ' [startup]'). |
653
a98a3634389a
make processes restartable (for snapshot restart of java threads)
cg
parents:
644
diff
changeset
|
383 |
appletThread restartable:true. |
282 | 384 |
appletThread resume. |
385 |
^ appletThread. |
|
386 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
387 |
"Created: / 28-01-1998 / 21:30:32 / cg" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
388 |
"Modified: / 24-12-1999 / 02:58:50 / cg" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
389 |
"Modified: / 14-09-2011 / 21:40:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
286 | 390 |
! |
391 |
||
392 |
stopApplet |
|
311
b23c5e132b8c
hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents:
303
diff
changeset
|
393 |
|n n2| |
286 | 394 |
|
395 |
(appletThread notNil |
|
396 |
and:[appletThread isDead not])ifTrue:[ |
|
318 | 397 |
"/ 'EmbeddedAppletFrame [info]: send APPLET_STOP ...' infoPrintCR. |
286 | 398 |
self appletSTOP. |
399 |
||
318 | 400 |
"/ 'EmbeddedAppletFrame [info]: send APPLET_DESTROY ...' infoPrintCR. |
286 | 401 |
self appletDESTROY. |
402 |
||
318 | 403 |
"/ 'EmbeddedAppletFrame [info]: send APPLET_DISPOSE ...' infoPrintCR. |
286 | 404 |
self appletDISPOSE. |
405 |
||
406 |
"/ |
|
407 |
"/ give it a chance to stop ... |
|
408 |
"/ |
|
409 |
Processor yield. |
|
311
b23c5e132b8c
hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents:
303
diff
changeset
|
410 |
n2 := 0. |
286 | 411 |
[appletThread isDead] whileFalse:[ |
455 | 412 |
"/ give it a second to shut down ... |
286 | 413 |
n := 0. |
414 |
[n < 10 and:[appletThread isDead not]] whileTrue:[ |
|
415 |
Delay waitForSeconds:0.1. |
|
416 |
n := n + 1. |
|
417 |
]. |
|
418 |
appletThread isDead ifFalse:[ |
|
455 | 419 |
"/ after 3 seconds, kill it. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
420 |
Logger log:'EmbeddedAppletFrame: JAVA thread did not stop - soft terminate ...' severity: #info facility: 'JVM'. |
527 | 421 |
appletThread == JavaVM javaScreenUpdaterThread ifTrue:[self halt]. |
653
a98a3634389a
make processes restartable (for snapshot restart of java threads)
cg
parents:
644
diff
changeset
|
422 |
appletThread == JavaVM javaEventQueueThread ifTrue:[self halt]. |
286 | 423 |
appletThread terminate. |
311
b23c5e132b8c
hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents:
303
diff
changeset
|
424 |
n2 := n2 + 1. |
455 | 425 |
n2 > 3 ifTrue:[ |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
426 |
Logger log:'EmbeddedAppletFrame: JAVA thread did not stop - shooting down ...' severity: #info facility: 'JVM'. |
311
b23c5e132b8c
hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents:
303
diff
changeset
|
427 |
appletThread terminateNoSignal |
b23c5e132b8c
hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents:
303
diff
changeset
|
428 |
] |
286 | 429 |
]. |
430 |
]. |
|
431 |
]. |
|
432 |
appletThread := nil |
|
433 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
434 |
"Modified: / 24-12-1999 / 02:35:25 / cg" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
435 |
"Modified: / 14-09-2011 / 21:42:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
286 | 436 |
! ! |
437 |
||
438 |
!JavaEmbeddedFrameView methodsFor:'initialize / release'! |
|
439 |
||
440 |
destroy |
|
441 |
autoDestroyApplet == true ifTrue:[ |
|
442 |
self stopApplet |
|
443 |
]. |
|
444 |
super destroy. |
|
445 |
||
446 |
"Created: / 29.1.1998 / 15:21:45 / cg" |
|
447 |
"Modified: / 29.1.1998 / 15:28:26 / cg" |
|
448 |
! |
|
449 |
||
545 | 450 |
initialize |
2087 | 451 |
appletIsPreloaded := false. |
545 | 452 |
super initialize. |
453 |
viewBackground := Color black. |
|
454 |
||
455 |
"Modified: / 28.1.1999 / 17:44:11 / cg" |
|
456 |
! |
|
457 |
||
286 | 458 |
realize |
288 | 459 |
autoSetupApplet ~~ false ifTrue:[ |
397 | 460 |
self setupAppletFrameIn:nil initializeJava:true |
288 | 461 |
]. |
286 | 462 |
autoStartApplet == true ifTrue:[ |
288 | 463 |
embeddedAppletFrame notNil ifTrue:[ |
464 |
self startApplet |
|
465 |
] |
|
681 | 466 |
]. |
467 |
super realize. |
|
286 | 468 |
|
469 |
"Created: / 29.1.1998 / 15:21:30 / cg" |
|
397 | 470 |
"Modified: / 20.10.1998 / 15:46:32 / cg" |
282 | 471 |
! ! |
472 |
||
473 |
!JavaEmbeddedFrameView methodsFor:'private'! |
|
474 |
||
397 | 475 |
setupAppletFrameIn:anAppletContextOrNil |
644 | 476 |
^ self setupAppletFrameIn:anAppletContextOrNil initializeJava:true. |
477 |
! |
|
478 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
479 |
setupAppletFrameIn: anAppletContextOrNil initializeJava: initializeJava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
480 |
| appletContext jEmbeddedAppletFrameClass jDerivedAppletFrameClass toolkit peer attribs id jCodeBaseURL jDocumentURL jArchiveURL u fn | |
282 | 481 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
482 |
embeddedAppletFrame notNil ifTrue: [ |
288 | 483 |
"/ already setup |
484 |
^ self |
|
485 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
486 |
codeBaseURL isNil ifTrue: [ ^ self ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
487 |
initializeJava ifTrue: [ Java startupJavaSystem. ] ifFalse: [ |
653
a98a3634389a
make processes restartable (for snapshot restart of java threads)
cg
parents:
644
diff
changeset
|
488 |
JavaVM initializeVMIfNoEventThreadRunning |
644 | 489 |
]. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
490 |
|
644 | 491 |
"/ if its a relative file-URL, make it relative under |
492 |
"/ java... |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
493 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
494 |
u := URL fromString: codeBaseURL. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
495 |
u method = 'file' ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
496 |
fn := Smalltalk getSystemFileName: u file. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
497 |
fn isNil ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
498 |
fn := Smalltalk getPackageFileName: ('stx/libjava/' , u file). |
644 | 499 |
] |
500 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
501 |
fn notNil ifTrue: [ fn := 'file:' , fn asFilename pathName ] ifFalse: [ |
644 | 502 |
fn := codeBaseURL |
503 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
504 |
jCodeBaseURL := Java as_URL: fn. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
505 |
documentURL notNil ifTrue: [ jDocumentURL := Java as_URL: documentURL. ] ifFalse: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
506 |
jDocumentURL := Java as_URL: fn |
288 | 507 |
]. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
508 |
archiveURL notNil ifTrue: [ jArchiveURL := Java as_URL: archiveURL. ]. |
282 | 509 |
id := appletID. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
510 |
id isNil ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
511 |
NextSequentialAppletID isNil ifTrue: [ NextSequentialAppletID := 1. ]. |
282 | 512 |
id := NextSequentialAppletID. |
513 |
NextSequentialAppletID := NextSequentialAppletID + 1 |
|
514 |
]. |
|
515 |
attribs := Dictionary new. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
516 |
width notNil ifTrue: [ attribs at: 'width' put: width printString ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
517 |
height notNil ifTrue: [ attribs at: 'height' put: height printString ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
518 |
codeURL notNil ifTrue: [ attribs at: 'code' put: codeURL ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
519 |
parameterDictionary notNil ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
520 |
attribs declareAllFrom: parameterDictionary |
384 | 521 |
]. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
522 |
attributeHashTable := Java as_Hashtable: attribs. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
523 |
anAppletContextOrNil notNil ifTrue: [ appletContext := anAppletContextOrNil ] ifFalse: [ |
420 | 524 |
appletContext := self class newAppletContext. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
525 |
appletContext isNil ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
526 |
self warn: 'no netscape.applet.MozillaAppletContext class'. |
397 | 527 |
^ false |
528 |
]. |
|
529 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
530 |
jEmbeddedAppletFrameClass := JavaVM |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
531 |
classForName: 'netscape.applet.EmbeddedAppletFrame'. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
532 |
jEmbeddedAppletFrameClass isNil ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
533 |
self warn: 'no netscape.applet.EmbeddedAppletFrame class'. |
397 | 534 |
^ false |
535 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
536 |
jDerivedAppletFrameClass := Java |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
537 |
classForName: 'netscape.applet.DerivedAppletFrame'. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
538 |
jDerivedAppletFrameClass notNil ifTrue: [ |
397 | 539 |
"/ ns4.0 |
540 |
embeddedAppletFrame := jDerivedAppletFrameClass new. |
|
541 |
isNS40 := true. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
542 |
] ifFalse: [ |
397 | 543 |
"/ ns3.x |
544 |
embeddedAppletFrame := jEmbeddedAppletFrameClass new. |
|
545 |
isNS40 := false. |
|
546 |
]. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
547 |
embeddedAppletFrame instVarNamed: 'pData' put: self. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
548 |
toolkit := (Java classForName: 'java.awt.Toolkit') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
549 |
perform: #getDefaultToolkit. |
397 | 550 |
peer := toolkit |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
551 |
perform: #'createFrame(Ljava/awt/Frame;)Ljava/awt/peer/FramePeer;' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
552 |
with: embeddedAppletFrame. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
553 |
(embeddedAppletFrame |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
554 |
respondsTo: #'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;Z)V') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
555 |
ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
556 |
"/ 4.0 netscape |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
557 |
embeddedAppletFrame |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
558 |
perform: #'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;Z)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
559 |
withArguments: (Array |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
560 |
with: jDocumentURL |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
561 |
with: jCodeBaseURL |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
562 |
with: jArchiveURL |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
563 |
with: attributeHashTable |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
564 |
with: appletContext |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
565 |
with: (Java as_Integer: id) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
566 |
with: 0). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
567 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
568 |
"/ reloadClasses-boolean |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
569 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
570 |
ifFalse: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
571 |
(embeddedAppletFrame |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
572 |
respondsTo: #'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;)V') |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
573 |
ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
574 |
"/ 3.01 netscape |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
575 |
embeddedAppletFrame |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
576 |
perform: #'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
577 |
with: jDocumentURL |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
578 |
with: jCodeBaseURL |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
579 |
with: jArchiveURL |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
580 |
with: attributeHashTable |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
581 |
with: appletContext |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
582 |
with: (Java as_Integer: id). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
583 |
] |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
584 |
ifFalse: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
585 |
"/ oldStyle netscape |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
586 |
embeddedAppletFrame |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
587 |
perform: #'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;I)V' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
588 |
with: jDocumentURL |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
589 |
with: jCodeBaseURL |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
590 |
with: attributeHashTable |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
591 |
with: appletContext |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
592 |
with: id. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
593 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
594 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
595 |
embeddedAppletFrame instVarNamed: 'peer' put: peer. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
596 |
self javaPeer: peer. |
282 | 597 |
^ true |
598 |
||
397 | 599 |
"Created: / 20.10.1998 / 15:47:04 / cg" |
653
a98a3634389a
make processes restartable (for snapshot restart of java threads)
cg
parents:
644
diff
changeset
|
600 |
"Modified: / 24.12.1999 / 01:38:17 / cg" |
282 | 601 |
! ! |
602 |
||
303 | 603 |
!JavaEmbeddedFrameView methodsFor:'resizing'! |
604 |
||
605 |
sizeChanged:how |
|
606 |
super sizeChanged:how. |
|
607 |
^ self. |
|
608 |
embeddedAppletFrame notNil ifTrue:[ |
|
609 |
(embeddedAppletFrame perform:#'isResizable()Z') ~~ 0 ifTrue:[ |
|
610 |
self windowGroup sensor |
|
611 |
pushDamageEvent:(WindowEvent |
|
612 |
for:self |
|
613 |
type:#configureX:y:width:height: |
|
614 |
arguments:(Array with:left with:top with:width with:height)). |
|
615 |
"/ embeddedAppletFrame |
|
616 |
"/ perform:#'appletResize(II)V' |
|
617 |
"/ with:self width |
|
618 |
"/ with:self height. |
|
619 |
] |
|
620 |
] |
|
621 |
||
622 |
"Modified: / 1.2.1998 / 19:15:07 / cg" |
|
623 |
! ! |
|
624 |
||
233 | 625 |
!JavaEmbeddedFrameView class methodsFor:'documentation'! |
626 |
||
627 |
version |
|
2562 | 628 |
^ '$Header: /cvs/stx/stx/libjava/JavaEmbeddedFrameView.st,v 1.31 2013-04-27 12:31:24 cg Exp $' |
2259
25d241dbe673
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
629 |
! |
25d241dbe673
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
630 |
|
25d241dbe673
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
631 |
version_CVS |
2562 | 632 |
^ '$Header: /cvs/stx/stx/libjava/JavaEmbeddedFrameView.st,v 1.31 2013-04-27 12:31:24 cg Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
633 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
634 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
635 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
636 |
|
2562 | 637 |
^ '§Changeset: <not expanded> §' |
2151 | 638 |
! |
639 |
||
640 |
version_SVN |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
641 |
^ '§Id§' |
2084 | 642 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2259
diff
changeset
|
643 |