Package xj3d.browser
Class Xj3DBrowser
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
xj3d.browser.Xj3DBrowser
- All Implemented Interfaces:
KeyListener
,ImageObserver
,MenuContainer
,Serializable
,Runnable
,EventListener
,Accessible
,RootPaneContainer
,WindowConstants
,BrowserCoreListener
,SensorStatusListener
,SurfaceManager
public class Xj3DBrowser
extends JFrame
implements SurfaceManager, SensorStatusListener, KeyListener, BrowserCoreListener, Runnable
A standalone X3D/VRML browser application.
- Version:
- $Revision: 1.110 $
- Author:
- Alan Hudson, Justin Couch
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface org.web3d.browser.SensorStatusListener
TYPE_ANCHOR, TYPE_DRAG_SENSOR, TYPE_TOUCH_SENSOR
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Override addNotify so we know we have peer before calling setEnabled for Aviatrix3D.void
The browser has been disposed, all resources may be freed.void
browserInitialized
(VRMLScene scene) The browser has been initialised with new content.void
The browser has been shut down and the previous content is no longer valid.void
createScriptEngine
(String name, OGLStandardBrowserCore universe, ViewpointManager vpManager, RouteManager routeManager, FrameStateManager stateManager, WorldLoaderManager worldLoader) Create a script engine.void
deviceActivated
(int type) Invoked when a tracker activates the sensor.void
deviceNotOver
(int type) Invoked when a tracker leaves contact with a sensor.void
deviceOver
(int type, String desc) Invoked when a sensor/anchor is in contact with a tracker capable of picking.com.jogamp.opengl.GLCapabilities
Get the current capability bits.void
void
void
void
linkActivated
(String[] urls, String[] params, String desc) Invoked when a tracker selects an object that represents a link to an external source.void
Load content on the browser.static void
Create an instance of this class and run it.protected void
void
Redirect system messages to the console.void
Reset the surface using the current capability bits.void
run()
Run method for the shutdown hook.void
protected void
setupProperties
(BrowserCore core, WorldLoaderManager loader) Set up the system properties needed to run the browser.void
urlLoadFailed
(String msg) The tried to load a URL and failed.Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Frame
getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setUndecorated
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
DEFAULT_TITLE
- See Also:
-
-
Constructor Details
-
Xj3DBrowser
public Xj3DBrowser()Create an instance of the demo class.
-
-
Method Details
-
resetSurface
public void resetSurface()Description copied from interface:SurfaceManager
Reset the surface using the current capability bits.- Specified by:
resetSurface
in interfaceSurfaceManager
-
getCapabilities
public com.jogamp.opengl.GLCapabilities getCapabilities()Description copied from interface:SurfaceManager
Get the current capability bits.- Specified by:
getCapabilities
in interfaceSurfaceManager
- Returns:
- the current capability bits
-
run
-
keyPressed
- Specified by:
keyPressed
in interfaceKeyListener
-
keyReleased
- Specified by:
keyReleased
in interfaceKeyListener
-
keyTyped
- Specified by:
keyTyped
in interfaceKeyListener
-
processWindowEvent
- Overrides:
processWindowEvent
in classJFrame
-
setTitle
-
deviceOver
Description copied from interface:SensorStatusListener
Invoked when a sensor/anchor is in contact with a tracker capable of picking.- Specified by:
deviceOver
in interfaceSensorStatusListener
- Parameters:
type
- The sensor typedesc
- The sensor's description string
-
deviceNotOver
public void deviceNotOver(int type) Description copied from interface:SensorStatusListener
Invoked when a tracker leaves contact with a sensor.- Specified by:
deviceNotOver
in interfaceSensorStatusListener
- Parameters:
type
- The sensor type
-
deviceActivated
public void deviceActivated(int type) Description copied from interface:SensorStatusListener
Invoked when a tracker activates the sensor. Anchors will not receive this event, they get a linkActivated call.- Specified by:
deviceActivated
in interfaceSensorStatusListener
- Parameters:
type
- The sensor type
-
linkActivated
Description copied from interface:SensorStatusListener
Invoked when a tracker selects an object that represents a link to an external source.- Specified by:
linkActivated
in interfaceSensorStatusListener
- Parameters:
urls
- The urls to load in the order of preference defined by the nodeparams
- The list of parameters provided with the node. Null if none.desc
- The description that may be accompanying the link node
-
browserInitialized
Description copied from interface:BrowserCoreListener
The browser has been initialised with new content. The content given is found in the accompanying scene and description.- Specified by:
browserInitialized
in interfaceBrowserCoreListener
- Parameters:
scene
- The scene of the new content
-
urlLoadFailed
Description copied from interface:BrowserCoreListener
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 interfaceBrowserCoreListener
- Parameters:
msg
- An error message to go with the failure
-
browserShutdown
public void browserShutdown()Description copied from interface:BrowserCoreListener
The browser has been shut down and the previous content is no longer valid.- Specified by:
browserShutdown
in interfaceBrowserCoreListener
-
browserDisposed
public void browserDisposed()Description copied from interface:BrowserCoreListener
The browser has been disposed, all resources may be freed.- Specified by:
browserDisposed
in interfaceBrowserCoreListener
-
loadURL
Load content on the browser. This is only called if a file is provided on the command-line. Otherwise the location toolbar handles it.- Parameters:
url
- The url to load
-
redirectSystemMessages
public void redirectSystemMessages()Redirect system messages to the console. -
setupProperties
Set up the system properties needed to run the browser. This involves registering all the properties needed for content and protocol handlers used by the URI system. Only needs to be run once at startup.- Parameters:
core
- The core representation of the browserloader
- Loader manager for doing async calls
-
createScriptEngine
public void createScriptEngine(String name, OGLStandardBrowserCore universe, ViewpointManager vpManager, RouteManager routeManager, FrameStateManager stateManager, WorldLoaderManager worldLoader) Create a script engine. Use Class.forName to avoid direct linking. Will issue a warning to the console if it fails.- Parameters:
name
- The script engine to createuniverse
- The universe to usevpManager
- The Viewpoint manager to userouteManager
- The route manager to usestateManager
- The state manager to useworldLoader
- The loader manager to use
-
addNotify
-
main
Create an instance of this class and run it. The single argument, if supplied is the name of the file to load initially. If not supplied it will start with a blank document.- Parameters:
args
- The list of arguments for this application.
-