|
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.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.xj3d.ui.swt.widgets.ViewpointToolbar
public class ViewpointToolbar
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.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.swt.widgets.Control |
|---|
handle |
| Fields inherited from interface org.web3d.browser.NavigationStateListener |
|---|
EXAMINE_STATE, FLY_STATE, NO_STATE, PAN_STATE, TILT_STATE, WALK_STATE |
| Constructor Summary | |
|---|---|
ViewpointToolbar(org.eclipse.swt.widgets.Composite parent,
BrowserCore core,
ViewpointManager vpMgr,
ErrorReporter reporter)
Create a new horizontal viewpoint toolbar with an empty list of viewpoints. |
|
ViewpointToolbar(org.eclipse.swt.widgets.Composite parent,
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 |
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 |
run()
Process the enabling and disabling of the widgets on the display thread. |
void |
setEnabled(boolean enabled)
Set the composite enabled or disabled. |
void |
setLayout(org.eclipse.swt.widgets.Layout layout)
Do nothing, we do our own layout |
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 |
void |
widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent se)
Process the default selection generated from the user interface. |
void |
widgetSelected(org.eclipse.swt.events.SelectionEvent se)
Process the selection generated from the user interface. |
| 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, 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 |
|---|
public ViewpointToolbar(org.eclipse.swt.widgets.Composite parent,
BrowserCore core,
ViewpointManager vpMgr,
ErrorReporter reporter)
parent - the SWT Composite widget that this will be added tocore - The browser corevpMgr - The manager of viewpoint changesreporter - The reporter instance to use or null
public ViewpointToolbar(org.eclipse.swt.widgets.Composite parent,
BrowserCore core,
ViewpointManager vpMgr,
java.util.Properties skinProperties,
ErrorReporter reporter)
parent - - The SWT Composite widget that this will be added tocore - - The browser corevpMgr - - The manager of viewpoint changesskinProperties - - The properties object specifying image namesreporter - - The reporter instance to use or null| Method Detail |
|---|
public void setLayout(org.eclipse.swt.widgets.Layout layout)
setLayout in class org.eclipse.swt.widgets.Compositepublic void setEnabled(boolean enabled)
setEnabled in class org.eclipse.swt.widgets.Controlenabled - true if this composite is enabledpublic 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 widgetSelected(org.eclipse.swt.events.SelectionEvent se)
widgetSelected in interface org.eclipse.swt.events.SelectionListenerse - The event that caused this method to be calledpublic void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent se)
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListenerse - - The event that caused this method to be calledpublic 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 void run()
run in interface java.lang.Runnablepublic 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 | |||||||||