View Javadoc

1   /**
2    * 
3    */
4   package org.ximtec.igesture.io;
5   
6   import java.util.List;
7   
8   import org.ximtec.igesture.core.Gesture;
9   
10  /**
11   * @author Bjorn Puype, bpuype@gmail.com
12   *
13   */
14  public interface Gesture3DDevice<E, F> {
15  
16  	   /**
17  	    * Initializes the device. After executing this method, gestures can be
18  	    * captured.
19  	    */
20  	   void init();
21  
22  
23  	   /**
24  	    * Disposes the device. After executing this method, gestures are not captured
25  	    * anymore and all dependent resources are released.
26  	    */
27  	   void dispose();
28  
29  
30  	   /**
31  	    * Returns the gestures. This method should block, if no gesture is available. 
32  	    * @return the gesture. 
33  	    */
34  	   Gesture<E> getGesture3D();
35  
36  
37  	   /**
38  	    * Deletes the current gesture. 
39  	    */
40  	   void clear();
41  
42  
43  	   /**
44  	    * Returns chunks of a gesture while drawing it. 
45  	    * @return chunks of a gesture. 
46  	    */
47  	   List<F> getChunks3D();
48  
49  
50  	   /**
51  	    * Add a gesture handler
52  	    * @param listener
53  	    */
54  	   void addGestureHandler(GestureEventListener listener);
55  
56  
57  	   /**
58  	    * Remove a gesture handler
59  	    * @param listener
60  	    */
61  	   void removeGestureHandler(GestureEventListener listener);
62  
63  	   
64  	   
65  	    // device identifier
66  	   /**
67  	    * Get the unique identifier of the device. (e.g. MAC address)
68  	    */
69  		String getDeviceID();
70  		/**
71  		 * Set the unique identifier of the device. (e.g. MAC address)
72  		 * @param id
73  		 */
74  		void setDeviceID(String id);
75  		/**
76  		 * If the device can be uniquely identified by for example a MAC address, this function returns true else false.
77  		 * @return
78  		 */
79  //		boolean hasUniqueDeviceID();
80  		
81  		// display name
82  		/**
83  		 * Get the display name for the device.
84  		 */
85  		String getName();
86  		/**
87  		 * Set the display name for the device.
88  		 * @param name
89  		 */
90  		void setName(String name);
91  		
92  		//allow management of the connection with the device
93  		/**
94  		 * Disconnect the device.
95  		 */
96  		void disconnect();
97  		/**
98  		 * Connect the device.
99  		 */
100 		void connect();
101 		/**
102 		 * Check whether the device can be connected by the user or is automatically connected.
103 		 * @return
104 		 */
105 		boolean isConnectable();
106 		/**
107 		 * Check whether the device can be disconnected by the user.
108 		 * @return
109 		 */
110 		boolean isDisconnectable();
111 		/**
112 		 * Check whether the device is connected or not.
113 		 * @return	True if connected, else false.
114 		 */
115 		boolean isConnected();
116 		/**
117 		 * Change the connection status of the device.
118 		 * @param isConnected	The new connection status.
119 		 */
120 		void setIsConnected(boolean isConnected);
121 		
122 		//type of the device, e.g. 2D, 3D
123 		/**
124 		 * Get the device type of the device. (E.g. 2D or 3D)
125 		 */
126 		int getDeviceType();
127 		/**
128 		 * Set the device type of the device. (E.g. 2D or 3D)
129 		 * @param deviceType
130 		 */
131 		void setDeviceType(int deviceType);
132 		
133 		//type of the connection, e.g. USB, BlueTooth
134 		/**
135 		 * Get the connection type of the device. (E.g. USB, BlueTooth)
136 		 */
137 		int getConnectionType();
138 		/**
139 		 * Set the connection type of the device. (E.g. USB, BlueTooth)
140 		 * @param connectionType
141 		 */
142 		void setConnectionType(int connectionType);
143 		
144 		/**
145 		 * Check whether the device is a default device.
146 		 * @return
147 		 */
148 		boolean isDefaultDevice();
149 		/**
150 		 * Set the default device status of the device.
151 		 * @param isDefault
152 		 */
153 		void setDefaultDevice(boolean isDefault);	
154 		
155 		String toString();
156 
157 }