org.apache.batik.script

Interface Window

public interface Window

This interface represents the 'window' object defined in the global environment of a SVG document.
Nested Class Summary
static interfaceWindow.URLResponseHandler
To handle the completion of a 'getURL()' or 'postURL' call.
Method Summary
voidalert(String message)
Displays an alert dialog box.
voidclearInterval(Object interval)
Cancels an interval that was set by a call to 'setInterval'.
voidclearTimeout(Object timeout)
Cancels an timeout that was set by a call to 'setTimeout'.
booleanconfirm(String message)
Displays a confirm dialog box.
BridgeContextgetBridgeContext()
Returns the current BridgeContext.
InterpretergetInterpreter()
Returns the associated interpreter.
voidgetURL(String uri, Window.URLResponseHandler h)
Gets data from the given URI.
voidgetURL(String uri, Window.URLResponseHandler h, String enc)
Gets data from the given URI.
NodeparseXML(String text, Document doc)
Parses the given XML string into a DocumentFragment of the given document or a new document if 'doc' is null.
voidpostURL(String uri, String content, Window.URLResponseHandler h)
Posts data to the given URI.
voidpostURL(String uri, String content, Window.URLResponseHandler h, String mimeType)
Posts data to the given URI.
voidpostURL(String uri, String content, Window.URLResponseHandler h, String mimeType, String enc)
Posts data to the given URI.
Stringprompt(String message)
Displays an input dialog box.
Stringprompt(String message, String defVal)
Displays an input dialog box, given the default value.
ObjectsetInterval(String script, long interval)
Evaluates the given string repeatedly after the given amount of time.
ObjectsetInterval(Runnable r, long interval)
Calls the 'run' method of the given Runnable repeatedly after the given amount of time.
ObjectsetTimeout(String script, long timeout)
Evaluates the given string after the given amount of time.
ObjectsetTimeout(Runnable r, long timeout)
Calls the 'run' method of the given Runnable after the given amount of time.

Method Detail

alert

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

clearInterval

public void clearInterval(Object interval)
Cancels an interval that was set by a call to 'setInterval'.

clearTimeout

public void clearTimeout(Object timeout)
Cancels an timeout that was set by a call to 'setTimeout'.

confirm

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

getBridgeContext

public BridgeContext getBridgeContext()
Returns the current BridgeContext. This object given a deep access to the viewer internals.

getInterpreter

public Interpreter getInterpreter()
Returns the associated interpreter.

getURL

public void getURL(String uri, Window.URLResponseHandler h)
Gets data from the given URI.

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)
Gets data from the given URI.

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.

parseXML

public Node parseXML(String text, Document doc)
Parses the given XML string into a DocumentFragment of the given document or a new document if 'doc' is null.

Returns: The document fragment or null on error.

postURL

public void postURL(String uri, String content, Window.URLResponseHandler h)
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)
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 enc)
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. enc The encoding to apply to content may be "gzip", "deflate", or null.

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.

setInterval

public Object setInterval(String script, long interval)
Evaluates the given string repeatedly after the given amount of time. This method does not stall the script: the evaluation is scheduled and the script continues its execution.

Returns: an object representing the interval created.

setInterval

public Object setInterval(Runnable r, long interval)
Calls the 'run' method of the given Runnable repeatedly after the given amount of time. This method does not stall the script: the evaluation is scheduled and the script continues its execution.

Returns: an object representing the interval created.

setTimeout

public Object setTimeout(String script, long timeout)
Evaluates the given string after the given amount of time. This method does not stall the script: the evaluation is scheduled and the script continues its execution.

Returns: an object representing the timeout created.

setTimeout

public Object setTimeout(Runnable r, long timeout)
Calls the 'run' method of the given Runnable after the given amount of time. This method does not stall the script: the evaluation is scheduled and the script continues its execution.

Returns: an object representing the timeout created.

Copyright B) 2007 Apache Software Foundation. All Rights Reserved.