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