Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.swt.view
Class BrowserView

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by org.xj3d.ui.swt.view.BrowserView
All Implemented Interfaces:
java.util.EventListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.swt.events.DisposeListener, org.eclipse.swt.events.KeyListener, org.eclipse.swt.events.ShellListener, org.eclipse.swt.internal.SWTEventListener, org.eclipse.ui.IPartListener2, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation, BrowserComponent, BrowserCoreListener

public class BrowserView
extends org.eclipse.ui.part.ViewPart
implements BrowserComponent, BrowserCoreListener, org.eclipse.swt.events.ShellListener, org.eclipse.swt.events.DisposeListener, org.eclipse.swt.events.KeyListener, org.eclipse.ui.IPartListener2

An Eclipse plugin View of the Xj3D Browser.

Version:
$Revision: 1.10 $
Author:
Rex Melton

Field Summary
protected  OGLStandardBrowserCore browserCore
          The internal browser core
protected  LocationToolbar locToolbar
          The toolbar holding location information
protected  OGLBrowserCanvas mainCanvas
          The canvas used to display the world
protected  MessageBuffer messageBuffer
          Area to push error messages to
protected  NavigationToolbar navToolbar
          The toolbar holding navigation information
protected  StatusBar statusBar
          The status bar
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
BrowserView()
           
 
Method Summary
 void browserDisposed()
          The browser has been disposed by the user calling the dispose method on the ExternalBrowser instance.
 void browserInitialized(VRMLScene scene)
          Ignored.
 void browserShutdown()
          Ignored.
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          This is a callback that will allow us to create the viewer and initialize it.
 void destroy()
          Called to instruct the component instance to destroy itself and any used resources.
 BrowserCore getBrowserCore()
          Get the core browser implementation.
 java.lang.Object getCanvas()
          Get the SWT component holding this browser.
 ErrorReporter getErrorReporter()
          Fetch the error handler so that application code can post messages too.
 int getRendererType()
          Get the renderer type.
 void keyPressed(org.eclipse.swt.events.KeyEvent ke)
          Notification that a key is pressed.
 void keyReleased(org.eclipse.swt.events.KeyEvent ke)
          Notification that a key is released.
 void partActivated(org.eclipse.ui.IWorkbenchPartReference partRef)
          Ignored.
 void partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference partRef)
          Ignored.
 void partClosed(org.eclipse.ui.IWorkbenchPartReference partRef)
          Ignored.
 void partDeactivated(org.eclipse.ui.IWorkbenchPartReference partRef)
          Ignored.
 void partHidden(org.eclipse.ui.IWorkbenchPartReference partRef)
          Notification that the referenced part was hidden.
 void partInputChanged(org.eclipse.ui.IWorkbenchPartReference partRef)
          Ignored.
 void partOpened(org.eclipse.ui.IWorkbenchPartReference partRef)
          Ignored.
 void partVisible(org.eclipse.ui.IWorkbenchPartReference partRef)
          Notification that the referenced part was made visible.
 void setFocus()
          Passing the focus request to the viewer's control.
 void setMinimumFrameInterval(int millis, boolean userSet)
          Set the minimum frame interval time to limit the CPU resources taken up by the 3D renderer.
 void shellActivated(org.eclipse.swt.events.ShellEvent evt)
          Ignored.
 void shellClosed(org.eclipse.swt.events.ShellEvent evt)
          Ignored.
 void shellDeactivated(org.eclipse.swt.events.ShellEvent evt)
          Ignored.
 void shellDeiconified(org.eclipse.swt.events.ShellEvent evt)
          The shell has changed from a minimized to a normal state.
 void shellIconified(org.eclipse.swt.events.ShellEvent evt)
          The shell has changed from a normal state to minimized.
 void start()
          Called to instruct the component instance to start rendering now.
 void stop()
          Called to instruct the component instance to stop and suspend its state.
 int supportedSpecificationVersion()
          Get the spec version that is supported.
 void urlLoadFailed(java.lang.String msg)
          Ignored.
 void widgetDisposed(org.eclipse.swt.events.DisposeEvent evt)
          We're being disposed of.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, dispose, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

navToolbar

protected NavigationToolbar navToolbar
The toolbar holding navigation information


locToolbar

protected LocationToolbar locToolbar
The toolbar holding location information


statusBar

protected StatusBar statusBar
The status bar


messageBuffer

protected MessageBuffer messageBuffer
Area to push error messages to


mainCanvas

protected OGLBrowserCanvas mainCanvas
The canvas used to display the world


browserCore

protected OGLStandardBrowserCore browserCore
The internal browser core

Constructor Detail

BrowserView

public BrowserView()
Method Detail

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
This is a callback that will allow us to create the viewer and initialize it.

Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart

setFocus

public void setFocus()
Passing the focus request to the viewer's control.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart

keyPressed

public void keyPressed(org.eclipse.swt.events.KeyEvent ke)
Notification that a key is pressed. Ignored

Specified by:
keyPressed in interface org.eclipse.swt.events.KeyListener
Parameters:
ke - The event that caused this method to be called

keyReleased

public void keyReleased(org.eclipse.swt.events.KeyEvent ke)
Notification that a key is released.

Specified by:
keyReleased in interface org.eclipse.swt.events.KeyListener
Parameters:
ke - The event that caused this method to be called

shellActivated

public void shellActivated(org.eclipse.swt.events.ShellEvent evt)
Ignored. The shell has been given focus.

Specified by:
shellActivated in interface org.eclipse.swt.events.ShellListener
Parameters:
evt - The shell event that caused the method to be called.

shellClosed

public void shellClosed(org.eclipse.swt.events.ShellEvent evt)
Ignored. The shell is being closed.

Specified by:
shellClosed in interface org.eclipse.swt.events.ShellListener
Parameters:
evt - The shell event that caused the method to be called.

shellDeactivated

public void shellDeactivated(org.eclipse.swt.events.ShellEvent evt)
Ignored. The shell has lost focus.

Specified by:
shellDeactivated in interface org.eclipse.swt.events.ShellListener
Parameters:
evt - The shell event that caused the method to be called.

shellDeiconified

public void shellDeiconified(org.eclipse.swt.events.ShellEvent evt)
The shell has changed from a minimized to a normal state. Restore the frame rate to normal.

Specified by:
shellDeiconified in interface org.eclipse.swt.events.ShellListener
Parameters:
evt - The shell event that caused the method to be called.

shellIconified

public void shellIconified(org.eclipse.swt.events.ShellEvent evt)
The shell has changed from a normal state to minimized. Throttle back the frame rate.

Specified by:
shellIconified in interface org.eclipse.swt.events.ShellListener
Parameters:
evt - The window event that caused the method to be called.

widgetDisposed

public void widgetDisposed(org.eclipse.swt.events.DisposeEvent evt)
We're being disposed of. Notify the browser's Canvas to clean up in anticipation of it's dispose method being called through the normal swt chain of destruction. Notify the ImageLoader to dispose of it's cached images.

Specified by:
widgetDisposed in interface org.eclipse.swt.events.DisposeListener

supportedSpecificationVersion

public int supportedSpecificationVersion()
Get the spec version that is supported.

Specified by:
supportedSpecificationVersion in interface BrowserComponent
Returns:
a number representing the spec major version

getCanvas

public java.lang.Object getCanvas()
Get the SWT component holding this browser.

Specified by:
getCanvas in interface BrowserComponent
Returns:
The component

getRendererType

public int getRendererType()
Get the renderer type.

Specified by:
getRendererType in interface BrowserComponent
Returns:
The BrowserCore type

getBrowserCore

public BrowserCore getBrowserCore()
Get the core browser implementation.

Specified by:
getBrowserCore in interface BrowserComponent
Returns:
the BrowserCore

getErrorReporter

public ErrorReporter getErrorReporter()
Fetch the error handler so that application code can post messages too.

Specified by:
getErrorReporter in interface BrowserComponent
Returns:
The current error handler instance

setMinimumFrameInterval

public void setMinimumFrameInterval(int millis,
                                    boolean userSet)
Set the minimum frame interval time to limit the CPU resources taken up by the 3D renderer. By default it will use all of them. The second parameter is used to control whether this is a user-set hard minimum or something set by the browser internals. User set values are always treated as the minimum unless the browser internals set a value that is a slower framerate than the user set. If the browser then sets a faster framerate than the user set value, the user value is used instead.

Specified by:
setMinimumFrameInterval in interface BrowserComponent
Parameters:
millis - The minimum time in milleseconds.
userSet - true if this is an end-user set minimum

start

public void start()
Called to instruct the component instance to start rendering now.

Specified by:
start in interface BrowserComponent

stop

public void stop()
Called to instruct the component instance to stop and suspend its state. The renderer should stop at this point.

Specified by:
stop in interface BrowserComponent

destroy

public void destroy()
Called to instruct the component instance to destroy itself and any used resources. It will not be used again.

Specified by:
destroy in interface BrowserComponent

browserShutdown

public void browserShutdown()
Ignored. Notification that the browser is shutting down the current content.

Specified by:
browserShutdown in interface BrowserCoreListener

browserDisposed

public void browserDisposed()
The browser has been disposed by the user calling the dispose method on the ExternalBrowser instance. Release our reference to the browser core so that when this control is disposed, we don't bother with releasing browser resources.

Specified by:
browserDisposed in interface BrowserCoreListener

urlLoadFailed

public void urlLoadFailed(java.lang.String msg)
Ignored. The browser tried to load a URL and failed.

Specified by:
urlLoadFailed in interface BrowserCoreListener
Parameters:
msg - An error message to go with the failure

browserInitialized

public void browserInitialized(VRMLScene scene)
Ignored. Notification that a world has been loaded into the browser.

Specified by:
browserInitialized in interface BrowserCoreListener
Parameters:
scene - The new scene that has been loaded

partActivated

public void partActivated(org.eclipse.ui.IWorkbenchPartReference partRef)
Ignored. Notification that the referenced part has been activated.

Specified by:
partActivated in interface org.eclipse.ui.IPartListener2
Parameters:
partRef - Reference object for the part that was activated.

partBroughtToTop

public void partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference partRef)
Ignored. Notification that the referenced part was brought to the top.

Specified by:
partBroughtToTop in interface org.eclipse.ui.IPartListener2
Parameters:
partRef - Reference object for the part that was brought to the top.

partClosed

public void partClosed(org.eclipse.ui.IWorkbenchPartReference partRef)
Ignored. Notification that the referenced part was closed.

Specified by:
partClosed in interface org.eclipse.ui.IPartListener2
Parameters:
partRef - Reference object for the part that was closed.

partDeactivated

public void partDeactivated(org.eclipse.ui.IWorkbenchPartReference partRef)
Ignored. Notification that the referenced part was deactivated.

Specified by:
partDeactivated in interface org.eclipse.ui.IPartListener2
Parameters:
partRef - Reference object for the part that was deactivated.

partHidden

public void partHidden(org.eclipse.ui.IWorkbenchPartReference partRef)
Notification that the referenced part was hidden. Used to throttle CPU usage while the browser is not visible on screen.

Specified by:
partHidden in interface org.eclipse.ui.IPartListener2
Parameters:
partRef - Reference object for the part that was hidden.

partInputChanged

public void partInputChanged(org.eclipse.ui.IWorkbenchPartReference partRef)
Ignored. Notification that the referenced part was hidden.

Specified by:
partInputChanged in interface org.eclipse.ui.IPartListener2
Parameters:
partRef - Reference object for the part that was hidden.

partOpened

public void partOpened(org.eclipse.ui.IWorkbenchPartReference partRef)
Ignored. Notification that the referenced part was hidden.

Specified by:
partOpened in interface org.eclipse.ui.IPartListener2
Parameters:
partRef - Reference object for the part that was hidden.

partVisible

public void partVisible(org.eclipse.ui.IWorkbenchPartReference partRef)
Notification that the referenced part was made visible. Used to establish rendering and event model CPU related parameters.

Specified by:
partVisible in interface org.eclipse.ui.IPartListener2
Parameters:
partRef - Reference object for the part that was made visible.

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium