public class BasicAppletContext extends Object implements AppletContext
AppletContext
.Constructor and Description |
---|
BasicAppletContext(StatusDisplay statusDisplay)
Creates a new
BasicAppletContext . |
Modifier and Type | Method and Description |
---|---|
Applet |
getApplet(String name)
If the
StatusDisplay passed to this context is an instance of AppletViewer , this method will return
the Applet of such AppletViewer . |
Enumeration<Applet> |
getApplets()
Returns an enumeration containing the
Applet returned by getApplet(String) . |
AudioClip |
getAudioClip(URL url)
Not implemented.
|
Image |
getImage(URL url)
Not implemented.
|
InputStream |
getStream(String key)
Returns the stream to which specified key is associated within this
AppletContext . |
Iterator<String> |
getStreamKeys()
Finds all the keys of the streams in this
AppletContext . |
void |
setStream(String key,
InputStream stream)
Associates the specified stream with the specified key in this
AppletContext . |
void |
showDocument(URL url)
Not implemented.
|
void |
showDocument(URL url,
String target)
Not implemented.
|
void |
showStatus(String status)
Requests that the given status be displayed in this context's
StatusDisplay . |
public BasicAppletContext(@Nonnull StatusDisplay statusDisplay)
BasicAppletContext
.statusDisplay
- where the application can inform users of its current state.NullPointerException
- if statusDisplay
is null
.@Nullable public Applet getApplet(@Nullable String name)
StatusDisplay
passed to this context is an instance of AppletViewer
, this method will return
the Applet
of such AppletViewer
. Otherwise this method returns null
.getApplet
in interface AppletContext
Applet
in this context's StatusDisplay
(if any).AppletContext.getApplet(String)
@Nonnull public Enumeration<Applet> getApplets()
Applet
returned by getApplet(String)
. If
getApplet(String)
returns null
, this method will return an empty enumeration.getApplets
in interface AppletContext
Applet
in this context's StatusDisplay
(if any).getApplet(String)
,
AppletContext.getApplets()
@Nullable public AudioClip getAudioClip(@Nullable URL url)
null
.getAudioClip
in interface AppletContext
AppletContext.getAudioClip(URL)
@Nullable public Image getImage(@Nullable URL url)
null
.getImage
in interface AppletContext
AppletContext.getImage(URL)
@Nullable public InputStream getStream(@Nullable String key)
AppletContext
. Returns null
if
the AppletContext
contains no stream for this key.getStream
in interface AppletContext
key
- key whose associated stream is to be returned.AppletContext
maps the key.@Nonnull public Iterator<String> getStreamKeys()
AppletContext
.getStreamKeys
in interface AppletContext
AppletContext
.public void setStream(@Nullable String key, @Nullable InputStream stream)
AppletContext
.setStream
in interface AppletContext
key
- key with which the specified value is to be associated.stream
- stream to be associated with the specified key. If this parameter is null
, the specified key
is removed in this AppletContext
.public void showDocument(@Nullable URL url)
showDocument
in interface AppletContext
AppletContext.showDocument(URL)
public void showDocument(@Nullable URL url, @Nullable String target)
showDocument
in interface AppletContext
AppletContext.showDocument(URL, String)
public void showStatus(String status)
StatusDisplay
.showStatus
in interface AppletContext
status
- a message to display.Copyright © 2014–2019 AssertJ. All rights reserved.