JavaEmbeddedFrameView.st
author Claus Gittinger <cg@exept.de>
Fri, 19 Aug 2011 15:11:30 +0200
changeset 2157 a0c2ac13f6c6
parent 2151 c0b6570c6f9b
child 2162 415c8bb27655
permissions -rw-r--r--
#_sun_reflect_NativeMethodAccessorImpl_invoke0: fix for static methods
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
     1
"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
     5
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
     7
 license:
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
     8
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
     9
 This software is furnished under a license and may be used
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    10
 only in accordance with the terms of that license and with the
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    12
 be provided or otherwise made available to, or used by, any
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    13
 other person.  No title to or ownership of the software is
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    14
 hereby transferred.
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    15
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    17
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    19
 obtaining a copy of this software and associated documentation
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    20
 files (the 'Software'), to deal in the Software without
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    21
 restriction, including without limitation the rights to use,
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    23
 copies of the Software, and to permit persons to whom the
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    24
 Software is furnished to do so, subject to the following
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    25
 conditions:
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    26
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    27
 The above copyright notice and this permission notice shall be
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    28
 included in all copies or substantial portions of the Software.
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    29
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    38
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    40
     of one of the above copright owners.
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    41
"
681
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
    42
"{ Package: 'stx:libjava' }"
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
    43
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
    44
JavaView subclass:#JavaEmbeddedFrameView
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    45
	instanceVariableNames:'codeURL codeBaseURL documentURL archiveURL parameterDictionary
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    46
		embeddedAppletFrame applet appletID appletThread
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
    47
		infoDisplayReceiver autoSetupApplet autoStartApplet
2087
2e1a2d10b891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
    48
		autoDestroyApplet isNS40 attributeHashTable appletIsPreloaded'
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    49
	classVariableNames:'NextSequentialAppletID'
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
    50
	poolDictionaries:''
2108
ca8c4e7db2e8 category change
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
    51
	category:'Languages-Java-Views-Support'
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
    52
!
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
    53
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    54
!JavaEmbeddedFrameView class methodsFor:'documentation'!
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    55
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    56
copyright
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    57
"
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    58
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    59
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    60
                            SWING Research Group, Czech Technical University in Prague
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    61
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    62
 Parts of the code written by Claus Gittinger are under following
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    63
 license:
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    64
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    65
 This software is furnished under a license and may be used
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    66
 only in accordance with the terms of that license and with the
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    67
 inclusion of the above copyright notice.   This software may not
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    68
 be provided or otherwise made available to, or used by, any
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    69
 other person.  No title to or ownership of the software is
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    70
 hereby transferred.
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    71
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    72
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    73
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    74
 Permission is hereby granted, free of charge, to any person
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    75
 obtaining a copy of this software and associated documentation
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    76
 files (the 'Software'), to deal in the Software without
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    77
 restriction, including without limitation the rights to use,
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    78
 copy, modify, merge, publish, distribute, sublicense, and/or sell
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    79
 copies of the Software, and to permit persons to whom the
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    80
 Software is furnished to do so, subject to the following
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    81
 conditions:
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    82
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    83
 The above copyright notice and this permission notice shall be
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    84
 included in all copies or substantial portions of the Software.
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    85
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    86
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    87
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    88
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    89
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    90
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    91
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    92
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    93
 OTHER DEALINGS IN THE SOFTWARE.
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    94
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    95
 [1] Code written at SWING Research Group contain a signature
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    96
     of one of the above copright owners.
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
    97
2084
69ecd5609bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
    98
"
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
    99
