View Javadoc

1   package org.ximtec.igesture.io;
2   
3   /**
4    * This interface defines all methods for devices, that can be managed by the device manager, must implement.
5    * @author Bjorn Puype, bpuype@gmail.com
6    *
7    */
8   public interface Device {
9   	
10  		// device identifier
11  	   /**
12  	    * Get the unique identifier of the device. (e.g. MAC address)
13  	    */
14  		String getDeviceID();
15  		/**
16  		 * Set the unique identifier of the device. (e.g. MAC address)
17  		 * @param id
18  		 */
19  		void setDeviceID(String id);
20  		/**
21  		 * If the device can be uniquely identified by for example a MAC address, this function returns true else false.
22  		 * @return
23  		 */
24  //		boolean hasUniqueDeviceID();
25  		
26  		// display name
27  		/**
28  		 * Get the display name for the device.
29  		 */
30  		String getName();
31  		/**
32  		 * Set the display name for the device.
33  		 * @param name
34  		 */
35  		void setName(String name);
36  		
37  		//allow management of the connection with the device
38  		/**
39  		 * Disconnect the device.
40  		 */
41  		void disconnect();
42  		/**
43  		 * Connect the device.
44  		 */
45  		void connect();
46  		/**
47  		 * Check whether the device can be connected by the user or is automatically connected.
48  		 * @return
49  		 */
50  		boolean isConnectable();//TODO remove
51  		/**
52  		 * Check whether the device can be disconnected by the user.
53  		 * @return
54  		 */
55  		boolean isDisconnectable();//TODO remove
56  		/**
57  		 * Check whether the device is connected or not.
58  		 * @return	True if connected, else false.
59  		 */
60  		boolean isConnected();
61  		/**
62  		 * Change the connection status of the device.
63  		 * @param isConnected	The new connection status.
64  		 */
65  		void setIsConnected(boolean isConnected);
66  		
67  		//type of the device, e.g. 2D, 3D
68  		/**
69  		 * Get the type of the device. (E.g. 2D or 3D, voice)
70  		 */
71  		int getDeviceType();
72  		/**
73  		 * Set the type of the device. (E.g. 2D or 3D, voice)
74  		 * @param deviceType
75  		 */
76  		void setDeviceType(int deviceType);
77  		
78  		//type of the connection, e.g. USB, BlueTooth
79  		/**
80  		 * Get the connection type of the device. (E.g. USB, BlueTooth)
81  		 */
82  		int getConnectionType();
83  		/**
84  		 * Set the connection type of the device. (E.g. USB, BlueTooth)
85  		 * @param connectionType
86  		 */
87  		void setConnectionType(int connectionType);
88  		
89  		/**
90  		 * Check whether the device is the default device.
91  		 * @return
92  		 */
93  		boolean isDefaultDevice();
94  		/**
95  		 * Set the default device status of the device.
96  		 * @param isDefault
97  		 */
98  		void setDefaultDevice(boolean isDefault);	
99  		
100 		
101 		String toString();
102 
103 		/**
104 		 * Get the device type (E.g. SwingMouseReader, WiiReader, ...)
105 		 * @return the device type.
106 		 */
107 		String getDeviceClass();
108 }