|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.xj3d.ui.awt.widgets.SwingViewpointToolbar
public class SwingViewpointToolbar
A toolbar for all viewpoint manipulation commands that offers convenient and common code.
Creating an instance of this class will automatically register it as viewpoint and navigation state listeners with the browser core. The end user is not required to do this.
External Resources
This toolbar uses images for the button icons rather than text. These are the images used. The path is found relative to the classpath.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface org.web3d.browser.NavigationStateListener |
|---|
EXAMINE_STATE, FLY_STATE, NO_STATE, PAN_STATE, TILT_STATE, WALK_STATE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SwingViewpointToolbar(BrowserCore core,
ViewpointManager vpMgr,
ErrorReporter reporter)
Create a new horizontal viewpoint toolbar with an empty list of viewpoints. |
|
SwingViewpointToolbar(BrowserCore core,
ViewpointManager vpMgr,
java.util.Properties skinProperties,
ErrorReporter reporter)
Create a new horizontal viewpoint toolbar with an empty list of viewpoints, but with non-default appearance. |
|
| Method Summary | |
|---|---|
void |
clearViewpoints()
Clear the viewpoint list and disable self |
javax.swing.AbstractAction |
getFitWorldAction()
Get the FitWorld Action. |
javax.swing.AbstractAction |
getHomeViewpointAction()
Get the Home Viewpoint Action. |
javax.swing.AbstractAction |
getLookatAction()
Get the Lookat Action. |
javax.swing.AbstractAction |
getNextViewpointAction()
Get the Next Viewpoint Action. |
javax.swing.AbstractAction |
getPreviousViewpointAction()
Get the Previous Viewpoint Action. |
void |
itemStateChanged(java.awt.event.ItemEvent evt)
Listen for item changing events in the comboBox selection |
void |
navigationListChanged(java.lang.String[] modes,
int numModes)
Notification that the list of valid navigation modes has changed. |
void |
navigationStateChanged(int idx)
Notification that the navigation state has changed to the new state. |
void |
setEnabled(boolean enabled)
Set the panel enabled or disabled. |
void |
viewpointAdded(VRMLViewpointNodeType node,
int layerId,
boolean isDefault)
Invoked when a viewpoint has been added |
void |
viewpointBound(VRMLViewpointNodeType node,
int layerId)
Invoked when a viewpoint has been bound. |
void |
viewpointLayerActive(int layerId)
The given layer is now made the active layer. |
void |
viewpointLayerAdded(int layerId)
Notification of the addition of a valid layer ID to the current list. |
void |
viewpointLayerRemoved(int layerId)
Notification that a Layer ID is no longer valid. |
void |
viewpointRemoved(VRMLViewpointNodeType node,
int layerId)
Invoked when a viewpoint has been removed |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods 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, transferFocusBackward, 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SwingViewpointToolbar(BrowserCore core,
ViewpointManager vpMgr,
ErrorReporter reporter)
core - The browser corevpMgr - The manager of viewpoint changesreporter - The reporter instance to use or null
public SwingViewpointToolbar(BrowserCore core,
ViewpointManager vpMgr,
java.util.Properties skinProperties,
ErrorReporter reporter)
core - The browser corevpMgr - The manager of viewpoint changesskinProperties - Properties object specifying image namesreporter - The reporter instance to use or null| Method Detail |
|---|
public void navigationStateChanged(int idx)
navigationStateChanged in interface NavigationStateListeneridx - The new state expressed as an index into the current navModes list.
public void navigationListChanged(java.lang.String[] modes,
int numModes)
navigationListChanged in interface NavigationStateListenermodes - The new modesnumModes - The number of modes in the listpublic void itemStateChanged(java.awt.event.ItemEvent evt)
itemStateChanged in interface java.awt.event.ItemListenerevt - The event that caused this method to be calledpublic void setEnabled(boolean enabled)
setEnabled in class javax.swing.JComponentenabled - true if this component is enabledpublic void viewpointLayerAdded(int layerId)
viewpointAdded(org.web3d.vrml.nodes.VRMLViewpointNodeType, int, boolean) will subsequently follow with all the viewpoints
listed in this layer. It can be assumed that the layer is not currently
the active layer. A separate notificaion is available for that.
viewpointLayerAdded in interface ViewpointStatusListenerlayerId - The ID of the layer to be addedpublic void viewpointLayerRemoved(int layerId)
viewpointLayerRemoved in interface ViewpointStatusListenerlayerId - The ID of the layer to be addedpublic void viewpointLayerActive(int layerId)
The code will guarantee that if the active layer is removed, then this method will be called first to set a different valid layer, before removing that layer ID.
If a value of -1 is provided, that means no layers are active and that we currently have a completely clear browser with no world loaded. The UI should act appropriately.
viewpointLayerActive in interface ViewpointStatusListenerlayerId - The ID of the layer to be made current or -1
public void viewpointAdded(VRMLViewpointNodeType node,
int layerId,
boolean isDefault)
viewpointAdded in interface ViewpointStatusListenernode - The viewpointlayerId - The ID of the layer the viewpoint is added toisDefault - Is the node a default
public void viewpointRemoved(VRMLViewpointNodeType node,
int layerId)
viewpointRemoved in interface ViewpointStatusListenernode - The viewpointlayerId - The ID of the layer the viewpoint is removed from
public void viewpointBound(VRMLViewpointNodeType node,
int layerId)
viewpointBound in interface ViewpointStatusListenernode - The viewpointlayerId - The ID of the layer the viewpoint is bound onpublic javax.swing.AbstractAction getNextViewpointAction()
public javax.swing.AbstractAction getPreviousViewpointAction()
public javax.swing.AbstractAction getHomeViewpointAction()
public javax.swing.AbstractAction getLookatAction()
public javax.swing.AbstractAction getFitWorldAction()
public void clearViewpoints()
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||