Package org.xj3d.ui.awt.browser.ogl
Class BrowserJPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.xj3d.ui.awt.browser.ogl.BrowserJPanel
- All Implemented Interfaces:
ComponentListener,KeyListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,BrowserComponent,BrowserCoreListener
- Direct Known Subclasses:
VRMLBrowserJPanel,X3DBrowserJPanel
public abstract class BrowserJPanel
extends JPanel
implements BrowserComponent, BrowserCoreListener, ComponentListener, WindowListener, KeyListener
Common Swing JPanel implementation of the browser component for use in
either SAI or EAI, that wraps the functionality of a VRML browser
into a convenient, easy to use form.
This base class needs to be extended to provide the SAI or EAI-specific implementation interfaces, as well as any startup required for both of those environments, such as scripting engines etc.
- Version:
- $Revision: 1.30 $
- Author:
- Justin Couch, Brad Vender
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SwingConsoleWindowArea to push error messages toprotected CursorManagerThe cursorManagerprotected SwingLocationToolbarThe toolbar holding location informationprotected OGLBrowserCanvasThe canvas used to display the worldprotected SwingNavigationToolbarThe toolbar holding navigation informationprotected SwingStatusBarThe status barprotected org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDeviceOur drawing surfaceprotected OGLStandardBrowserCoreThe internal universeFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBrowserJPanel(BrowserConfig parameters) Create an instance of the panel configured to show or hide the controls and only shows VRML97 content. -
Method Summary
Modifier and TypeMethodDescriptionvoidThis panel, or a container in which it 'lives' is being added to a parent.voidThe browser has been disposed by the user calling the dispose method on the ExternalBrowser instance.voidbrowserInitialized(VRMLScene scene) Ignored.voidIgnored.voidvoidvoidvoidvoiddestroy()Called to instruct the component instance to destroy itself and any used resources.Get the core browser implementation.Get the UI toolkit specific component holding this browser.org.j3d.util.ErrorReporterFetch the error handler so that application code can post messages too.intGet the renderer type.voidvoidvoidvoidThis panel, or a container in which it 'lives' is being removed from it's parent.voidsetMinimumFrameInterval(int millis, boolean userSet) Set the minimum frame interval time to limit the CPU resources taken up by the 3D renderer.voidstart()Called to instruct the component instance to start rendering now.voidstop()Called to instruct the component instance to stop and suspend its state.intGet the spec version that is supported.voidurlLoadFailed(String msg) Ignored.voidvoidwindowClosed(WindowEvent evt) voidwindowClosing(WindowEvent evt) voidvoidvoidvoidwindowOpened(WindowEvent evt) Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
surface
protected org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice surfaceOur drawing surface -
locToolbar
The toolbar holding location information -
statusBar
The status bar -
console
Area to push error messages to -
mainCanvas
The canvas used to display the world -
cursorManager
The cursorManager -
universe
The internal universe
-
-
Constructor Details
-
BrowserJPanel
Create an instance of the panel configured to show or hide the controls and only shows VRML97 content.- Parameters:
parameters- The object containing the browser's configuration parameters
-
-
Method Details
-
removeNotify
public void removeNotify()This panel, or a container in which it 'lives' is being removed from it's parent. Inform the canvas to stop rendering before it's removeNotify() method is called, otherwise the ui will lockup.- Overrides:
removeNotifyin classJComponent
-
addNotify
public void addNotify()This panel, or a container in which it 'lives' is being added to a parent. Inform the canvas to start rendering. By default the canvas should be enabled initially. This method is in place to restart rendering in the instance that the component has been removed and is being reinserted into the ui.- Overrides:
addNotifyin classJComponent
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-
windowActivated
- Specified by:
windowActivatedin interfaceWindowListener
-
windowClosed
- Specified by:
windowClosedin interfaceWindowListener
-
windowClosing
- Specified by:
windowClosingin interfaceWindowListener
-
windowDeactivated
- Specified by:
windowDeactivatedin interfaceWindowListener
-
windowDeiconified
- Specified by:
windowDeiconifiedin interfaceWindowListener
-
windowIconified
- Specified by:
windowIconifiedin interfaceWindowListener
-
windowOpened
- Specified by:
windowOpenedin interfaceWindowListener
-
componentHidden
- Specified by:
componentHiddenin interfaceComponentListener
-
componentMoved
- Specified by:
componentMovedin interfaceComponentListener
-
componentResized
- Specified by:
componentResizedin interfaceComponentListener
-
componentShown
- Specified by:
componentShownin interfaceComponentListener
-
supportedSpecificationVersion
public int supportedSpecificationVersion()Description copied from interface:BrowserComponentGet the spec version that is supported.- Specified by:
supportedSpecificationVersionin interfaceBrowserComponent- Returns:
- a number representing the spec major version
-
getCanvas
Description copied from interface:BrowserComponentGet the UI toolkit specific component holding this browser.- Specified by:
getCanvasin interfaceBrowserComponent- Returns:
- The component
-
getRendererType
public int getRendererType()Description copied from interface:BrowserComponentGet the renderer type.- Specified by:
getRendererTypein interfaceBrowserComponent- Returns:
- The BrowserCore type
-
getBrowserCore
Description copied from interface:BrowserComponentGet the core browser implementation.- Specified by:
getBrowserCorein interfaceBrowserComponent- Returns:
- the BrowserCore
-
getErrorReporter
public org.j3d.util.ErrorReporter getErrorReporter()Description copied from interface:BrowserComponentFetch the error handler so that application code can post messages too.- Specified by:
getErrorReporterin interfaceBrowserComponent- Returns:
- The current error handler instance
-
setMinimumFrameInterval
public void setMinimumFrameInterval(int millis, boolean userSet) Description copied from interface:BrowserComponentSet 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:
setMinimumFrameIntervalin interfaceBrowserComponent- Parameters:
millis- The minimum time in milliseconds.userSet- true if this is an end-user set minimum
-
start
public void start()Description copied from interface:BrowserComponentCalled to instruct the component instance to start rendering now.- Specified by:
startin interfaceBrowserComponent
-
stop
public void stop()Description copied from interface:BrowserComponentCalled to instruct the component instance to stop and suspend its state. The renderer should stop at this point.- Specified by:
stopin interfaceBrowserComponent
-
destroy
public void destroy()Description copied from interface:BrowserComponentCalled to instruct the component instance to destroy itself and any used resources. It will not be used again.- Specified by:
destroyin interfaceBrowserComponent
-
browserShutdown
public void browserShutdown()Ignored. Notification that the browser is shutting down the current content.- Specified by:
browserShutdownin interfaceBrowserCoreListener
-
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.- Specified by:
browserDisposedin interfaceBrowserCoreListener
-
urlLoadFailed
Ignored. The browser tried to load a URL and failed.- Specified by:
urlLoadFailedin interfaceBrowserCoreListener- Parameters:
msg- An error message to go with the failure
-
browserInitialized
Ignored. Notification that a world has been loaded into the browser.- Specified by:
browserInitializedin interfaceBrowserCoreListener- Parameters:
scene- The new scene that has been loaded
-