SmalltalkAppletContext.st
author Claus Gittinger <cg@exept.de>
Sun, 23 Feb 2020 14:03:15 +0100
branchcvs_MAIN
changeset 3997 5bb44f7e1d20
parent 3412 df11bb428463
permissions -rw-r--r--
#REFACTORING by exept class: Java class changed: #dumpConfigOn:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
545
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
     1
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
     2
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
     3
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
     5
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
     6
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
545
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
     8
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
     9
 This software is furnished under a license and may be used
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    10
 only in accordance with the terms of that license and with the
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    12
 be provided or otherwise made available to, or used by, any
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    13
 other person.  No title to or ownership of the software is
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    14
 hereby transferred.
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    15
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    18
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    19
     as of 1.9.2010
545
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    20
"
713
75e92ac63bf1 category change
cg
parents: 545
diff changeset
    21
"{ Package: 'stx:libjava' }"
75e92ac63bf1 category change
cg
parents: 545
diff changeset
    22
178
7c26db52551b intitial checkin
cg
parents:
diff changeset
    23
Object subclass:#SmalltalkAppletContext
193
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    24
	instanceVariableNames:'statusHolder'
178
7c26db52551b intitial checkin
cg
parents:
diff changeset
    25
	classVariableNames:''
7c26db52551b intitial checkin
cg
parents:
diff changeset
    26
	poolDictionaries:''
713
75e92ac63bf1 category change
cg
parents: 545
diff changeset
    27
	category:'Languages-Java-Views-Support'
178
7c26db52551b intitial checkin
cg
parents:
diff changeset
    28
!
7c26db52551b intitial checkin
cg
parents:
diff changeset
    29
545
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    30
!SmalltalkAppletContext class methodsFor:'documentation'!
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    31
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    32
copyright
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    33
"
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
    34
 COPYRIGHT (c) 1996-2015 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    35
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    36
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    37
3324
a58245c0e83a Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2731
diff changeset
    38
 COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    39
                            SWING Research Group, Czech Technical University in Prague
545
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    40
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    41
 This software is furnished under a license and may be used
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    42
 only in accordance with the terms of that license and with the
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    44
 be provided or otherwise made available to, or used by, any
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    45
 other person.  No title to or ownership of the software is
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    46
 hereby transferred.
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    47
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    48
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    49
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    50
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    51
     as of 1.9.2010
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    52
545
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    53
"
6a841644c5e9 checkin from browser
cg
parents: 419
diff changeset
    54
! !
178
7c26db52551b intitial checkin
cg
parents:
diff changeset
    55
7c26db52551b intitial checkin
cg
parents:
diff changeset
    56
!SmalltalkAppletContext methodsFor:'accessing'!
7c26db52551b intitial checkin
cg
parents:
diff changeset
    57
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    58
getImage: url 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    59
    | imgSource  toolKit |
193
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    60
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    61
    "return 
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    62
        Toolkit.getDefaultToolkit().createImage(new sun.awt.image.URLImageSource(arg1)))"
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    63
    imgSource := (JavaVM classForName: 'sun.awt.image.URLImageSource') 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    64
                newCleared.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    65
    imgSource perform: #'<init>(Ljava/net/URL;)V' with: url.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    66
    toolKit := (Java classForName: 'java.awt.Toolkit') 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    67
                perform: #getDefaultToolkit.
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    68
    ^ toolKit perform: #createImage with: imgSource.
193
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    69
419
679a4b82b3bb eliminated old invoke stuff
cg
parents: 271
diff changeset
    70
    "Modified: / 4.11.1998 / 21:07:48 / cg"
193
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    71
!
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    72
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    73
showStatus: arg 
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    74
    | msg |
193
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    75
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    76
    arg isJavaObject ifTrue: [
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    77
        (arg isMemberOf: (JavaVM classForName: 'java.lang.String')) ifTrue: [
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    78
            msg := Java as_ST_String: arg
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    79
        ] ifFalse: [ msg := arg printString ]
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    80
    ] ifFalse: [ msg := arg ].
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    81
    statusHolder notNil ifTrue: [ statusHolder value: msg ] ifFalse: [
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
    82
        Transcript showCR: msg
193
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    83
    ].
178
7c26db52551b intitial checkin
cg
parents:
diff changeset
    84
    ^ nil
7c26db52551b intitial checkin
cg
parents:
diff changeset
    85
193
859177de4b04 *** empty log message ***
cg
parents: 178
diff changeset
    86
    "Created: 1.8.1997 / 15:48:53 / cg"
205
11cd2ad78854 *** empty log message ***
cg
parents: 193
diff changeset
    87
    "Modified: 8.8.1997 / 12:07:43 / cg"
178
7c26db52551b intitial checkin
cg
parents:
diff changeset
    88
! !
7c26db52551b intitial checkin
cg
parents:
diff changeset
    89
258
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    90
!SmalltalkAppletContext methodsFor:'java accessing'!
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    91
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    92
doesNotUnderstand:aMessage
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    93
    |selector img|
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    94
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    95
    (selector := aMessage selector) == #'showStatus(Ljava/lang/String;)V' ifTrue:[
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    96
        self showStatus:(Java as_ST_String:(aMessage arguments at:1)).
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    97
        ^ self
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    98
    ].
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
    99
    selector == #'getImage(Ljava/net/URL;)Ljava/awt/Image;' ifTrue:[
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
   100
        ^ self getImage:(aMessage arguments at:1).
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
   101
    ].
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
   102
    ^ super doesNotUnderstand:aMessage
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
   103
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
   104
    "Created: / 12.1.1998 / 23:48:10 / cg"
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
   105
    "Modified: / 12.1.1998 / 23:53:31 / cg"
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
   106
! !
35364e39bc0e checkin from browser
cg
parents: 234
diff changeset
   107
178
7c26db52551b intitial checkin
cg
parents:
diff changeset
   108
!SmalltalkAppletContext class methodsFor:'documentation'!
7c26db52551b intitial checkin
cg
parents:
diff changeset
   109
7c26db52551b intitial checkin
cg
parents:
diff changeset
   110
version
3412
df11bb428463 Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3360
diff changeset
   111
    ^ '$Header: /cvs/stx/stx/libjava/SmalltalkAppletContext.st,v 1.16 2015-03-20 12:08:01 vrany Exp $'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   112
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   113
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   114
version_CVS
3412
df11bb428463 Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3360
diff changeset
   115
    ^ '$Header: /cvs/stx/stx/libjava/SmalltalkAppletContext.st,v 1.16 2015-03-20 12:08:01 vrany Exp $'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   116
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   117
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   118
version_HG
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   119
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   120
    ^ '$Changeset: <not expanded> $'
2151
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
   121
!
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
   122
c0b6570c6f9b Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2108
diff changeset
   123
version_SVN
2731
13f5be2bf83b Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2711 2678
diff changeset
   124
    ^ 'Id'
2108
ca8c4e7db2e8 category change
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   125
! !
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2254
diff changeset
   126