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