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