JavaEmbeddedFrameView.st
author cg
Tue, 20 Oct 1998 14:10:21 +0000
changeset 397 ff55215c1eac
parent 384 9c0f24e91237
child 417 d60d5b5da5f9
permissions -rw-r--r--
fixes to allow multiple java applets in one frame;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
     1
JavaView subclass:#JavaEmbeddedFrameView
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
     2
	instanceVariableNames:'codeURL codeBaseURL documentURL archiveURL parameterDictionary
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
     3
		embeddedAppletFrame applet appletID appletThread
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
     4
		infoDisplayReceiver autoSetupApplet autoStartApplet
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
     5
		autoDestroyApplet isNS40'
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
     6
	classVariableNames:'NextSequentialAppletID'
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
     7
	poolDictionaries:''
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
     8
	category:'Java-Views-Support'
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
     9
!
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
    10
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
    11
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    12
!JavaEmbeddedFrameView class methodsFor:'support'!
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    13
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    14
newAppletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    15
    |jMozillaAppletContextClass|
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    16
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    17
    "/ this makes it a modzilla applet context ...
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    18
    jMozillaAppletContextClass := Java classForName:'netscape.applet.MozillaAppletContext'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    19
    jMozillaAppletContextClass isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    20
        self warn:'no netscape.applet.MozillaAppletContext class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    21
        ^ nil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    22
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    23
    jMozillaAppletContextClass instVarNamed:'debug' put:1.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    24
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    25
    ^ jMozillaAppletContextClass new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    26
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    27
    "Created: / 20.10.1998 / 15:40:08 / cg"
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    28
    "Modified: / 20.10.1998 / 15:43:47 / cg"
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    29
! !
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
    30
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    31
!JavaEmbeddedFrameView methodsFor:'accessing'!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    32
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    33
appletID
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    34
    "return the value of the instance variable 'appletID' (automatically generated)"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    35
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    36
    ^ appletID
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    37
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    38
    "Created: / 28.1.1998 / 21:08:54 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    39
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    40
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    41
appletID:something
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    42
    "set the value of the instance variable 'appletID' (automatically generated)"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    43
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    44
    appletID := something.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    45
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    46
    "Created: / 28.1.1998 / 21:08:54 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    47
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    48
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    49
appletThread
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    50
    ^ appletThread
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    51
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    52
    "Created: / 28.1.1998 / 21:39:42 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    53
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    54
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    55
archiveURL:anArchiveURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    56
    archiveURL := anArchiveURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    57
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    58
    "Created: / 28.1.1998 / 21:00:38 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    59
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    60
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    61
codeBaseURL:aCodeBaseURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    62
    codeBaseURL := aCodeBaseURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    63
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    64
    "Created: / 28.1.1998 / 20:59:34 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    65
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    66
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    67
codeURL:aCodeURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    68
    codeURL := aCodeURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    69
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    70
    "Created: / 28.1.1998 / 21:10:11 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    71
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    72
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    73
documentURL:aDocumentURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    74
    documentURL := aDocumentURLString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    75
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    76
    "Created: / 28.1.1998 / 21:00:03 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    77
    "Modified: / 28.1.1998 / 21:00:28 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    78
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    79
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    80
embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    81
    ^ embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    82
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    83
    "Created: / 28.1.1998 / 21:39:35 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    84
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    85
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    86
infoDisplayReceiver
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    87
    "return the value of the instance variable 'infoDisplayReceiver' (automatically generated)"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    88
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    89
    ^ infoDisplayReceiver
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    90
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    91
    "Created: / 28.1.1998 / 21:43:54 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    92
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    93
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    94
infoDisplayReceiver:something
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    95
    "set the value of the instance variable 'infoDisplayReceiver' (automatically generated)"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    96
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    97
    infoDisplayReceiver := something.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    98
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
    99
    "Created: / 28.1.1998 / 21:43:54 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   100
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   101
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   102
parameterDictionary:aParameterDictionary
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   103
    parameterDictionary := aParameterDictionary
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   104
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   105
    "Created: / 28.1.1998 / 21:01:20 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   106
! !
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   107
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   108
!JavaEmbeddedFrameView methodsFor:'applet control'!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   109
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   110
appletDESTROY
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   111
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   112
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   113
    isNS40 ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   114
        ev := (Java classForName:'netscape.applet.AppletEvent') basicNew.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   115
        ev perform:#'<init>(I)V' with:(embeddedAppletFrame class instVarNamed:'APPLET_DESTROY').
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   116
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   117
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   118
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   119
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   120
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   121
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   122
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   123
        with:(embeddedAppletFrame class instVarNamed:'APPLET_DESTROY').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   124
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   125
    "Created: / 28.1.1998 / 21:41:45 / cg"
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   126
    "Modified: / 16.10.1998 / 02:50:10 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   127
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   128
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   129
appletDISPOSE
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   130
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   131
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   132
    isNS40 ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   133
        ev := (Java classForName:'netscape.applet.AppletEvent') basicNew.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   134
        ev perform:#'<init>(I)V' with:(embeddedAppletFrame class instVarNamed:'APPLET_DISPOSE').
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   135
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   136
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   137
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   138
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   139
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   140
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   141
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   142
        with:(embeddedAppletFrame class instVarNamed:'APPLET_DISPOSE').
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:41:57 / cg"
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   145
    "Modified: / 16.10.1998 / 02:50:26 / cg"
282
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
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   148
appletINIT
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   149
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   150
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   151
    isNS40 ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   152
        ev := (Java classForName:'netscape.applet.AppletEvent') basicNew.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   153
        ev perform:#'<init>(I)V' with:(embeddedAppletFrame class instVarNamed:'APPLET_INIT').
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   154
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   155
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   156
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   157
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   158
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   159
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   160
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   161
        with:(embeddedAppletFrame class instVarNamed:'APPLET_INIT').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   162
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   163
    "Created: / 28.1.1998 / 21:17:51 / cg"
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   164
    "Modified: / 16.10.1998 / 02:49:46 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   165
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   166
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   167
appletLOAD
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   168
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   169
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   170
    isNS40 ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   171
        ev := (Java classForName:'netscape.applet.AppletEvent') basicNew.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   172
        ev perform:#'<init>(I)V' with:(embeddedAppletFrame class instVarNamed:'APPLET_LOAD').
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   173
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   174
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   175
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   176
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   177
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   178
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   179
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   180
        with:(embeddedAppletFrame class instVarNamed:'APPLET_LOAD').
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
    "Created: / 28.1.1998 / 21:17:37 / cg"
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   183
    "Modified: / 16.10.1998 / 02:49:16 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   184
!
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
appletSTART
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   187
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   188
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   189
    isNS40 ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   190
        ev := (Java classForName:'netscape.applet.AppletEvent') basicNew.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   191
        ev perform:#'<init>(I)V' with:(embeddedAppletFrame class instVarNamed:'APPLET_START').
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   192
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   193
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   194
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   195
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   196
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   197
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   198
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   199
        with:(embeddedAppletFrame class instVarNamed:'APPLET_START').
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:18:01 / cg"
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   202
    "Modified: / 16.10.1998 / 02:51:07 / cg"
