Java 3D Desktop Environment旨在使用Java 3D来创建一个3D桌面环境。功能包括:分布式的应用程序

源代码在线查看: inputdevices.java

软件大小: 1221 K
上传用户: lilacky
关键词: Java Environment Desktop 3D
下载地址: 免注册下载 普通下载 VIP

相关代码

				package org.j3de.input;
				
				import java.util.List;
				import java.util.Vector;				
				import javax.media.j3d.InputDevice;
				import javax.media.j3d.Sensor;				
				public class InputDevices {  
				  private VirtualInputDevice[] vdevices;
				  private Vector sensors; 				  private int userHead;
				  private int dominantHand;
				  private int nonDominantHand;
				  private int movementDevice;
				  
				  public InputDevices(List              devices, 
				                      ActivationManager activationManager,
				                      int userHead,
				                      int dominantHand,
				                      int nonDominantHand,
				                      int movementDevice) {  
				    
				    this.vdevices = new VirtualInputDevice[devices.size()];    
				    this.sensors  = new Vector();				     
				    for (int i=0; i				      vdevices[i] = new VirtualInputDevice((InputDevice)devices.get(i), activationManager);
				      for (int j=0; j				        sensors.add(vdevices[i].getSensor(j)); 
				    }                     
				    
				    this.userHead = userHead;
				    this.dominantHand = dominantHand;
				    this.nonDominantHand = nonDominantHand;
				    this.movementDevice = movementDevice;
				  } 
				  
				  public int getDeviceCount() {
				    return vdevices.length;
				  }        
				  
				  public int getSensorCount() {
				    return sensors.size();
				  }				  				  public Sensor getSensor(int i) {				    return (Sensor)sensors.get(i);				  }                
				  
				  public InputDevice getDevice(int index) {
				    return vdevices[index];
				  }  
				  
				  public int getUserHead() {
				    return userHead;
				  }
				  
				  public int getDominantHand() {
				    return dominantHand;
				  }
				
				  public int getNonDominantHand() {
				    return nonDominantHand;
				  }
				
				  public int getMovementSensor() {
				    return movementDevice;
				  }  
				} 			

相关资源