SmalltalkAppletStub.st
author cg
Mon, 12 Jan 1998 14:24:47 +0000
changeset 255 2d8b3948a08a
parent 234 78953bbfaba1
child 259 1bb7cdea6c46
permissions -rw-r--r--
*** empty log message ***

'From Smalltalk/X, Version:3.3.1 on 12-jan-1998 at 1:27:21 pm'                  !

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


!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|

    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 == #'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 / 12:53:56 / 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.6 1998/01/12 14:24:47 cg Exp $'
! !