JavaEmbeddedFrameView.st
author cg
Fri, 08 Jan 1999 16:51:15 +0000
changeset 527 7eb6f6291fea
parent 455 36fffdce84f7
child 545 6a841644c5e9
permissions -rw-r--r--
*** empty log message ***
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:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   114
        "/ ev = netscape.applet.AppletEvent(APPLET_DESTROY);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   115
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   116
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_DESTROY').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   117
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   118
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   119
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   120
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   121
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   122
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   123
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   124
        with:(embeddedAppletFrame class instVarNamed:'APPLET_DESTROY').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   125
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   126
    "Created: / 28.1.1998 / 21:41:45 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   127
    "Modified: / 13.11.1998 / 14:19:49 / cg"
282
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
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   130
appletDISPOSE
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   131
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   132
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   133
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   134
        "/ ev = netscape.applet.AppletEvent(APPLET_DISPOSE);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   135
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   136
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_DISPOSE').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   137
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   138
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   139
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   140
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   141
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   142
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   143
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   144
        with:(embeddedAppletFrame class instVarNamed:'APPLET_DISPOSE').
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
    "Created: / 28.1.1998 / 21:41:57 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   147
    "Modified: / 13.11.1998 / 14:19:43 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   148
!
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
appletINIT
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   151
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   152
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   153
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   154
        "/ ev = netscape.applet.AppletEvent(APPLET_INIT);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   155
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   156
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_INIT').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   157
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   158
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   159
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   160
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   161
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   162
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   163
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   164
        with:(embeddedAppletFrame class instVarNamed:'APPLET_INIT').
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
    "Created: / 28.1.1998 / 21:17:51 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   167
    "Modified: / 13.11.1998 / 14:19:35 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   168
!
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
appletLOAD
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   171
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   172
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   173
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   174
        "/ ev = netscape.applet.AppletEvent(APPLET_LOAD);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   175
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   176
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_LOAD').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   177
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   178
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   179
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   180
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   181
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   182
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   183
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   184
        with:(embeddedAppletFrame class instVarNamed:'APPLET_LOAD').
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:17:37 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   187
    "Modified: / 13.11.1998 / 14:19:31 / cg"
282
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
appletSTART
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   191
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   192
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   193
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   194
        "/ ev = netscape.applet.AppletEvent(APPLET_START);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   195
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   196
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_START').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   197
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   198
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   199
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   200
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   201
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   202
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   203
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   204
        with:(embeddedAppletFrame class instVarNamed:'APPLET_START').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   205
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   206
    "Created: / 28.1.1998 / 21:18:01 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   207
    "Modified: / 13.11.1998 / 14:19:21 / cg"
282
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
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   210
appletSTOP
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   211
    |ev|
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   212
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   213
    isNS40 ifTrue:[
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   214
        "/ ev = netscape.applet.AppletEvent(APPLET_STOP);
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   215
        ev := (Java classForName:'netscape.applet.AppletEvent')
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   216
                newWith_int:(embeddedAppletFrame class instVarNamed:'APPLET_STOP').
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   217
        embeddedAppletFrame
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   218
            perform:#'sendEvent(Lnetscape/applet/NEvent;)V'
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   219
            with:ev.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   220
        ^ self
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   221
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   222
    embeddedAppletFrame
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   223
        perform:#'sendEvent(I)V' 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   224
        with:(embeddedAppletFrame class instVarNamed:'APPLET_STOP').
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   225
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   226
    "Created: / 28.1.1998 / 21:41:33 / cg"
451
50d24dc93f8b checkin from browser
cg
parents: 429
diff changeset
   227
    "Modified: / 13.11.1998 / 14:19:14 / cg"
282
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
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   230
autoDestroyApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   231
    "set/clear the autoDestroy flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   232
     If set, the applet will be shutDown whenever the I get destroyed.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   233
     if clear, the applet is not automatically shutDown and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   234
     terminated by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   235
     The default is false."
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   236
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   237
    autoDestroyApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   238
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   239
    "Created: / 29.1.1998 / 15:18:50 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   240
    "Modified: / 29.1.1998 / 15:21:01 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   241
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   242
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   243
autoSetupApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   244
    "set/clear the autoSetup flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   245
     If set, the appletFrame will be setup whenever the I get realized
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   246
     for the first time.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   247
     If clear, the frame is not automatically setup and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   248
     setup by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   249
     The default is true."
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
    autoSetupApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   253
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   254
    "Created: / 29.1.1998 / 15:18:41 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   255
    "Modified: / 29.1.1998 / 20:45:37 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   256
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   257
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   258
autoStartApplet:aBoolean
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   259
    "set/clear the autoStart flag.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   260
     If set, the applet will be loaded & started whenever the I get realized
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   261
     for the first time.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   262
     If clear, the applet is not automatically started and must be
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   263
     started by someone else.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   264
     The default is false."
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   265
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   266
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   267
    autoStartApplet := aBoolean.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   268
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   269
    "Created: / 29.1.1998 / 15:18:41 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   270
    "Modified: / 29.1.1998 / 15:20:54 / cg"
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   271
!
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   272
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   273
startApplet
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   274
    self startAppletThread.
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
    self appletLOAD.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   277
    self appletINIT.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   278
    self appletSTART
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
    "Modified: / 28.1.1998 / 21:30:24 / cg"
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   281
!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   283
startAppletThread
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   284
    |appletName|
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   285
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   286
    appletThread := JavaProcess 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   287
            for:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   288
                    "/ passnotifications to the documentFrame ...
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   289
                    Object informationSignal handle:[:ex |
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   290
                        JavaVM javaConsoleStream showCR:ex errorString.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   291
                        ex proceed.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   292
                    ] do:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   293
                        Object activityNotificationSignal handle:[:ex |
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   294
                            infoDisplayReceiver notNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   295
                                infoDisplayReceiver infoDisplay:ex errorString.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   296
                            ] ifFalse:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   297
                                Transcript showCR:ex errorString
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   298
                            ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   299
                            ex proceed.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   300
                        ] do:[
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
                                embeddedAppletFrame perform:#'run()V'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   303
                            ] valueNowOrOnUnwindDo:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   304
                                appletThread terminateAllSubprocesses.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   305
                                Transcript showCR:'JAVA applet startup finished'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   306
                            ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   307
                        ]
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
                ]
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   310
            priority:(Processor activePriority - 1).
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   311
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   312
    appletName := codeURL asFilename withoutSuffix baseName.
417
d60d5b5da5f9 applet thread name changed.
cg
parents: 397
diff changeset
   313
    appletThread name:('JAVA-' , appletName , '-applet' , ' [startup]').
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   314
    
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   315
    appletThread resume.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   316
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   317
    ^ appletThread.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   318
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   319
    "Created: / 28.1.1998 / 21:30:32 / cg"
417
d60d5b5da5f9 applet thread name changed.
cg
parents: 397
diff changeset
   320
    "Modified: / 4.11.1998 / 17:37:14 / cg"
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   321
!
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   322
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   323
stopApplet
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   324
    |n n2|
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   325
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   326
    (appletThread notNil 
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   327
    and:[appletThread isDead not])ifTrue:[
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   328
"/        'EmbeddedAppletFrame [info]: send APPLET_STOP ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   329
        self appletSTOP.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   330
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   331
"/        'EmbeddedAppletFrame [info]: send APPLET_DESTROY ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   332
        self appletDESTROY.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   333
318
8720093188f7 debugPrints
cg
parents: 311
diff changeset
   334
"/        'EmbeddedAppletFrame [info]: send APPLET_DISPOSE ...' infoPrintCR.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   335
        self appletDISPOSE.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   336
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   337
        "/
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   338
        "/ give it a chance to stop ...
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   339
        "/
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   340
        Processor yield.
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   341
        n2 := 0.
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   342
        [appletThread isDead] whileFalse:[
455
36fffdce84f7 checkin from browser
cg
parents: 451
diff changeset
   343
            "/ give it a second to shut down ...
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   344
            n := 0.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   345
            [n < 10 and:[appletThread isDead not]] whileTrue:[
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   346
                Delay waitForSeconds:0.1.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   347
                n := n + 1.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   348
            ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   349
            appletThread isDead ifFalse:[
455
36fffdce84f7 checkin from browser
cg
parents: 451
diff changeset
   350
                "/ after 3 seconds, kill it.
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   351
                Transcript showCR:'EmbeddedAppletFrame [info]: JAVA thread did not stop - soft terminate ...'.
527
7eb6f6291fea *** empty log message ***
cg
parents: 455
diff changeset
   352
appletThread == JavaVM javaScreenUpdaterThread ifTrue:[self halt].
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   353
                appletThread terminate.
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   354
                n2 := n2 + 1.
455
36fffdce84f7 checkin from browser
cg
parents: 451
diff changeset
   355
                n2 > 3 ifTrue:[
311
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   356
                    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
   357
                    appletThread terminateNoSignal
b23c5e132b8c hardterminate javaThread, if it did not terminate after 10 tries.
cg
parents: 303
diff changeset
   358
                ]
286
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
        ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   361
    ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   362
    appletThread := nil
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   363
527
7eb6f6291fea *** empty log message ***
cg
parents: 455
diff changeset
   364
    "Modified: / 8.1.1999 / 17:20:48 / cg"
286
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
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   367
!JavaEmbeddedFrameView methodsFor:'initialize / release'!
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
destroy
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   370
    autoDestroyApplet == true ifTrue:[
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   371
        self stopApplet
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   372
    ].
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   373
    super destroy.
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   374
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   375
    "Created: / 29.1.1998 / 15:21:45 / cg"
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   376
    "Modified: / 29.1.1998 / 15:28:26 / cg"
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   377
!
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   378
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   379
realize
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   380
    super realize.
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   381
 
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   382
    autoSetupApplet ~~ false ifTrue:[
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   383
        self setupAppletFrameIn:nil initializeJava:true
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   384
    ].
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   385
    autoStartApplet == true ifTrue:[
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   386
        embeddedAppletFrame notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   387
            self startApplet
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   388
        ]
286
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   389
    ]
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   390
da220fe69de3 applet startup & shutDown now all done here;
cg
parents: 282
diff changeset
   391
    "Created: / 29.1.1998 / 15:21:30 / cg"
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   392
    "Modified: / 20.10.1998 / 15:46:32 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   393
! !
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   394
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   395
!JavaEmbeddedFrameView methodsFor:'private'!
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   396
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   397
setupAppletFrameIn:anAppletContextOrNil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   398
     |appletContext
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   399
     jEmbeddedAppletFrameClass jDerivedAppletFrameClass
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   400
     toolkit peer attribs id
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   401
     jCodeBaseURL jDocumentURL jArchiveURL|
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   402
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   403
    embeddedAppletFrame notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   404
        "/ already setup
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   405
        ^ self
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   406
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   407
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   408
    codeBaseURL isNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   409
        ^ self
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   410
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   411
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   412
    Java startupJavaSystem.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   413
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   414
    jCodeBaseURL := Java as_URL:codeBaseURL.
288
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   415
    documentURL notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   416
        jDocumentURL := Java as_URL:documentURL.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   417
    ].
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   418
    archiveURL notNil ifTrue:[
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   419
        jArchiveURL := Java as_URL:archiveURL.
d71bacb73ff7 checkin from browser
cg
parents: 286
diff changeset
   420
    ].
282
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
    id := appletID.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   423
    id isNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   424
        NextSequentialAppletID isNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   425
            NextSequentialAppletID := 1.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   426
        ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   427
        id := NextSequentialAppletID.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   428
        NextSequentialAppletID := NextSequentialAppletID + 1
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
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   431
    attribs := Dictionary new.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   432
    width notNil ifTrue:[attribs at:'width' put:width printString].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   433
    height notNil ifTrue:[attribs at:'height' put:height printString].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   434
    codeURL notNil ifTrue:[attribs at:'code' put:codeURL].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   435
    parameterDictionary notNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   436
        attribs declareAllFrom:parameterDictionary
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   437
    ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   438
    attribs := Java as_Hashtable:attribs.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   439
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   440
    anAppletContextOrNil notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   441
        appletContext := anAppletContextOrNil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   442
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   443
        appletContext := self newAppletContext.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   444
        appletContext isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   445
            self warn:'no netscape.applet.MozillaAppletContext class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   446
            ^ false
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   447
        ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   448
    ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   449
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   450
    jEmbeddedAppletFrameClass := Java classForName:'netscape.applet.EmbeddedAppletFrame'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   451
    jEmbeddedAppletFrameClass isNil ifTrue:[
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   452
        self warn:'no netscape.applet.EmbeddedAppletFrame class'.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   453
        ^ false
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   454
    ].
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   455
    jDerivedAppletFrameClass := Java classForName:'netscape.applet.DerivedAppletFrame'.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   456
    jDerivedAppletFrameClass notNil ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   457
        "/ ns4.0
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   458
        embeddedAppletFrame := jDerivedAppletFrameClass new.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   459
        isNS40 := true.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   460
    ] ifFalse:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   461
        "/ ns3.x
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   462
        embeddedAppletFrame := jEmbeddedAppletFrameClass new.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   463
        isNS40 := false.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   464
    ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   465
    embeddedAppletFrame instVarNamed:'pData' put:self.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   466
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   467
    toolkit := Java classForName:'java.awt.Toolkit'.
419
679a4b82b3bb eliminated old invoke stuff
cg
parents: 417
diff changeset
   468
    toolkit := toolkit perform:#getDefaultToolkit.
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   469
    peer := toolkit 
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   470
                perform:#'createFrame(Ljava/awt/Frame;)Ljava/awt/peer/FramePeer;'
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   471
                with:embeddedAppletFrame.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   472
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   473
    (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
   474
    ifTrue:[
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   475
        "/ 4.0 netscape
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   476
        embeddedAppletFrame 
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   477
            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
   478
            withArguments:
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   479
                (Array
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   480
                    with:jDocumentURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   481
                    with:jCodeBaseURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   482
                    with:jArchiveURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   483
                    with:attribs
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   484
                    with:appletContext
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   485
                    with:(Java as_Integer:id)
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   486
                    with:0 "/ reloadClasses-boolean
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   487
                ).
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   488
    ] ifFalse:[
384
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   489
        (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
   490
        ifTrue:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   491
            "/ 3.01 netscape
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   492
            embeddedAppletFrame 
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   493
                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
   494
                with:jDocumentURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   495
                with:jCodeBaseURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   496
                with:jArchiveURL
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:(Java as_Integer:id).
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   500
        ] ifFalse:[
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   501
            "/ oldStyle netscape
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   502
            embeddedAppletFrame 
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   503
                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
   504
                with:jDocumentURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   505
                with:jCodeBaseURL
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   506
                with:attribs
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   507
                with:appletContext
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   508
                with:id.
9c0f24e91237 started some support for NS4.0
cg
parents: 318
diff changeset
   509
        ].
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   510
    ].
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   511
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   512
    embeddedAppletFrame instVarNamed:'peer' put:peer.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   513
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   514
    self javaPeer:peer.
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   515
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   516
    ^ true
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   517
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   518
    "Created: / 20.10.1998 / 15:38:24 / cg"
419
679a4b82b3bb eliminated old invoke stuff
cg
parents: 417
diff changeset
   519
    "Modified: / 4.11.1998 / 21:07:03 / cg"
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   520
!
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   521
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   522
setupAppletFrameIn:anAppletContextOrNil initializeJava:initializeJava
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   523
     |appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   524
     jEmbeddedAppletFrameClass jDerivedAppletFrameClass
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   525
     toolkit peer attribs id
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   526
     jCodeBaseURL jDocumentURL jArchiveURL|
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
    embeddedAppletFrame notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   529
        "/ already setup
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   530
        ^ self
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
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   533
    codeBaseURL isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   534
        ^ self
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
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   537
    initializeJava ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   538
        Java startupJavaSystem.
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
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   541
    jCodeBaseURL := Java as_URL:codeBaseURL.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   542
    documentURL notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   543
        jDocumentURL := Java as_URL:documentURL.
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
    archiveURL notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   546
        jArchiveURL := Java as_URL:archiveURL.
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
    id := appletID.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   550
    id isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   551
        NextSequentialAppletID isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   552
            NextSequentialAppletID := 1.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   553
        ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   554
        id := NextSequentialAppletID.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   555
        NextSequentialAppletID := NextSequentialAppletID + 1
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   556
    ].
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
    attribs := Dictionary new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   559
    width notNil ifTrue:[attribs at:'width' put:width printString].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   560
    height notNil ifTrue:[attribs at:'height' put:height printString].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   561
    codeURL notNil ifTrue:[attribs at:'code' put:codeURL].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   562
    parameterDictionary notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   563
        attribs declareAllFrom:parameterDictionary
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   564
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   565
    attribs := Java as_Hashtable:attribs.
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
    anAppletContextOrNil notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   568
        appletContext := anAppletContextOrNil
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   569
    ] ifFalse:[
420
7d5ce7e030d4 checkin from browser
cg
parents: 419
diff changeset
   570
        appletContext := self class newAppletContext.
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   571
        appletContext isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   572
            self warn:'no netscape.applet.MozillaAppletContext class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   573
            ^ false
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   574
        ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   575
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   576
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   577
    jEmbeddedAppletFrameClass := Java classForName:'netscape.applet.EmbeddedAppletFrame'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   578
    jEmbeddedAppletFrameClass isNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   579
        self warn:'no netscape.applet.EmbeddedAppletFrame class'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   580
        ^ false
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   581
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   582
    jDerivedAppletFrameClass := Java classForName:'netscape.applet.DerivedAppletFrame'.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   583
    jDerivedAppletFrameClass notNil ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   584
        "/ ns4.0
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   585
        embeddedAppletFrame := jDerivedAppletFrameClass new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   586
        isNS40 := true.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   587
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   588
        "/ ns3.x
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   589
        embeddedAppletFrame := jEmbeddedAppletFrameClass new.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   590
        isNS40 := false.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   591
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   592
    embeddedAppletFrame instVarNamed:'pData' put:self.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   593
429
99990a8a3509 *** empty log message ***
cg
parents: 420
diff changeset
   594
    toolkit := (Java classForName:'java.awt.Toolkit') perform:#'getDefaultToolkit'.
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   595
    peer := toolkit 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   596
                perform:#'createFrame(Ljava/awt/Frame;)Ljava/awt/peer/FramePeer;'
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   597
                with:embeddedAppletFrame.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   598
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   599
    (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
   600
    ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   601
        "/ 4.0 netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   602
        embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   603
            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
   604
            withArguments:
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   605
                (Array
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   606
                    with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   607
                    with:jCodeBaseURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   608
                    with:jArchiveURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   609
                    with:attribs
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   610
                    with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   611
                    with:(Java as_Integer:id)
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   612
                    with:0 "/ reloadClasses-boolean
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   613
                ).
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   614
    ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   615
        (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
   616
        ifTrue:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   617
            "/ 3.01 netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   618
            embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   619
                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
   620
                with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   621
                with:jCodeBaseURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   622
                with:jArchiveURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   623
                with:attribs
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   624
                with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   625
                with:(Java as_Integer:id).
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   626
        ] ifFalse:[
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   627
            "/ oldStyle netscape
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   628
            embeddedAppletFrame 
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   629
                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
   630
                with:jDocumentURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   631
                with:jCodeBaseURL
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   632
                with:attribs
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   633
                with:appletContext
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   634
                with:id.
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   635
        ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   636
    ].
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   637
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   638
    embeddedAppletFrame instVarNamed:'peer' put:peer.
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
    self javaPeer:peer.
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   641
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   642
    ^ true
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   643
397
ff55215c1eac fixes to allow multiple java applets in one frame;
cg
parents: 384
diff changeset
   644
    "Created: / 20.10.1998 / 15:47:04 / cg"
429
99990a8a3509 *** empty log message ***
cg
parents: 420
diff changeset
   645
    "Modified: / 10.11.1998 / 12:36:09 / cg"
282
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   646
! !
80e840e0139f now holds all applet setup code
cg
parents: 233
diff changeset
   647
303
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   648
!JavaEmbeddedFrameView methodsFor:'resizing'!
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   649
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   650
sizeChanged:how
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   651
    super sizeChanged:how.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   652
^ self.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   653
    embeddedAppletFrame notNil ifTrue:[
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   654
        (embeddedAppletFrame perform:#'isResizable()Z') ~~ 0 ifTrue:[
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   655
            self windowGroup sensor
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   656
                 pushDamageEvent:(WindowEvent
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   657
                                     for:self
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   658
                                     type:#configureX:y:width:height:
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   659
                                     arguments:(Array with:left with:top with:width with:height)).
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   660
"/            embeddedAppletFrame
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   661
"/                perform:#'appletResize(II)V'
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   662
"/                with:self width
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   663
"/                with:self height.
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   664
        ]
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   665
    ]
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   666
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   667
    "Modified: / 1.2.1998 / 19:15:07 / cg"
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   668
! !
0b95d5f40bf2 checkin from browser
cg
parents: 288
diff changeset
   669
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   670
!JavaEmbeddedFrameView class methodsFor:'documentation'!
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   671
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   672
version
527
7eb6f6291fea *** empty log message ***
cg
parents: 455
diff changeset
   673
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaEmbeddedFrameView.st,v 1.16 1999/01/08 16:51:15 cg Exp $'
233
fc91b8aba669 intitial checkin
cg
parents:
diff changeset
   674
! !