!
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   100
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   101
documentation
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   102
"
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   103
    a wrapper view, which allows for Java Applets to be embedded
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   104
    in a smalltalk view.
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   105
    This requires a netscape to be installed on the system.
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   106
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   107
    [Author:]
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   108
        Claus Gittinger
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   109
"
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   110
! !
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   111
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   112
!JavaEmbeddedFrameView class methodsFor:'support'!
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   113
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   114
newAppletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   115
    |jMozillaAppletContextClass|
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   116
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   117
    "/ this makes it a modzilla applet context ...
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   118
    jMozillaAppletContextClass := Java classForName:'netscape.applet.MozillaAppletContext'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   119
    jMozillaAppletContextClass isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   120
        self warn:'no netscape.applet.MozillaAppletContext class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   121
        ^ nil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   122
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   123
    jMozillaAppletContextClass instVarNamed:'debug' put:1.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   124
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   125
    ^ jMozillaAppletContextClass new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   126
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   127
    "Created: / 20.10.1998 / 15:40:08 / cg"
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   128
    "Modified: / 20.10.1998 / 15:43:47 / cg"
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   129
! !
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   130
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   131
!JavaEmbeddedFrameView methodsFor:'accessing'!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   132
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   133
applet
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   134
    ^ applet
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   135
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   136
    "Created: / 26.1.1999 / 13:51:10 / cg"
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   137
!
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   138
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   139
appletID
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   140
    "return the value of the instance variable 'appletID' (automatically generated)"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   141
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   142
    ^ appletID
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   143
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   144
    "Created: / 28.1.1998 / 21:08:54 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   145
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   146
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   147
appletID:something
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   148
    "set the value of the instance variable 'appletID' (automatically generated)"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   149
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   150
    appletID := something.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   151
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   152
    "Created: / 28.1.1998 / 21:08:54 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   153
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   154
2087
2e1a2d10b891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   155
appletIsPreloaded:aBoolean
2e1a2d10b891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   156
    appletIsPreloaded := aBoolean.
2e1a2d10b891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   157
!
2e1a2d10b891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   158
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   159
appletThread
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   160
    ^ appletThread
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   161
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   162
    "Created: / 28.1.1998 / 21:39:42 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   163
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   164
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   165
archiveURL:anArchiveURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   166
    archiveURL := anArchiveURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   167
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   168
    "Created: / 28.1.1998 / 21:00:38 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   169
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   170
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   171
codeBaseURL:aCodeBaseURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   172
    codeBaseURL := aCodeBaseURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   173
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   174
    "Created: / 28.1.1998 / 20:59:34 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   175
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   176
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   177
codeURL:aCodeURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   178
    codeURL := aCodeURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   179
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   180
    "Created: / 28.1.1998 / 21:10:11 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   181
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   182
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   183
documentURL:aDocumentURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   184
    documentURL := aDocumentURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   185
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   186
    "Created: / 28.1.1998 / 21:00:03 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   187
    "Modified: / 28.1.1998 / 21:00:28 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   188
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   189
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   190
embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   191
    ^ embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   192
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   193
    "Created: / 28.1.1998 / 21:39:35 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   194
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   195
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   196
infoDisplayReceiver
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   197
    "return the value of the instance variable 'infoDisplayReceiver' (automatically generated)"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   198
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   199
    ^ infoDisplayReceiver
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   200
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   201
    "Created: / 28.1.1998 / 21:43:54 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   202
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   203
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   204
infoDisplayReceiver:something
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   205
    "set the value of the instance variable 'infoDisplayReceiver' (automatically generated)"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   206
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   207
    infoDisplayReceiver := something.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   208
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   209
    "Created: / 28.1.1998 / 21:43:54 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   210
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   211
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   212
parameterAt:key put:valueString
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   213
    parameterDictionary isNil ifTrue:[
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   214
        parameterDictionary := IdentityDictionary new.
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   215
    ].
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   216
    parameterDictionary at:key put:valueString.
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   217
    attributeHashTable 
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   218
        perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;'
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   219
        with:(Java as_String:key)
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   220
        with:(Java as_String:valueString)
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   221
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   222
    "Created: / 26.1.1999 / 13:46:01 / cg"
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   223
    "Modified: / 28.1.1999 / 17:59:36 / cg"
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   224
!
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   225
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   226
parameterDictionary:aParameterDictionary
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   227
    parameterDictionary := aParameterDictionary
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   228
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   229
    "Created: / 28.1.1998 / 21:01:20 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   230
! !
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   231
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   232
!JavaEmbeddedFrameView methodsFor:'applet control'!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   233
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   234
appletDESTROY
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   235
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   236
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   237
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   238
        "/ ev = netscape.applet.AppletEvent(APPLET_DESTROY);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   239
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   240
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_DESTROY').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   241
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   242
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   243
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   244
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   245
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   246
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   247
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   248
        with:(embeddedAppletFrame class instVarNamed:'APPLET_DESTROY').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   249
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   250
    "Created: / 28.1.1998 / 21:41:45 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   251
    "Modified: / 13.11.1998 / 14:19:49 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   252
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   253
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   254
appletDISPOSE
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   255
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   256
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   257
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   258
        "/ ev = netscape.applet.AppletEvent(APPLET_DISPOSE);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   259
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   260
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_DISPOSE').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   261
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   262
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   263
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   264
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   265
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   266
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   267
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   268
        with:(embeddedAppletFrame class instVarNamed:'APPLET_DISPOSE').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   269
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   270
    "Created: / 28.1.1998 / 21:41:57 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   271
    "Modified: / 13.11.1998 / 14:19:43 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   272
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   273
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   274
appletINIT
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   275
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   276
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   277
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   278
        "/ ev = netscape.applet.AppletEvent(APPLET_INIT);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   279
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   280
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_INIT').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   281
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   282
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   283
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   284
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   285
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   286
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   287
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   288
        with:(embeddedAppletFrame class instVarNamed:'APPLET_INIT').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   289
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   290
    "Created: / 28.1.1998 / 21:17:51 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   291
    "Modified: / 13.11.1998 / 14:19:35 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   292
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   293
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   294
appletLOAD
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   295
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   296
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   297
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   298
        "/ ev = netscape.applet.AppletEvent(APPLET_LOAD);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   299
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   300
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_LOAD').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   301
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   302
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   303
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   304
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   305
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   306
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   307
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   308
        with:(embeddedAppletFrame class instVarNamed:'APPLET_LOAD').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   309
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   310
    "Created: / 28.1.1998 / 21:17:37 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   311
    "Modified: / 13.11.1998 / 14:19:31 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   312
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   313
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   314
appletSTART
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   315
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   316
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   317
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   318
        "/ ev = netscape.applet.AppletEvent(APPLET_START);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   319
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   320
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_START').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   321
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   322
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   323
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   324
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   325
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   326
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   327
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   328
        with:(embeddedAppletFrame class instVarNamed:'APPLET_START').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   329
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   330
    "Created: / 28.1.1998 / 21:18:01 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   331
    "Modified: / 13.11.1998 / 14:19:21 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   332
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   333
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   334
appletSTOP
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   335
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   336
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   337
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   338
        "/ ev = netscape.applet.AppletEvent(APPLET_STOP);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   339
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   340
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_STOP').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   341
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   342
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   343
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   344
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   345
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   346
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   347
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   348
        with:(embeddedAppletFrame class instVarNamed:'APPLET_STOP').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   349
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   350
    "Created: / 28.1.1998 / 21:41:33 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   351
    "Modified: / 13.11.1998 / 14:19:14 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   352
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   353
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   354
autoDestroyApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   355
    "set/clear the autoDestroy flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   356
     If set, the applet will be shutDown whenever the I get destroyed.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   357
     if clear, the applet is not automatically shutDown and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   358
     terminated by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   359
     The default is false."
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   360
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   361
    autoDestroyApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   362
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   363
    "Created: / 29.1.1998 / 15:18:50 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   364
    "Modified: / 29.1.1998 / 15:21:01 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   365
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   366
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   367
autoSetupApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   368
    "set/clear the autoSetup flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   369
     If set, the appletFrame will be setup whenever the I get realized
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   370
     for the first time.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   371
     If clear, the frame is not automatically setup and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   372
     setup by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   373
     The default is true."
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   374
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   375
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   376
    autoSetupApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   377
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   378
    "Created: / 29.1.1998 / 15:18:41 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   379
    "Modified: / 29.1.1998 / 20:45:37 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   380
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   381
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   382
autoStartApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   383
    "set/clear the autoStart flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   384
     If set, the applet will be loaded & started whenever the I get realized
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   385
     for the first time.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   386
     If clear, the applet is not automatically started and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   387
     started by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   388
     The default is false."
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   389
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   390
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   391
    autoStartApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   392
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   393
    "Created: / 29.1.1998 / 15:18:41 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   394
    "Modified: / 29.1.1998 / 15:20:54 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   395
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   396
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   397
startApplet
681
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   398
    "/ ensure its initialized when the first event comes;
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   399
    "/ therefore, raise my prio above the event dispatchers prio for a while.
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   400
681
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   401
    Processor activeProcess withPriority:(Processor activePriority + 1)
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   402
    do:[
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   403
        self startAppletThread.
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   404
2087
2e1a2d10b891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   405
        appletIsPreloaded ifFalse:[self appletLOAD].
681
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   406
        self appletINIT.
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   407
    ].
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   408
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   409
    self appletSTART
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   410
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   411
    "Modified: / 28.1.1998 / 21:30:24 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   412
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   413
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   414
startAppletThread
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   415
    |appletName|
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   416
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   417
    appletThread := JavaProcess 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   418
            for:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   419
                    "/ passnotifications to the documentFrame ...
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   420
                    Object informationSignal handle:[:ex |
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   421
                        JavaVM javaConsoleStream showCR:ex errorString.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   422
                        ex proceed.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   423
                    ] do:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   424
                        Object activityNotificationSignal handle:[:ex |
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   425
                            infoDisplayReceiver notNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   426
                                infoDisplayReceiver infoDisplay:ex errorString.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   427
                            ] ifFalse:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   428
                                Transcript showCR:ex errorString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   429
                            ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   430
                            ex proceed.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   431
                        ] do:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   432
                            [
2116
6178a12902ca Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 2108
diff changeset
   433
                                "/ Transcript showCR:(Timestamp now printString , ' start embeddedAppletFrame').
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   434
                                embeddedAppletFrame perform:#'run()V'.
2116
6178a12902ca Rename AbsoluteTime to Timestamp
Stefan Vogel <sv@exept.de>
parents: 2108
diff changeset
   435
                            ] ensure:[
690
c9faa0d724d6 *** empty log message ***
cg
parents: 683
diff changeset
   436
                                appletThread notNil ifTrue:[
c9faa0d724d6 *** empty log message ***
cg
parents: 683
diff changeset
   437
                                    appletThread terminateAllSubprocesses.
c9faa0d724d6 *** empty log message ***
cg
parents: 683
diff changeset
   438
                                ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   439
                                Transcript showCR:'JAVA applet startup finished'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   440
                            ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   441
                        ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   442
                    ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   443
                ]
681
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   444
            priority:(Processor activePriority "- 1").
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   445
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   446
    appletName := codeURL asFilename withoutSuffix baseName.
417
d60d5b5da5f9 applet thread name changed.
cg
parents: 397
diff changeset
   447
    appletThread name:('JAVA-' , appletName , '-applet' , ' [startup]').
653
a98a3634389a make processes restartable (for snapshot restart of java threads)
cg
parents: 644
diff changeset
   448
    appletThread restartable:true.
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   449
    appletThread resume.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   450
    ^ appletThread.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   451
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   452
    "Created: / 28.1.1998 / 21:30:32 / cg"
653
a98a3634389a make processes restartable (for snapshot restart of java threads)
cg
parents: 644
diff changeset
   453
    "Modified: / 24.12.1999 / 02:58:50 / cg"
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   454
!
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   455
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   456
stopApplet
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   457
    |n n2|
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   458
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   459
    (appletThread notNil 
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   460
    and:[appletThread isDead not])ifTrue:[
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   461
"/        'EmbeddedAppletFrame [info]: send APPLET_STOP ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   462
        self appletSTOP.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   463
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   464
"/        'EmbeddedAppletFrame [info]: send APPLET_DESTROY ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   465
        self appletDESTROY.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   466
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   467
"/        'EmbeddedAppletFrame [info]: send APPLET_DISPOSE ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   468
        self appletDISPOSE.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   469
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   470
        "/
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   471
        "/ give it a chance to stop ...
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   472
        "/
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   473
        Processor yield.
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   474
        n2 := 0.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   475
        [appletThread isDead] whileFalse:[
455
36fffdce84f7 checkin from browser
cg
parents: 451
diff changeset
   476
            "/ give it a second to shut down ...
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   477
            n := 0.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   478
            [n < 10 and:[appletThread isDead not]] whileTrue:[
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   479
                Delay waitForSeconds:0.1.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   480
                n := n + 1.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   481
            ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   482
            appletThread isDead ifFalse:[
455
36fffdce84f7 checkin from browser
cg
parents: 451
diff changeset
   483
                "/ after 3 seconds, kill it.
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   484
                Transcript showCR:'EmbeddedAppletFrame [info]: JAVA thread did not stop - soft terminate ...'.
527
7eb6f6291fea *** empty log message ***
cg
parents: 455
diff changeset
   485
appletThread == JavaVM javaScreenUpdaterThread ifTrue:[self halt].
653
a98a3634389a make processes restartable (for snapshot restart of java threads)
cg
parents: 644
diff changeset
   486
appletThread == JavaVM javaEventQueueThread ifTrue:[self halt].
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   487
                appletThread terminate.
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   488
                n2 := n2 + 1.
455
36fffdce84f7 checkin from browser
cg
parents: 451
diff changeset
   489
                n2 > 3 ifTrue:[
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   490
                    Transcript showCR:'EmbeddedAppletFrame [info]: JAVA thread did not stop - shooting down ...'.
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   491
                    appletThread terminateNoSignal
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   492
                ]
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   493
            ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   494
        ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   495
    ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   496
    appletThread := nil
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   497
653
a98a3634389a make processes restartable (for snapshot restart of java threads)
cg
parents: 644
diff changeset
   498
    "Modified: / 24.12.1999 / 02:35:25 / cg"
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   499
! !
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   500
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   501
!JavaEmbeddedFrameView methodsFor:'initialize / release'!
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   502
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   503
destroy
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   504
    autoDestroyApplet == true ifTrue:[
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   505
        self stopApplet
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   506
    ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   507
    super destroy.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   508
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   509
    "Created: / 29.1.1998 / 15:21:45 / cg"
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   510
    "Modified: / 29.1.1998 / 15:28:26 / cg"
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   511
!
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   512
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   513
initialize           
2087
2e1a2d10b891 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2084
diff changeset
   514
    appletIsPreloaded := false.
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   515
    super initialize.
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   516
    viewBackground := Color black.
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   517
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   518
    "Modified: / 28.1.1999 / 17:44:11 / cg"
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   519
!
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   520
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   521
realize
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   522
    autoSetupApplet ~~ false ifTrue:[
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   523
        self setupAppletFrameIn:nil initializeJava:true
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   524
    ].
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   525
    autoStartApplet == true ifTrue:[
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   526
        embeddedAppletFrame notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   527
            self startApplet
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   528
        ]
681
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   529
    ].
c41ba2e76c65 start applet with higher prio,
cg
parents: 653
diff changeset
   530
    super realize.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   531
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   532
    "Created: / 29.1.1998 / 15:21:30 / cg"
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   533
    "Modified: / 20.10.1998 / 15:46:32 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   534
! !
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   535
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   536
!JavaEmbeddedFrameView methodsFor:'private'!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   537
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   538
setupAppletFrameIn:anAppletContextOrNil
644
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   539
     ^ self setupAppletFrameIn:anAppletContextOrNil initializeJava:true.
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   540
!
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   541
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   542
setupAppletFrameIn:anAppletContextOrNil initializeJava:initializeJava
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   543
     |appletContext
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   544
     jEmbeddedAppletFrameClass jDerivedAppletFrameClass
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   545
     toolkit peer attribs id
644
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   546
     jCodeBaseURL jDocumentURL jArchiveURL u fn|
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   547
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   548
    embeddedAppletFrame notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   549
        "/ already setup
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   550
        ^ self
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   551
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   552
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   553
    codeBaseURL isNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   554
        ^ self
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   555
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   556
644
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   557
    initializeJava ifTrue:[
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   558
        Java startupJavaSystem.
653
a98a3634389a make processes restartable (for snapshot restart of java threads)
cg
parents: 644
diff changeset
   559
    ] ifFalse:[
a98a3634389a make processes restartable (for snapshot restart of java threads)
cg
parents: 644
diff changeset
   560
        JavaVM initializeVMIfNoEventThreadRunning
644
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   561
    ].
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   562
644
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   563
    "/ if its a relative file-URL, make it relative under
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   564
    "/ java...
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   565
    u := URL fromString:codeBaseURL.
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   566
    u method = 'file' ifTrue:[
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   567
        fn := Smalltalk getSystemFileName:u file.
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   568
        fn isNil ifTrue:[
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   569
            fn := Smalltalk getPackageFileName:('stx/libjava/' , u file).
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   570
        ]
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   571
    ].
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   572
    fn notNil ifTrue:[
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   573
        fn := 'file:' , fn asFilename pathName
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   574
    ] ifFalse:[
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   575
        fn := codeBaseURL
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   576
    ].
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   577
    jCodeBaseURL := Java as_URL:fn.
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   578
    documentURL notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   579
        jDocumentURL := Java as_URL:documentURL.
644
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   580
    ] ifFalse:[
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   581
        jDocumentURL := Java as_URL:fn
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   582
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   583
    archiveURL notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   584
        jArchiveURL := Java as_URL:archiveURL.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   585
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   586
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   587
    id := appletID.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   588
    id isNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   589
        NextSequentialAppletID isNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   590
            NextSequentialAppletID := 1.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   591
        ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   592
        id := NextSequentialAppletID.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   593
        NextSequentialAppletID := NextSequentialAppletID + 1
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   594
    ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   595
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   596
    attribs := Dictionary new.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   597
    width notNil ifTrue:[attribs at:'width' put:width printString].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   598
    height notNil ifTrue:[attribs at:'height' put:height printString].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   599
644
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   600
    codeURL notNil ifTrue:[
0294a6ed677e checkin from browser
cg
parents: 545
diff changeset
   601
        attribs at:'code' put:codeURL
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   602
    ].
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   603
    parameterDictionary notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   604
        attribs declareAllFrom:parameterDictionary
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   605
    ].
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   606
    attributeHashTable := Java as_Hashtable:attribs.
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   607
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   608
    anAppletContextOrNil notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   609
        appletContext := anAppletContextOrNil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   610
    ] ifFalse:[
420
7d5ce7e030d4 checkin from browser
cg
parents: 419
diff changeset
   611
        appletContext := self class newAppletContext.
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   612
        appletContext isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   613
            self warn:'no netscape.applet.MozillaAppletContext class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   614
            ^ false
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   615
        ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   616
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   617
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   618
    jEmbeddedAppletFrameClass := Java classForName:'netscape.applet.EmbeddedAppletFrame'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   619
    jEmbeddedAppletFrameClass isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   620
        self warn:'no netscape.applet.EmbeddedAppletFrame class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   621
        ^ false
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   622
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   623
    jDerivedAppletFrameClass := Java classForName:'netscape.applet.DerivedAppletFrame'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   624
    jDerivedAppletFrameClass notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   625
        "/ ns4.0
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   626
        embeddedAppletFrame := jDerivedAppletFrameClass new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   627
        isNS40 := true.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   628
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   629
        "/ ns3.x
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   630
        embeddedAppletFrame := jEmbeddedAppletFrameClass new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   631
        isNS40 := false.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   632
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   633
    embeddedAppletFrame instVarNamed:'pData' put:self.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   634
429
99990a8a3509 *** empty log message ***
cg
parents: 420
diff changeset
   635
    toolkit := (Java classForName:'java.awt.Toolkit') perform:#'getDefaultToolkit'.
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   636
    peer := toolkit 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   637
                perform:#'createFrame(Ljava/awt/Frame;)Ljava/awt/peer/FramePeer;'
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   638
                with:embeddedAppletFrame.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   639
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   640
    (embeddedAppletFrame respondsTo:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;Z)V')
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   641
    ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   642
        "/ 4.0 netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   643
        embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   644
            perform:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;Z)V'
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   645
            withArguments:
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   646
                (Array
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   647
                    with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   648
                    with:jCodeBaseURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   649
                    with:jArchiveURL
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   650
                    with:attributeHashTable
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   651
                    with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   652
                    with:(Java as_Integer:id)
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   653
                    with:0 "/ reloadClasses-boolean
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   654
                ).
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   655
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   656
        (embeddedAppletFrame respondsTo:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;)V')
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   657
        ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   658
            "/ 3.01 netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   659
            embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   660
                perform:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;)V'
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   661
                with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   662
                with:jCodeBaseURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   663
                with:jArchiveURL
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   664
                with:attributeHashTable
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   665
                with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   666
                with:(Java as_Integer:id).
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   667
        ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   668
            "/ oldStyle netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   669
            embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   670
                perform:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;I)V'
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   671
                with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   672
                with:jCodeBaseURL
545
6a841644c5e9 checkin from browser
cg
parents: 527
diff changeset
   673
                with:attributeHashTable
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   674
                with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   675
                with:id.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   676
        ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   677
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   678
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   679
    embeddedAppletFrame instVarNamed:'peer' put:peer.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   680
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   681
    self javaPeer:peer.
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   682
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   683
    ^ true
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   684
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   685
    "Created: / 20.10.1998 / 15:47:04 / cg"
653
a98a3634389a make processes restartable (for snapshot restart of java threads)
cg
parents: 644
diff changeset
   686
    "Modified: / 24.12.1999 / 01:38:17 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   687
! !
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   688
303
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   689
!JavaEmbeddedFrameView methodsFor:'resizing'!
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   690
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   691
sizeChanged:how
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   692
    super sizeChanged:how.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   693
^ self.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   694
    embeddedAppletFrame notNil ifTrue:[
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   695
        (embeddedAppletFrame perform:#'isResizable()Z') ~~ 0 ifTrue:[
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   696
            self windowGroup sensor
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   697
                 pushDamageEvent:(WindowEvent
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   698
                                     for:self
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   699
                                     type:#configureX:y:width:height:
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   700
                                     arguments:(Array with:left with:top with:width with:height)).
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   701
"/            embeddedAppletFrame
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   702
"/                perform:#'appletResize(II)V'
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   703
"/                with:self width
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   704
"/                with:self height.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   705
        ]
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   706
    ]
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   707
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   708
    "Modified: / 1.2.1998 / 19:15:07 / cg"
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   709
! !
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   710
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   711
!JavaEmbeddedFrameView class methodsFor:'documentation'!
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   712
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   713
version
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
   714
    ^ '$Id: JavaEmbeddedFrameView.st,v 1.26 2011-08-18 18:42:48 vrany Exp $'
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
   715
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
   716
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
   717
version_SVN
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2116
diff changeset
   718
    ^ '$Id: JavaEmbeddedFrameView.st,v 1.26 2011-08-18 18:42:48 vrany Exp $'
2084
69ecd5609bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   719
! !