Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.swt.widgets
Class ViewpointComboManager

java.lang.Object
  extended by org.xj3d.ui.swt.widgets.ViewpointComboManager
All Implemented Interfaces:
java.lang.Runnable

public class ViewpointComboManager
extends java.lang.Object
implements java.lang.Runnable

A convenience class for managing the interactions with a Combo object on the managing display thread. This class acts as an object model intermediary between VRMLViewpointNodeTypes that are utilized by the browser and the String objects that are displayed within the Combo.

Version:
$Revision: 1.2 $
Author:
Rex Melton

Constructor Summary
ViewpointComboManager(org.eclipse.swt.widgets.Display display, org.eclipse.swt.widgets.Combo combo)
          Constructor
 
Method Summary
 void add(VRMLViewpointNodeType node)
          Add the specified node to the combo.
 void clear()
          Clear the combo of all items
 VRMLViewpointNodeType getNode(int index)
          Return the node associated with the combo at the specified index.
 void remove(VRMLViewpointNodeType node)
          Remove the specified node from the combo.
 void run()
          Method for the display thread to perform the necessary updates to the combo.
 void select(VRMLViewpointNodeType node)
          Select the specified node in the the combo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewpointComboManager

public ViewpointComboManager(org.eclipse.swt.widgets.Display display,
                             org.eclipse.swt.widgets.Combo combo)
Constructor

Parameters:
display - - The Display ancestor of the combo argument
combo - - The Combo object to handle interactions for.
Method Detail

run

public void run()
Method for the display thread to perform the necessary updates to the combo.

Specified by:
run in interface java.lang.Runnable

clear

public void clear()
Clear the combo of all items


add

public void add(VRMLViewpointNodeType node)
Add the specified node to the combo. If the node is null, no action will be performed.

Parameters:
node - - The node to add to the combo.

remove

public void remove(VRMLViewpointNodeType node)
Remove the specified node from the combo. If the node does not exist in association with the combo, no action is performed.

Parameters:
node - - The node to remove from the combo

select

public void select(VRMLViewpointNodeType node)
Select the specified node in the the combo. If the node is null or does not exist in association with the combo no action is performed.

Parameters:
node - - The node to select in the combo

getNode

public VRMLViewpointNodeType getNode(int index)
Return the node associated with the combo at the specified index. If the index is out of bounds, null will be returned.

Parameters:
index - - The index of the node in the combo to return
Returns:
The node, or null if the specified index was invalid.

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium