Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.swt.widgets
Class LocationToolbar

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.xj3d.ui.swt.widgets.LocationToolbar
All Implemented Interfaces:
java.lang.Runnable, org.eclipse.swt.graphics.Drawable, BrowserCoreListener, FileHandler

public class LocationToolbar
extends org.eclipse.swt.widgets.Composite
implements FileHandler, BrowserCoreListener, java.lang.Runnable

An swt widget that implements the capabilities of the URL/Location toolbar.

Version:
$Revision: 1.2 $
Author:
Justin Couch, Rex Melton

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
LocationToolbar(org.eclipse.swt.widgets.Composite parent, BrowserCore core, WorldLoaderManager wlm, boolean urlReadOnly, boolean showOpenButton, boolean showReloadButton, java.lang.String contentDir, ErrorReporter reporter)
          Create an instance of the panel configured to show or hide the controls as described.
LocationToolbar(org.eclipse.swt.widgets.Composite parent, BrowserCore core, WorldLoaderManager wlm, boolean urlReadOnly, boolean showOpenButton, boolean showReloadButton, java.lang.String contentDir, java.util.Properties skinProperties, ErrorReporter reporter)
          Create an instance of the panel configured to show or hide the controls as described.
 
Method Summary
 void browserDisposed()
          The browser has been disposed.
 void browserInitialized(VRMLScene scene)
          The browser has been initialised with new content.
 void browserShutdown()
          The browser has been shut down and the previous content is no longer valid.
 ErrorReporter getErrorReporter()
          Fetch the error handler so that application code can post messages too.
 void loadURL(InputSource src)
          Change the panels content to the provided URL.
 void loadURL(java.lang.String url)
          Change the panels content to the provided URL.
 void run()
          Update the text widget on the display thread.
 void setLayout(org.eclipse.swt.widgets.Layout layout)
          Do nothing, we do our own layout
 void setProgressListener(org.ietf.uri.event.ProgressListener listener)
          Set a progress listener for download progress.
 void setThrottle(FramerateThrottle throttle)
          Set a Frame throttler.
 void urlLoadFailed(java.lang.String msg)
          The tried to load a URL and failed.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocationToolbar

public LocationToolbar(org.eclipse.swt.widgets.Composite parent,
                       BrowserCore core,
                       WorldLoaderManager wlm,
                       boolean urlReadOnly,
                       boolean showOpenButton,
                       boolean showReloadButton,
                       java.lang.String contentDir,
                       ErrorReporter reporter)
Create an instance of the panel configured to show or hide the controls as described.

Parameters:
parent - - The SWT Composite widget that this will be added to
wlm - - The world loader manager.
core - - The browser core implementation to send scene loads to
urlReadOnly - - true to make the location bar read only
showOpenButton - - true to put an open button with the URL location bar
showReloadButton - - true to put a reload button with the URL location bar
contentDir - - The initial directory to load content from. Must be a full path.
reporter - - The reporter instance to use or null

LocationToolbar

public LocationToolbar(org.eclipse.swt.widgets.Composite parent,
                       BrowserCore core,
                       WorldLoaderManager wlm,
                       boolean urlReadOnly,
                       boolean showOpenButton,
                       boolean showReloadButton,
                       java.lang.String contentDir,
                       java.util.Properties skinProperties,
                       ErrorReporter reporter)
Create an instance of the panel configured to show or hide the controls as described.

Parameters:
parent - - The SWT Composite widget that this will be added to
wlm - - The world loader manager.
core - - The browser core implementation to send scene loads to
urlReadOnly - - true to make the location bar read only
showOpenButton - - true to put an open button with the URL location bar
showReloadButton - - true to put a reload button with the URL location bar
contentDir - - T initial directory to load content from. Must be a full path.
reporter - - The reporter instance to use or null
skinProperties - - Customization of the browser buttons etc
Method Detail

setLayout

public void setLayout(org.eclipse.swt.widgets.Layout layout)
Do nothing, we do our own layout

Overrides:
setLayout in class org.eclipse.swt.widgets.Composite

run

public void run()
Update the text widget on the display thread.

Specified by:
run in interface java.lang.Runnable

browserInitialized

public void browserInitialized(VRMLScene scene)
The browser has been initialised with new content. The content given is found in the accompanying scene and description.

Specified by:
browserInitialized in interface BrowserCoreListener
Parameters:
scene - The scene of the new content

urlLoadFailed

public void urlLoadFailed(java.lang.String msg)
The tried to load a URL and failed. It is typically because none of the URLs resolved to anything valid or there were network failures.

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

browserShutdown

public void browserShutdown()
The browser has been shut down and the previous content is no longer valid.

Specified by:
browserShutdown in interface BrowserCoreListener

browserDisposed

public void browserDisposed()
The browser has been disposed.

Specified by:
browserDisposed in interface BrowserCoreListener

getErrorReporter

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

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

loadURL

public void loadURL(java.lang.String url)
             throws java.io.IOException
Change the panels content to the provided URL.

Specified by:
loadURL in interface FileHandler
Parameters:
url - The URL to load.
Throws:
java.io.IOException - On a failed load or badly formatted URL

loadURL

public void loadURL(InputSource src)
             throws java.io.IOException
Change the panels content to the provided URL.

Parameters:
src - The source representation to load
Throws:
java.io.IOException - On a failed load or badly formatted URL

setProgressListener

public void setProgressListener(org.ietf.uri.event.ProgressListener listener)
Set a progress listener for download progress. Null will clear.

Parameters:
listener - The progress listener.

setThrottle

public void setThrottle(FramerateThrottle throttle)
Set a Frame throttler. Null is ok.


Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium