org.apache.batik.bridge
Class ScriptingEnvironment.Window

java.lang.Object
  extended by org.apache.batik.bridge.ScriptingEnvironment.Window
All Implemented Interfaces:
Window
Direct Known Subclasses:
SVG12ScriptingEnvironment.Global
Enclosing class:
ScriptingEnvironment

protected class ScriptingEnvironment.Window
extends Object
implements Window

Represents the window object of this environment.


Nested Class Summary
protected  class ScriptingEnvironment.Window.IntervalRunnableTimerTask
          A TimerTask to invoke a setInterval()-scheduled function that is specified by a Runnable.
protected  class ScriptingEnvironment.Window.IntervalScriptTimerTask
          A TimerTask to invoke a setInterval()-scheduled function that is specified by a String.
protected  class ScriptingEnvironment.Window.TimeoutRunnableTimerTask
          A TimerTask to invoke a setTimeout()-scheduled function that is specified by a Runnable.
protected  class ScriptingEnvironment.Window.TimeoutScriptTimerTask
          A TimerTask to invoke a setTimeout()-scheduled function that is specified by a String.
 
Nested classes/interfaces inherited from interface org.apache.batik.bridge.Window
Window.URLResponseHandler
 
Field Summary
protected  Interpreter interpreter
          The associated interpreter.
protected  String language
          The associated language.
protected  Location location
          The Location object
 
Constructor Summary
ScriptingEnvironment.Window(Interpreter interp, String lang)
          Creates a new Window for the given language.
 
Method Summary
 void alert(String message)
          Displays an alert dialog box.
 void clearInterval(Object interval)
          Implements Window.clearInterval(Object).
 void clearTimeout(Object timeout)
          Implements Window.clearTimeout(Object).
 boolean confirm(String message)
          Displays a confirm dialog box.
 BridgeContext getBridgeContext()
          Returns the current BridgeContext.
 Interpreter getInterpreter()
          Returns the associated interpreter.
 Location getLocation()
          Returns a Location object representing this Window.
 Window getParent()
          Returns a Window object representing the parent of this Window.
 void getURL(String uri, Window.URLResponseHandler h)
          Implements Window.getURL(String,org.apache.batik.bridge.Window.URLResponseHandler).
 void getURL(String uri, Window.URLResponseHandler h, String enc)
          Implements Window.getURL(String,org.apache.batik.bridge.Window.URLResponseHandler,String).
 Node parseXML(String text, Document doc)
          Implements Window.parseXML(String,Document).
 void postURL(String uri, String content, Window.URLResponseHandler h)
          Posts data to the given URI.
 void postURL(String uri, String content, Window.URLResponseHandler h, String mimeType)
          Posts data to the given URI.
 void postURL(String uri, String content, Window.URLResponseHandler h, String mimeType, String fEnc)
          Posts data to the given URI.
 String printNode(Node n)
          Serializes the given node.
 String prompt(String message)
          Displays an input dialog box.
 String prompt(String message, String defVal)
          Displays an input dialog box, given the default value.
 Object setInterval(Runnable r, long interval)
          Implements Window.setInterval(Runnable,long).
 Object setInterval(String script, long interval)
          Implements Window.setInterval(String,long).
 Object setTimeout(Runnable r, long timeout)
          Implements Window.setTimeout(Runnable,long).
 Object setTimeout(String script, long timeout)
          Implements Window.setTimeout(String,long).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interpreter

protected Interpreter interpreter
The associated interpreter.


language

protected String language
The associated language.


location

protected Location location
The Location object

Constructor Detail

ScriptingEnvironment.Window

public ScriptingEnvironment.Window(Interpreter interp,
                                   String lang)
Creates a new Window for the given language.

Method Detail

setInterval

public Object setInterval(String script,
                          long interval)
Implements Window.setInterval(String,long).

Returns:
an object representing the interval created.

setInterval

public Object setInterval(Runnable r,
                          long interval)
Implements Window.setInterval(Runnable,long).

Returns:
an object representing the interval created.

clearInterval

public void clearInterval(Object interval)
Implements Window.clearInterval(Object).


setTimeout

public Object setTimeout(String script,
                         long timeout)
Implements Window.setTimeout(String,long).

Returns:
an object representing the timeout created.

setTimeout

public Object setTimeout(Runnable r,
                         long timeout)
Implements Window.setTimeout(Runnable,long).

Returns:
an object representing the timeout created.

clearTimeout

public void clearTimeout(Object timeout)
Implements Window.clearTimeout(Object).


parseXML

public Node parseXML(String text,
                     Document doc)
Implements Window.parseXML(String,Document).

Returns:
The document fragment or null on error.

printNode

public String printNode(Node n)
Serializes the given node.


getURL

public void getURL(String uri,
                   Window.URLResponseHandler h)
Implements Window.getURL(String,org.apache.batik.bridge.Window.URLResponseHandler).

Parameters:
uri - The URI where the data is located.
h - A handler called when the data is available.

getURL

public void getURL(String uri,
                   Window.URLResponseHandler h,
                   String enc)
Implements Window.getURL(String,org.apache.batik.bridge.Window.URLResponseHandler,String).

Parameters:
uri - The URI where the data is located.
h - A handler called when the data is available.
enc - The character encoding of the data.

postURL

public void postURL(String uri,
                    String content,
                    Window.URLResponseHandler h)
Description copied from interface: Window
Posts data to the given URI.

Parameters:
uri - The URI where the data is located.
content - The data to post to the server.
h - A handler called when the data is available.

postURL

public void postURL(String uri,
                    String content,
                    Window.URLResponseHandler h,
                    String mimeType)
Description copied from interface: Window
Posts data to the given URI.

Parameters:
uri - The URI where the data is located.
content - The data to post to the server.
h - A handler called when the data is available.
mimeType - The mimeType to asscoiate with post.

postURL

public void postURL(String uri,
                    String content,
                    Window.URLResponseHandler h,
                    String mimeType,
                    String fEnc)
Description copied from interface: Window
Posts data to the given URI.

Parameters:
uri - The URI where the data is located.
content - The data to post to the server.
h - A handler called when the data is available.
mimeType - The mimeType to asscoiate with post.
fEnc - The encoding to apply to content may be "gzip", "deflate", or null.

alert

public void alert(String message)
Displays an alert dialog box.


confirm

public boolean confirm(String message)
Displays a confirm dialog box.


prompt

public String prompt(String message)
Displays an input dialog box.

Returns:
The input of the user, or null if the dialog was cancelled.

prompt

public String prompt(String message,
                     String defVal)
Displays an input dialog box, given the default value.

Returns:
The input of the user, or null if the dialog was cancelled.

getBridgeContext

public BridgeContext getBridgeContext()
Returns the current BridgeContext.


getInterpreter

public Interpreter getInterpreter()
Returns the associated interpreter.


getParent

public Window getParent()
Returns a Window object representing the parent of this Window.

Specified by:
getParent in interface Window

getLocation

public Location getLocation()
Returns a Location object representing this Window.

Specified by:
getLocation in interface Window


Copyright © 2017 Apache Software Foundation. All Rights Reserved.