Interface BrowserFactoryImpl
Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the
org.web3d.x3d.jsail
classes.
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
The factory implementation interface for obtaining references to browser instances.
Any implementation of a X3D browser that wishes to provide their own customised version of the browser factory should must subclass this class. In particular this is useful if the implementation needs to stay within the package defined by the application for other reasons.
A default implementation of this class is the DefaultBrowserFactoryImpl which is package access only.
*- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateComponent
(Map<String, Object> params) Create a X3D browser that can be used as an AWT component.getBrowser
(Applet applet) Get a browser from the given java applet reference as a base in the current HTML page.getBrowser
(Applet applet, String frameName, int index) Get a browser from the given java applet reference one some named page and at some embed location.getBrowser
(InetAddress address, int port) Get a reference to a browser that is located on a remote machine.
-
Method Details
-
createComponent
Create a X3D browser that can be used as an AWT component. The component returned is guaranteed to be an instance of X3DComponent.- Parameters:
params
- Parameters to control the look and feel.- Returns:
- The component browser initialised to be empty.
- Throws:
NotSupportedException
- The implementation does not support this type of browser.- See Also:
-
getBrowser
ExternalBrowser getBrowser(Applet applet) throws NotSupportedException, NoSuchBrowserException, ConnectionException Get a browser from the given java applet reference as a base in the current HTML page. Used when attempting to access a browser on the current page as this applet and is the first browser on the page. Generically, the same as calling getBrowser(applet, "", 0);- Parameters:
applet
- The applet reference to use- Returns:
- A reference to the Browser implementation
- Throws:
NotSupportedException
- The implementation does not support this type of X3D browserNoSuchBrowserException
- Could not locate a X3D browser on the same page as the applet.ConnectionException
- An error occurred during the connecting process
-
getBrowser
ExternalBrowser getBrowser(Applet applet, String frameName, int index) throws NotSupportedException, NoSuchBrowserException, ConnectionException Get a browser from the given java applet reference one some named page and at some embed location. Used when attempting to access a browser on another HTML page within a multi-framed environment, or if there are a number of X3D browser instances located on the same page.If the frame name is a zero length string or null then it is assumed to be located on the same HTML page as the applet. The index is the number of the embed X3D browser starting from the top of the page. If there are other non-X3D plugins embedded in the page these are not taken into account in calculating the embed index.
- Parameters:
applet
- The applet reference to useframeName
- The name of the frame to look into for the browserindex
- The embed index of the X3D browser in the page- Returns:
- A reference to the Browser implementation
- Throws:
NotSupportedException
- The implementation does not support this type of X3D browser.NoSuchBrowserException
- Could not locate a X3D browser on the same page as the applet.ConnectionException
- An error occurred during the connecting process
-
getBrowser
ExternalBrowser getBrowser(InetAddress address, int port) throws NotSupportedException, NoSuchBrowserException, UnknownHostException, ConnectionException Get a reference to a browser that is located on a remote machine. This a server application to send scene updates to a number of client browsers located on remote machines. If there are a number of browsers running on a remote machine, they can be differentiated by the port number they are listening on.There is no default port number for X3D browsers.
- Parameters:
address
- The address of the machine to connect toport
- The port number on that machine to connect to.- Returns:
- A reference to the Browser implementation
- Throws:
NotSupportedException
- The implementation does not support this type of X3D browser.NoSuchBrowserException
- Could not locate a X3D browser on the same page as the applet.UnknownHostException
- Could not find the machine named in the address.ConnectionException
- An error occurred during the connecting process
-