SmalltalkAppletStub.st
author cg
Fri, 29 Jan 1999 15:30:31 +0000
changeset 545 6a841644c5e9
parent 259 1bb7cdea6c46
child 713 75e92ac63bf1
permissions -rw-r--r--
checkin from browser

"
 COPYRIGHT (c) 1997 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"




Object subclass:#SmalltalkAppletStub
	instanceVariableNames:'parameter documentBase codeBase appletContext'
	classVariableNames:''
	poolDictionaries:''
	category:'Java-Views-Support'
!

!SmalltalkAppletStub class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1997 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"



!

documentation
"
    [Author:]
        Claus Gittinger
"


! !

!SmalltalkAppletStub methodsFor:'accessing'!

appletContext
    "return the value of the instance variable 'appletContext' (automatically generated)"

    ^ appletContext

    "Created: 1.8.1997 / 15:56:20 / cg"
!

appletContext:something
    "set the value of the instance variable 'appletContext' (automatically generated)"

    appletContext := something.

    "Created: 1.8.1997 / 15:56:20 / cg"
!

codeBase
    "return the value of the instance variable 'codeBase' (automatically generated)"

    ^ codeBase

    "Created: 1.8.1997 / 15:56:20 / cg"
!

codeBase:something
    "set the value of the instance variable 'codeBase' (automatically generated)"

    codeBase := something.

    "Created: 1.8.1997 / 15:56:20 / cg"
!

documentBase
    "return the value of the instance variable 'documentBase' (automatically generated)"

    ^ documentBase

    "Created: 1.8.1997 / 15:56:20 / cg"
!

documentBase:something
    "set the value of the instance variable 'documentBase' (automatically generated)"

    documentBase := something.

    "Created: 1.8.1997 / 15:56:20 / cg"
!

parameter
    "return the value of the instance variable 'parameter' (automatically generated)"

    ^ parameter

    "Created: 1.8.1997 / 15:56:19 / cg"
!

parameter:something
    "set the value of the instance variable 'parameter' (automatically generated)"

    parameter := something.

    "Created: 1.8.1997 / 15:56:20 / cg"
! !

!SmalltalkAppletStub methodsFor:'applet actions'!

appletResize:newWidth _:newHeight
    self halt.

    "Created: 13.8.1997 / 00:18:41 / cg"
! !

!SmalltalkAppletStub methodsFor:'java accessing'!

doesNotUnderstand:aMessage
    |selector base|

    selector := aMessage selector.
    selector == #'getParameter(Ljava/lang/String;)Ljava/lang/String;' ifTrue:[
        ^ self getParameter:(aMessage arguments at:1)
    ].
    selector == #'getAppletContext()Ljava/applet/AppletContext;' ifTrue:[
        ^ self getAppletContext
    ].
    selector == #'getCodeBase()Ljava/net/URL;' ifTrue:[
        ^ self getCodeBase.
    ].
    selector == #'appletResize(II)V' ifTrue:[
        self appletResize:(aMessage arguments at:1) _:(aMessage arguments at:2).
        ^ nil   "/ void
    ].
    ^ super doesNotUnderstand:aMessage

    "Created: / 7.1.1998 / 17:13:11 / cg"
    "Modified: / 12.1.1998 / 23:50:40 / cg"
!

getAppletContext
    ^ appletContext

    "Created: 1.8.1997 / 15:57:20 / cg"
!

getCodeBase
    ^ codeBase

    "Created: 1.8.1997 / 15:57:11 / cg"
!

getDocumentBase
    ^ documentBase

    "Created: 1.8.1997 / 15:57:05 / cg"
!

getParameter:arg
    |s|

    (parameter includesKey:arg) ifFalse:[
"/        self halt:'no parameter for: ' , arg displayString.
        ^ nil.

        s := Dialog request:('applet wants parameter for ' , (Java as_ST_String:arg)).
        ^ Java as_String:s.
    ].
    ^ parameter at:arg ifAbsent:nil

    "Created: 1.8.1997 / 15:56:51 / cg"
    "Modified: 14.8.1997 / 01:28:56 / cg"
! !

!SmalltalkAppletStub class methodsFor:'documentation'!

version
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/SmalltalkAppletStub.st,v 1.8 1999/01/29 15:30:21 cg Exp $'
! !