282
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
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   205
appletSTOP
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   206
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   207
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   208
    isNS40 ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   209
        ev := (Java classForName:'netscape.applet.AppletEvent') basicNew.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   210
        ev perform:#'<init>(I)V' with:(embeddedAppletFrame class instVarNamed:'APPLET_STOP').
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   211
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   212
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   213
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   214
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   215
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   216
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   217
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   218
        with:(embeddedAppletFrame class instVarNamed:'APPLET_STOP').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   219
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   220
    "Created: / 28.1.1998 / 21:41:33 / cg"
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   221
    "Modified: / 16.10.1998 / 02:50:58 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   222
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   223
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   224
autoDestroyApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   225
    "set/clear the autoDestroy flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   226
     If set, the applet will be shutDown whenever the I get destroyed.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   227
     if clear, the applet is not automatically shutDown and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   228
     terminated by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   229
     The default is false."
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   230
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   231
    autoDestroyApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   232
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   233
    "Created: / 29.1.1998 / 15:18:50 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   234
    "Modified: / 29.1.1998 / 15:21:01 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   235
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   236
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   237
autoSetupApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   238
    "set/clear the autoSetup flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   239
     If set, the appletFrame will be setup whenever the I get realized
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   240
     for the first time.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   241
     If clear, the frame is not automatically setup and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   242
     setup by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   243
     The default is true."
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   244
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   245
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   246
    autoSetupApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   247
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   248
    "Created: / 29.1.1998 / 15:18:41 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   249
    "Modified: / 29.1.1998 / 20:45:37 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   250
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   251
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   252
autoStartApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   253
    "set/clear the autoStart flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   254
     If set, the applet will be loaded & started whenever the I get realized
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   255
     for the first time.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   256
     If clear, the applet is not automatically started and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   257
     started by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   258
     The default is false."
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   259
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   260
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   261
    autoStartApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   262
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   263
    "Created: / 29.1.1998 / 15:18:41 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   264
    "Modified: / 29.1.1998 / 15:20:54 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   265
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   266
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   267
startApplet
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   268
    self startAppletThread.
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
    self appletLOAD.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   271
    self appletINIT.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   272
    self appletSTART
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
    "Modified: / 28.1.1998 / 21:30:24 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   275
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   276
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   277
startAppletThread
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   278
    |appletName|
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   279
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   280
    appletThread := JavaProcess 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   281
            for:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   282
                    "/ passnotifications to the documentFrame ...
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   283
                    Object informationSignal handle:[:ex |
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   284
                        JavaVM javaConsoleStream showCR:ex errorString.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   285
                        ex proceed.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   286
                    ] do:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   287
                        Object activityNotificationSignal handle:[:ex |
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   288
                            infoDisplayReceiver notNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   289
                                infoDisplayReceiver infoDisplay:ex errorString.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   290
                            ] ifFalse:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   291
                                Transcript showCR:ex errorString
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
                            ex proceed.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   294
                        ] do:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   295
                            [
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   296
                                embeddedAppletFrame perform:#'run()V'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   297
                            ] valueNowOrOnUnwindDo:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   298
                                appletThread terminateAllSubprocesses.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   299
                                Transcript showCR:'JAVA applet startup finished'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   300
                            ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   301
                        ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   302
                    ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   303
                ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   304
            priority:(Processor activePriority - 1).
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   305
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   306
    appletName := codeURL asFilename withoutSuffix baseName.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   307
    appletThread name:('JAVA-applet ''' , appletName , ''' [startup]').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   308
    
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   309
    appletThread resume.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   310
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   311
    ^ appletThread.
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
    "Created: / 28.1.1998 / 21:30:32 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   314
    "Modified: / 28.1.1998 / 21:44:03 / cg"
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   315
!
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   316
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   317
stopApplet
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   318
    |n n2|
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   319
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   320
    (appletThread notNil 
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   321
    and:[appletThread isDead not])ifTrue:[
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   322
"/        'EmbeddedAppletFrame [info]: send APPLET_STOP ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   323
        self appletSTOP.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   324
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   325
"/        'EmbeddedAppletFrame [info]: send APPLET_DESTROY ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   326
        self appletDESTROY.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   327
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   328
"/        'EmbeddedAppletFrame [info]: send APPLET_DISPOSE ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   329
        self appletDISPOSE.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   330
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   331
        "/
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   332
        "/ give it a chance to stop ...
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   333
        "/
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   334
        Processor yield.
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   335
        n2 := 0.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   336
        [appletThread isDead] whileFalse:[
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   337
            n := 0.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   338
            [n < 10 and:[appletThread isDead not]] whileTrue:[
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   339
                Delay waitForSeconds:0.1.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   340
                n := n + 1.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   341
            ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   342
            appletThread isDead ifFalse:[
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   343
                Transcript showCR:'EmbeddedAppletFrame [info]: JAVA thread did not stop - soft terminate ...'.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   344
                appletThread terminate.
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   345
                n2 := n2 + 1.
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   346
                n2 > 10 ifTrue:[
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   347
                    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
   348
                    appletThread terminateNoSignal
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   349
                ]
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   350
            ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   351
        ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   352
    ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   353
    appletThread := nil
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   354
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   355
    "Modified: / 6.2.1998 / 02:19:18 / cg"
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   356
! !
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   357
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   358
!JavaEmbeddedFrameView methodsFor:'initialize / release'!
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   359
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   360
destroy
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   361
    autoDestroyApplet == true ifTrue:[
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   362
        self stopApplet
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   363
    ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   364
    super destroy.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   365
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   366
    "Created: / 29.1.1998 / 15:21:45 / cg"
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   367
    "Modified: / 29.1.1998 / 15:28:26 / cg"
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   368
!
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   369
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   370
realize
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   371
    super realize.
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   372
 
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   373
    autoSetupApplet ~~ false ifTrue:[
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   374
        self setupAppletFrameIn:nil initializeJava:true
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   375
    ].
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   376
    autoStartApplet == true ifTrue:[
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   377
        embeddedAppletFrame notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   378
            self startApplet
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   379
        ]
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   380
    ]
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   381
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   382
    "Created: / 29.1.1998 / 15:21:30 / cg"
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   383
    "Modified: / 20.10.1998 / 15:46:32 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   384
! !
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   385
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   386
!JavaEmbeddedFrameView methodsFor:'private'!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   387
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   388
setupAppletFrameIn:anAppletContextOrNil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   389
     |appletContext
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   390
     jEmbeddedAppletFrameClass jDerivedAppletFrameClass
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   391
     toolkit peer attribs id
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   392
     jCodeBaseURL jDocumentURL jArchiveURL|
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   393
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   394
    embeddedAppletFrame notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   395
        "/ already setup
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   396
        ^ self
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   397
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   398
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   399
    codeBaseURL isNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   400
        ^ self
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   401
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   402
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   403
    Java startupJavaSystem.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   404
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   405
    jCodeBaseURL := Java as_URL:codeBaseURL.
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   406
    documentURL notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   407
        jDocumentURL := Java as_URL:documentURL.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   408
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   409
    archiveURL notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   410
        jArchiveURL := Java as_URL:archiveURL.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   411
    ].
282
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
    id := appletID.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   414
    id isNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   415
        NextSequentialAppletID isNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   416
            NextSequentialAppletID := 1.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   417
        ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   418
        id := NextSequentialAppletID.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   419
        NextSequentialAppletID := NextSequentialAppletID + 1
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   420
    ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   421
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   422
    attribs := Dictionary new.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   423
    width notNil ifTrue:[attribs at:'width' put:width printString].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   424
    height notNil ifTrue:[attribs at:'height' put:height printString].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   425
    codeURL notNil ifTrue:[attribs at:'code' put:codeURL].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   426
    parameterDictionary notNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   427
        attribs declareAllFrom:parameterDictionary
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   428
    ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   429
    attribs := Java as_Hashtable:attribs.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   430
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   431
    anAppletContextOrNil notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   432
        appletContext := anAppletContextOrNil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   433
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   434
        appletContext := self newAppletContext.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   435
        appletContext isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   436
            self warn:'no netscape.applet.MozillaAppletContext class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   437
            ^ false
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   438
        ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   439
    ].
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
    jEmbeddedAppletFrameClass := Java classForName:'netscape.applet.EmbeddedAppletFrame'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   442
    jEmbeddedAppletFrameClass isNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   443
        self warn:'no netscape.applet.EmbeddedAppletFrame class'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   444
        ^ false
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   445
    ].
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   446
    jDerivedAppletFrameClass := Java classForName:'netscape.applet.DerivedAppletFrame'.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   447
    jDerivedAppletFrameClass notNil ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   448
        "/ ns4.0
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   449
        embeddedAppletFrame := jDerivedAppletFrameClass new.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   450
        isNS40 := true.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   451
    ] ifFalse:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   452
        "/ ns3.x
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   453
        embeddedAppletFrame := jEmbeddedAppletFrameClass new.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   454
        isNS40 := false.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   455
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   456
    embeddedAppletFrame instVarNamed:'pData' put:self.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   457
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   458
    toolkit := Java classForName:'java.awt.Toolkit'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   459
    toolkit := toolkit invoke:#getDefaultToolkit.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   460
    peer := toolkit 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   461
                perform:#'createFrame(Ljava/awt/Frame;)Ljava/awt/peer/FramePeer;'
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   462
                with:embeddedAppletFrame.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   463
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   464
    (embeddedAppletFrame respondsTo:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;Z)V')
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   465
    ifTrue:[
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   466
        "/ 4.0 netscape
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   467
        embeddedAppletFrame 
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   468
            perform:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;Z)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   469
            withArguments:
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   470
                (Array
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   471
                    with:jDocumentURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   472
                    with:jCodeBaseURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   473
                    with:jArchiveURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   474
                    with:attribs
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   475
                    with:appletContext
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   476
                    with:(Java as_Integer:id)
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   477
                    with:0 "/ reloadClasses-boolean
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   478
                ).
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   479
    ] ifFalse:[
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   480
        (embeddedAppletFrame respondsTo:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;)V')
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   481
        ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   482
            "/ 3.01 netscape
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   483
            embeddedAppletFrame 
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   484
                perform:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;Ljava/lang/Integer;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   485
                with:jDocumentURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   486
                with:jCodeBaseURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   487
                with:jArchiveURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   488
                with:attribs
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   489
                with:appletContext
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   490
                with:(Java as_Integer:id).
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   491
        ] ifFalse:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   492
            "/ oldStyle netscape
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   493
            embeddedAppletFrame 
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   494
                perform:#'<init>(Ljava/net/URL;Ljava/net/URL;Ljava/util/Hashtable;Lnetscape/applet/MozillaAppletContext;I)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   495
                with:jDocumentURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   496
                with:jCodeBaseURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   497
                with:attribs
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   498
                with:appletContext
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   499
                with:id.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   500
        ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   501
    ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   502
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   503
    embeddedAppletFrame instVarNamed:'peer' put:peer.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   504
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   505
    self javaPeer:peer.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   506
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   507
    ^ true
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   508
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   509
    "Created: / 20.10.1998 / 15:38:24 / cg"
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   510
    "Modified: / 20.10.1998 / 15:43:36 / cg"
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   511
!
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   512
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   513
setupAppletFrameIn:anAppletContextOrNil initializeJava:initializeJava
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   514
     |appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   515
     jEmbeddedAppletFrameClass jDerivedAppletFrameClass
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   516
     toolkit peer attribs id
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   517
     jCodeBaseURL jDocumentURL jArchiveURL|
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   518
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   519
    embeddedAppletFrame notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   520
        "/ already setup
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   521
        ^ self
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   522
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   523
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   524
    codeBaseURL isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   525
        ^ self
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   526
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   527
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   528
    initializeJava ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   529
        Java startupJavaSystem.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   530
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   531
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   532
    jCodeBaseURL := Java as_URL:codeBaseURL.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   533
    documentURL notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   534
        jDocumentURL := Java as_URL:documentURL.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   535
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   536
    archiveURL notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   537
        jArchiveURL := Java as_URL:archiveURL.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   538
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   539
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   540
    id := appletID.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   541
    id isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   542
        NextSequentialAppletID isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   543
            NextSequentialAppletID := 1.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   544
        ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   545
        id := NextSequentialAppletID.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   546
        NextSequentialAppletID := NextSequentialAppletID + 1
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   547
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   548
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   549
    attribs := Dictionary new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   550
    width notNil ifTrue:[attribs at:'width' put:width printString].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   551
    height notNil ifTrue:[attribs at:'height' put:height printString].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   552
    codeURL notNil ifTrue:[attribs at:'code' put:codeURL].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   553
    parameterDictionary notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   554
        attribs declareAllFrom:parameterDictionary
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   555
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   556
    attribs := Java as_Hashtable:attribs.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   557
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   558
    anAppletContextOrNil notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   559
        appletContext := anAppletContextOrNil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   560
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   561
        appletContext := self newAppletContext.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   562
        appletContext isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   563
            self warn:'no netscape.applet.MozillaAppletContext class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   564
            ^ false
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   565
        ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   566
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   567
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   568
    jEmbeddedAppletFrameClass := Java classForName:'netscape.applet.EmbeddedAppletFrame'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   569
    jEmbeddedAppletFrameClass isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   570
        self warn:'no netscape.applet.EmbeddedAppletFrame class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   571
        ^ false
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   572
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   573
    jDerivedAppletFrameClass := Java classForName:'netscape.applet.DerivedAppletFrame'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   574
    jDerivedAppletFrameClass notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   575
        "/ ns4.0
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   576
        embeddedAppletFrame := jDerivedAppletFrameClass new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   577
        isNS40 := true.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   578
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   579
        "/ ns3.x
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   580
        embeddedAppletFrame := jEmbeddedAppletFrameClass new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   581
        isNS40 := false.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   582
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   583
    embeddedAppletFrame instVarNamed:'pData' put:self.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   584
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   585
    toolkit := Java classForName:'java.awt.Toolkit'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   586
    toolkit := toolkit invoke:#getDefaultToolkit.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   587
    peer := toolkit 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   588
                perform:#'createFrame(Ljava/awt/Frame;)Ljava/awt/peer/FramePeer;'
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   589
                with:embeddedAppletFrame.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   590
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   591
    (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
   592
    ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   593
        "/ 4.0 netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   594
        embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   595
            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
   596
            withArguments:
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   597
                (Array
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   598
                    with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   599
                    with:jCodeBaseURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   600
                    with:jArchiveURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   601
                    with:attribs
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   602
                    with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   603
                    with:(Java as_Integer:id)
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   604
                    with:0 "/ reloadClasses-boolean
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   605
                ).
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   606
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   607
        (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
   608
        ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   609
            "/ 3.01 netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   610
            embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   611
                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
   612
                with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   613
                with:jCodeBaseURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   614
                with:jArchiveURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   615
                with:attribs
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   616
                with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   617
                with:(Java as_Integer:id).
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   618
        ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   619
            "/ oldStyle netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   620
            embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   621
                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
   622
                with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   623
                with:jCodeBaseURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   624
                with:attribs
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   625
                with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   626
                with:id.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   627
        ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   628
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   629
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   630
    embeddedAppletFrame instVarNamed:'peer' put:peer.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   631
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   632
    self javaPeer:peer.
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   633
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   634
    ^ true
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   635
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   636
    "Modified: / 20.10.1998 / 15:43:36 / cg"
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   637
    "Created: / 20.10.1998 / 15:47:04 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   638
! !
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   639
303
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   640
!JavaEmbeddedFrameView methodsFor:'resizing'!
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   641
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   642
sizeChanged:how
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   643
    super sizeChanged:how.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   644
^ self.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   645
    embeddedAppletFrame notNil ifTrue:[
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   646
        (embeddedAppletFrame perform:#'isResizable()Z') ~~ 0 ifTrue:[
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   647
            self windowGroup sensor
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   648
                 pushDamageEvent:(WindowEvent
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   649
                                     for:self
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   650
                                     type:#configureX:y:width:height:
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   651
                                     arguments:(Array with:left with:top with:width with:height)).
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   652
"/            embeddedAppletFrame
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   653
"/                perform:#'appletResize(II)V'
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   654
"/                with:self width
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   655
"/                with:self height.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   656
        ]
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   657
    ]
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   658
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   659
    "Modified: / 1.2.1998 / 19:15:07 / cg"
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   660
! !
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   661
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   662
!JavaEmbeddedFrameView class methodsFor:'documentation'!
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   663
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   664
version
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   665
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaEmbeddedFrameView.st,v 1.9 1998/10/20 14:10:21 cg Exp $'
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   666
! !