diff --git a/WiiuseJ/.classpath b/WiiuseJ/.classpath
new file mode 100644
index 0000000..d171cd4
--- /dev/null
+++ b/WiiuseJ/.classpath
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/WiiuseJ/.project b/WiiuseJ/.project
new file mode 100644
index 0000000..e58d767
--- /dev/null
+++ b/WiiuseJ/.project
@@ -0,0 +1,17 @@
+
+
+ WiiUseJ
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/WiiuseJ/bin/tests/LedsTask.class b/WiiuseJ/bin/tests/LedsTask.class
new file mode 100644
index 0000000..76fe556
Binary files /dev/null and b/WiiuseJ/bin/tests/LedsTask.class differ
diff --git a/WiiuseJ/bin/tests/Tests.class b/WiiuseJ/bin/tests/Tests.class
new file mode 100644
index 0000000..fdaedc1
Binary files /dev/null and b/WiiuseJ/bin/tests/Tests.class differ
diff --git a/WiiuseJ/bin/wiiusej/GForce.class b/WiiuseJ/bin/wiiusej/GForce.class
new file mode 100644
index 0000000..7d5c269
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/GForce.class differ
diff --git a/WiiuseJ/bin/wiiusej/LedsRequest.class b/WiiuseJ/bin/wiiusej/LedsRequest.class
new file mode 100644
index 0000000..41a9e28
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/LedsRequest.class differ
diff --git a/WiiuseJ/bin/wiiusej/OrientThresholdRequest.class b/WiiuseJ/bin/wiiusej/OrientThresholdRequest.class
new file mode 100644
index 0000000..a5ac9a8
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/OrientThresholdRequest.class differ
diff --git a/WiiuseJ/bin/wiiusej/Orientation.class b/WiiuseJ/bin/wiiusej/Orientation.class
new file mode 100644
index 0000000..2996ea2
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/Orientation.class differ
diff --git a/WiiuseJ/bin/wiiusej/Point2DInteger.class b/WiiuseJ/bin/wiiusej/Point2DInteger.class
new file mode 100644
index 0000000..fd3092c
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/Point2DInteger.class differ
diff --git a/WiiuseJ/bin/wiiusej/WiiMoteEvent.class b/WiiuseJ/bin/wiiusej/WiiMoteEvent.class
new file mode 100644
index 0000000..e48d388
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/WiiMoteEvent.class differ
diff --git a/WiiuseJ/bin/wiiusej/WiiUseApi.class b/WiiuseJ/bin/wiiusej/WiiUseApi.class
new file mode 100644
index 0000000..ec9732b
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/WiiUseApi.class differ
diff --git a/WiiuseJ/bin/wiiusej/WiiUseApiListener.class b/WiiuseJ/bin/wiiusej/WiiUseApiListener.class
new file mode 100644
index 0000000..5624686
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/WiiUseApiListener.class differ
diff --git a/WiiuseJ/bin/wiiusej/WiiUseApiManager.class b/WiiuseJ/bin/wiiusej/WiiUseApiManager.class
new file mode 100644
index 0000000..9bcf20a
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/WiiUseApiManager.class differ
diff --git a/WiiuseJ/bin/wiiusej/WiiUseApiRequest.class b/WiiuseJ/bin/wiiusej/WiiUseApiRequest.class
new file mode 100644
index 0000000..59271ce
Binary files /dev/null and b/WiiuseJ/bin/wiiusej/WiiUseApiRequest.class differ
diff --git a/WiiuseJ/doc/allclasses-frame.html b/WiiuseJ/doc/allclasses-frame.html
new file mode 100644
index 0000000..fdc2c10
--- /dev/null
+++ b/WiiuseJ/doc/allclasses-frame.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+All Classes
+
+
+
+
+
+
+
+
+
+
+
+All Classes
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/allclasses-noframe.html b/WiiuseJ/doc/allclasses-noframe.html
new file mode 100644
index 0000000..a2199a8
--- /dev/null
+++ b/WiiuseJ/doc/allclasses-noframe.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+All Classes
+
+
+
+
+
+
+
+
+
+
+
+All Classes
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/constant-values.html b/WiiuseJ/doc/constant-values.html
new file mode 100644
index 0000000..684d4c7
--- /dev/null
+++ b/WiiuseJ/doc/constant-values.html
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+Constant Field Values
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constant Field Values
+
+
+Contents
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/deprecated-list.html b/WiiuseJ/doc/deprecated-list.html
new file mode 100644
index 0000000..ad4903c
--- /dev/null
+++ b/WiiuseJ/doc/deprecated-list.html
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+Deprecated List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Deprecated API
+
+
+Contents
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/help-doc.html b/WiiuseJ/doc/help-doc.html
new file mode 100644
index 0000000..6521a9c
--- /dev/null
+++ b/WiiuseJ/doc/help-doc.html
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+API Help
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+How This API Document Is Organized
+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+Overview
+
+
+
+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+
+Package
+
+
+
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:
+Interfaces (italic) Classes Enums Exceptions Errors Annotation Types
+
+
+Class/Interface
+
+
+
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Class inheritance diagram Direct Subclasses All Known Subinterfaces All Known Implementing Classes Class/interface declaration Class/interface description
+
+
Nested Class Summary Field Summary Constructor Summary Method Summary
+
+
Field Detail Constructor Detail Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+
+
+Annotation Type
+
+
+
+Each annotation type has its own separate page with the following sections:
+Annotation Type declaration Annotation Type description Required Element Summary Optional Element Summary Element Detail
+
+
+
+Enum
+
+
+
+Each enum has its own separate page with the following sections:
+Enum declaration Enum description Enum Constant Summary Enum Constant Detail
+
+
+Use
+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+
+Tree (Class Hierarchy)
+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
+When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages. When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+
+Deprecated API
+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+
+Index
+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+
+Prev/Next
+These links take you to the next or previous class, interface, package, or related page.
+Frames/No Frames
+These links show and hide the HTML frames. All pages are available with or without frames.
+
+
+Serialized Form
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+
+
+Constant Field Values
+The Constant Field Values page lists the static final fields and their values.
+
+
+
+This help file applies to API documentation generated using the standard doclet.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-1.html b/WiiuseJ/doc/index-files/index-1.html
new file mode 100644
index 0000000..657c785
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-1.html
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+A-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+A
+
+activateIRTRacking(int) -
+Method in class wiiusej.WiiUseApiManager
+Activate IR Tracking for the wiimotes with the given id.
+ activateMotionSensing(int) -
+Method in class wiiusej.WiiUseApiManager
+Activate IR Tracking of the wiimotes with the given id.
+ activateRumble(int) -
+Method in class wiiusej.WiiUseApiManager
+Activate the rumble for the wiimotes with the given id.
+ addIRpoint(int, int) -
+Method in class wiiusej.WiiMoteEvent
+Add IR Point in the list (Max 4 points)
+ addWiiUseApiListener(WiiUseApiListener) -
+Method in class wiiusej.WiiUseApiManager
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-10.html b/WiiuseJ/doc/index-files/index-10.html
new file mode 100644
index 0000000..b86df5a
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-10.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+O-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+O
+
+Orientation - Class in wiiusej Class that represents the orientation of the wiimote. Orientation() -
+Constructor for class wiiusej.Orientation
+Default constructor.
+ Orientation(float, float, float) -
+Constructor for class wiiusej.Orientation
+Contructor with raw, pitch , yaw.
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-11.html b/WiiuseJ/doc/index-files/index-11.html
new file mode 100644
index 0000000..35b592a
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-11.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+P-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+P
+
+Point2DInteger - Class in wiiusej Point2DInteger(int, int) -
+Constructor for class wiiusej.Point2DInteger
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-12.html b/WiiuseJ/doc/index-files/index-12.html
new file mode 100644
index 0000000..5c75716
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-12.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+R-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+R
+
+removeWiiUseApiListener(WiiUseApiListener) -
+Method in class wiiusej.WiiUseApiManager
+
+ run() -
+Method in class wiiusej.WiiUseApiManager
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-13.html b/WiiuseJ/doc/index-files/index-13.html
new file mode 100644
index 0000000..63bcd31
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-13.html
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+S-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+S
+
+setBatteryLevel(float) -
+Method in class wiiusej.WiiMoteEvent
+Set level battery.
+ setButtonsHeld(short) -
+Method in class wiiusej.WiiMoteEvent
+set the int storing the buttons held
+ setButtonsJustPressed(short) -
+Method in class wiiusej.WiiMoteEvent
+set the int storing the buttons just pressed
+ setButtonsJustReleased(short) -
+Method in class wiiusej.WiiMoteEvent
+set the int storing the buttons just released
+ setConnected() -
+Method in class wiiusej.WiiMoteEvent
+Set the connected value to true.
+ setDisconnected() -
+Method in class wiiusej.WiiMoteEvent
+Set the connected value to false.
+ setGforce(float, float, float) -
+Method in class wiiusej.WiiMoteEvent
+Set the gravity force.
+ setIrActive() -
+Method in class wiiusej.WiiMoteEvent
+Set the value isIrActive to true
+ setIrInactive() -
+Method in class wiiusej.WiiMoteEvent
+Set the value isIrActive to true
+ setLeds(short) -
+Method in class wiiusej.WiiMoteEvent
+Set Status of the leds.
+ setLocation(double, double) -
+Method in class wiiusej.Point2DInteger
+
+ setMotionSensingActive() -
+Method in class wiiusej.WiiMoteEvent
+Set the motion sensing flag to active.
+ setMotionSensingInactive() -
+Method in class wiiusej.WiiMoteEvent
+Set the motion sensing flag to inactive.
+ setOrientation(float, float, float) -
+Method in class wiiusej.WiiMoteEvent
+Set orientation of the wiimote.
+ setPitch(float) -
+Method in class wiiusej.Orientation
+
+ setRoll(float) -
+Method in class wiiusej.Orientation
+
+ setRumbleActive() -
+Method in class wiiusej.WiiMoteEvent
+Set Rumble flag to Active.
+ setRumbleInactive() -
+Method in class wiiusej.WiiMoteEvent
+Set Rumble flag to Inactive.
+ setSpeakerDisabled() -
+Method in class wiiusej.WiiMoteEvent
+Set the flag for the speaker to "disabled"
+ setSpeakerEnabled() -
+Method in class wiiusej.WiiMoteEvent
+Set the flag for the speaker to "enabled"
+ setThereIsAnAttachment() -
+Method in class wiiusej.WiiMoteEvent
+Set the flag for the attachment to true
+ setThereIsNoAttachment() -
+Method in class wiiusej.WiiMoteEvent
+Set the flag for the attachment to false
+ setWiimoteId(int) -
+Method in class wiiusej.WiiMoteEvent
+Set Wiimote ID
+ setX(float) -
+Method in class wiiusej.GForce
+
+ setY(float) -
+Method in class wiiusej.GForce
+
+ setYaw(float) -
+Method in class wiiusej.Orientation
+
+ setZ(float) -
+Method in class wiiusej.GForce
+
+ shutdown() -
+Method in class wiiusej.WiiUseApiManager
+Stop thread and shutdown wiiuse Api.
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-14.html b/WiiuseJ/doc/index-files/index-14.html
new file mode 100644
index 0000000..a43b146
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-14.html
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+T-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+T
+
+tests - package tests Tests - Class in tests Tests() -
+Constructor for class tests.Tests
+
+ toString() -
+Method in class wiiusej.GForce
+
+ toString() -
+Method in class wiiusej.Orientation
+
+ toString() -
+Method in class wiiusej.Point2DInteger
+
+ toString() -
+Method in class wiiusej.WiiMoteEvent
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-15.html b/WiiuseJ/doc/index-files/index-15.html
new file mode 100644
index 0000000..46ad773
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-15.html
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+W-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+W
+
+wiimoteEvent(WiiMoteEvent) -
+Method in class tests.Tests
+
+ WiiMoteEvent - Class in wiiusej Class that is a bean to be filled by the wiiuse API. WiiMoteEvent() -
+Constructor for class wiiusej.WiiMoteEvent
+Default constructor
+ WiiMoteEvent(int) -
+Constructor for class wiiusej.WiiMoteEvent
+Construct the Wiimote setting up the id.
+ wiimoteEvent(WiiMoteEvent) -
+Method in interface wiiusej.WiiUseApiListener
+
+ WiiUseApi - Class in wiiusej Singleton used to manipulate WiiUse Api. WiiUseApi() -
+Constructor for class wiiusej.WiiUseApi
+
+ WiiUseApiListener - Interface in wiiusej WiiUseApiManager - Class in wiiusej WiiUseApiManager() -
+Constructor for class wiiusej.WiiUseApiManager
+
+ wiiusej - package wiiusej
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-2.html b/WiiuseJ/doc/index-files/index-2.html
new file mode 100644
index 0000000..5168d49
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-2.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+C-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+C
+
+closeConnection(int) -
+Method in class wiiusej.WiiUseApiManager
+Ask the thread to close a connection.
+ connectWiimotes() -
+Method in class wiiusej.WiiUseApiManager
+Connect wiimote and get the nu ber of wiimotes connected.
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-3.html b/WiiuseJ/doc/index-files/index-3.html
new file mode 100644
index 0000000..d08ee3d
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-3.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+D-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+D
+
+deactivateIRTRacking(int) -
+Method in class wiiusej.WiiUseApiManager
+Deactivate IR Tracking for the wiimotes with the given id.
+ deactivateMotionSensing(int) -
+Method in class wiiusej.WiiUseApiManager
+
+ deactivateRumble(int) -
+Method in class wiiusej.WiiUseApiManager
+Deactivate the rumble for the wiimotes with the given id.
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-4.html b/WiiuseJ/doc/index-files/index-4.html
new file mode 100644
index 0000000..f3d56c9
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-4.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+E-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+E
+
+EmptyIRPoints() -
+Method in class wiiusej.WiiMoteEvent
+Clear IR points.
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-5.html b/WiiuseJ/doc/index-files/index-5.html
new file mode 100644
index 0000000..ac664cc
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-5.html
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+G-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+G
+
+getBatteryLevel() -
+Method in class wiiusej.WiiMoteEvent
+Get battery level.
+ getButtonsHeld() -
+Method in class wiiusej.WiiMoteEvent
+get the int storing the buttons held
+ getButtonsJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+Get the int storing the buttons just pressed
+ getButtonsJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+Get the int storing the buttons just released
+ getGforce() -
+Method in class wiiusej.WiiMoteEvent
+Get the gravity force.
+ getInstance() -
+Static method in class wiiusej.WiiUseApiManager
+
+ getIRPoints() -
+Method in class wiiusej.WiiMoteEvent
+Get list of IR points.
+ getLeds() -
+Method in class wiiusej.WiiMoteEvent
+Get status of the leds .
+ getNbConnectedWiimotes() -
+Method in class wiiusej.WiiUseApiManager
+Get the number of wiimotes connected.
+ getOrientation() -
+Method in class wiiusej.WiiMoteEvent
+
+ getPitch() -
+Method in class wiiusej.Orientation
+
+ getRoll() -
+Method in class wiiusej.Orientation
+
+ getStatus(int) -
+Method in class wiiusej.WiiUseApiManager
+
+ getWiimoteId() -
+Method in class wiiusej.WiiMoteEvent
+Get Wiimote ID
+ getWiiUseApiListeners() -
+Method in class wiiusej.WiiUseApiManager
+
+ getX() -
+Method in class wiiusej.GForce
+
+ getX() -
+Method in class wiiusej.Point2DInteger
+
+ getY() -
+Method in class wiiusej.GForce
+
+ getY() -
+Method in class wiiusej.Point2DInteger
+
+ getYaw() -
+Method in class wiiusej.Orientation
+
+ getZ() -
+Method in class wiiusej.GForce
+
+ GForce - Class in wiiusej Represents gravity force on each axis. GForce() -
+Constructor for class wiiusej.GForce
+Default constructor;
+ GForce(float, float, float) -
+Constructor for class wiiusej.GForce
+Constructor with gravity force on each axis.
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-6.html b/WiiuseJ/doc/index-files/index-6.html
new file mode 100644
index 0000000..ab97170
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-6.html
@@ -0,0 +1,259 @@
+
+
+
+
+
+
+I-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+I
+
+isButtonAHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonAJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonAJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonBHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonBJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonBJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonDownHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonDownJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonDownJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonHomeHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonHomeJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonHomeJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonLeftHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonLeftJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonLeftJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonMinusHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonMinusJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonMinusJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonOneHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonOneJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonOneJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonPlusHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonPlusJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonPlusJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonRightHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonRightJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonRightJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonTwoHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonTwoJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonTwoJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonUpHeld() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonUpJustPressed() -
+Method in class wiiusej.WiiMoteEvent
+
+ isButtonUpJustReleased() -
+Method in class wiiusej.WiiMoteEvent
+
+ isConnected() -
+Method in class wiiusej.WiiMoteEvent
+True if the wiimote is connected false otherwise.
+ isIrActive() -
+Method in class wiiusej.WiiMoteEvent
+Tell if the IR Tracking is active.
+ isMotionSensingActive() -
+Method in class wiiusej.WiiMoteEvent
+Get the flag indicating if the motion sensing is active.
+ isRumbleActive() -
+Method in class wiiusej.WiiMoteEvent
+Get the status of rumble.
+ isSpeakerEnabled() -
+Method in class wiiusej.WiiMoteEvent
+Tell if the speaker is enable for this wiimote
+ isThereAttachment() -
+Method in class wiiusej.WiiMoteEvent
+Tell if there is an attachment to the Wiimote
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-7.html b/WiiuseJ/doc/index-files/index-7.html
new file mode 100644
index 0000000..8d6ffdc
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-7.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+L-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+L
+
+loadLibrary() -
+Method in class wiiusej.WiiUseApiManager
+Load the wiimote library.
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-8.html b/WiiuseJ/doc/index-files/index-8.html
new file mode 100644
index 0000000..edf71e2
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-8.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+M-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+M
+
+main(String[]) -
+Static method in class tests.Tests
+
+ main(String[]) -
+Static method in class wiiusej.WiiUseApi
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index-files/index-9.html b/WiiuseJ/doc/index-files/index-9.html
new file mode 100644
index 0000000..1895a90
--- /dev/null
+++ b/WiiuseJ/doc/index-files/index-9.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+N-Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+N
+
+notifyWiiUseApiListener(WiiMoteEvent) -
+Method in class wiiusej.WiiUseApiManager
+
+
+
+
+
+
+
+
+
+
+
+
+A C D E G I L M N O P R S T W
+
+
+
diff --git a/WiiuseJ/doc/index.html b/WiiuseJ/doc/index.html
new file mode 100644
index 0000000..03c9b83
--- /dev/null
+++ b/WiiuseJ/doc/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+Generated Documentation (Untitled)
+
+
+
+
+
+
+
+
+
+
+
+
+
+Frame Alert
+
+
+This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+
+Link toNon-frame version.
+
+
+
diff --git a/WiiuseJ/doc/overview-frame.html b/WiiuseJ/doc/overview-frame.html
new file mode 100644
index 0000000..13c4496
--- /dev/null
+++ b/WiiuseJ/doc/overview-frame.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+Overview List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/overview-summary.html b/WiiuseJ/doc/overview-summary.html
new file mode 100644
index 0000000..4de0dff
--- /dev/null
+++ b/WiiuseJ/doc/overview-summary.html
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+Overview
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+WiiuseJ javadoc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/overview-tree.html b/WiiuseJ/doc/overview-tree.html
new file mode 100644
index 0000000..3bf44c8
--- /dev/null
+++ b/WiiuseJ/doc/overview-tree.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Class Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hierarchy For All Packages
+
+
+Package Hierarchies: tests , wiiusej
+
+
+Class Hierarchy
+
+
+
+Interface Hierarchy
+
+
+java.util.EventListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/package-list b/WiiuseJ/doc/package-list
new file mode 100644
index 0000000..1223bb2
--- /dev/null
+++ b/WiiuseJ/doc/package-list
@@ -0,0 +1,2 @@
+tests
+wiiusej
diff --git a/WiiuseJ/doc/resources/inherit.gif b/WiiuseJ/doc/resources/inherit.gif
new file mode 100644
index 0000000..c814867
Binary files /dev/null and b/WiiuseJ/doc/resources/inherit.gif differ
diff --git a/WiiuseJ/doc/stylesheet.css b/WiiuseJ/doc/stylesheet.css
new file mode 100644
index 0000000..cbd3428
--- /dev/null
+++ b/WiiuseJ/doc/stylesheet.css
@@ -0,0 +1,29 @@
+/* Javadoc style sheet */
+
+/* Define colors, fonts and other style attributes here to override the defaults */
+
+/* Page background color */
+body { background-color: #FFFFFF; color:#000000 }
+
+/* Headings */
+h1 { font-size: 145% }
+
+/* Table colors */
+.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */
+.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */
+.TableRowColor { background: #FFFFFF; color:#000000 } /* White */
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+
+/* Navigation bar fonts and colors */
+.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */
+.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */
+.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}
+.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}
+
+.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
+.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
+
diff --git a/WiiuseJ/doc/tests/Tests.html b/WiiuseJ/doc/tests/Tests.html
new file mode 100644
index 0000000..0d5d962
--- /dev/null
+++ b/WiiuseJ/doc/tests/Tests.html
@@ -0,0 +1,280 @@
+
+
+
+
+
+
+Tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+tests
+
+Class Tests
+
+java.lang.Object
+ tests.Tests
+
+
+All Implemented Interfaces: java.util.EventListener, WiiUseApiListener
+
+
+
+public class Tests extends java.lang.Objectimplements WiiUseApiListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+Tests ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+Tests
+
+public Tests ()
+
+
+
+
+
+
+
+
+
+wiimoteEvent
+
+public void wiimoteEvent (WiiMoteEvent e)
+
+
+Specified by: wiimoteEvent in interface WiiUseApiListener
+
+
+
+
+
+
+
+
+main
+
+public static void main (java.lang.String[] args)
+
+
+
+
+
+Parameters: args -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/tests/class-use/Tests.html b/WiiuseJ/doc/tests/class-use/Tests.html
new file mode 100644
index 0000000..4e7714d
--- /dev/null
+++ b/WiiuseJ/doc/tests/class-use/Tests.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class tests.Tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class tests.Tests
+
+No usage of tests.Tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/tests/package-frame.html b/WiiuseJ/doc/tests/package-frame.html
new file mode 100644
index 0000000..22893f0
--- /dev/null
+++ b/WiiuseJ/doc/tests/package-frame.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+tests
+
+
+
+
+
+
+
+
+
+
+
+tests
+
+
+
+Classes
+
+
+Tests
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/tests/package-summary.html b/WiiuseJ/doc/tests/package-summary.html
new file mode 100644
index 0000000..31b57ce
--- /dev/null
+++ b/WiiuseJ/doc/tests/package-summary.html
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Package tests
+
+
+
+
+
+Class Summary
+
+
+Tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/tests/package-tree.html b/WiiuseJ/doc/tests/package-tree.html
new file mode 100644
index 0000000..8b767e7
--- /dev/null
+++ b/WiiuseJ/doc/tests/package-tree.html
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+tests Class Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hierarchy For Package tests
+
+
+
+Package Hierarchies: All Packages
+
+
+Class Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/tests/package-use.html b/WiiuseJ/doc/tests/package-use.html
new file mode 100644
index 0000000..ed5dd61
--- /dev/null
+++ b/WiiuseJ/doc/tests/package-use.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Package tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Package tests
+
+No usage of tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/GForce.html b/WiiuseJ/doc/wiiusej/GForce.html
new file mode 100644
index 0000000..fe79aac
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/GForce.html
@@ -0,0 +1,404 @@
+
+
+
+
+
+
+GForce
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiiusej
+
+Class GForce
+
+java.lang.Object
+ wiiusej.GForce
+
+
+
+public class GForce extends java.lang.Object
+
+
+
+Represents gravity force on each axis.
+
+
+
+
+Author:
+ gduche
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+GForce ()
+
+
+ Default constructor;
+
+
+GForce (float xx,
+ float yy,
+ float zz)
+
+
+ Constructor with gravity force on each axis.
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ float
+getX ()
+
+
+
+
+
+
+ float
+getY ()
+
+
+
+
+
+
+ float
+getZ ()
+
+
+
+
+
+
+ void
+setX (float x)
+
+
+
+
+
+
+ void
+setY (float y)
+
+
+
+
+
+
+ void
+setZ (float z)
+
+
+
+
+
+
+ java.lang.String
+toString ()
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+GForce
+
+public GForce ()
+
+Default constructor;
+
+
+
+
+
+GForce
+
+public GForce (float xx,
+ float yy,
+ float zz)
+
+Constructor with gravity force on each axis.
+
+
+Parameters: xx - x valueyy - x valuezz - x value
+
+
+
+
+
+
+
+
+getX
+
+public float getX ()
+
+
+
+Returns: the x
+
+
+
+
+
+setX
+
+public void setX (float x)
+
+
+Parameters: x - the x to set
+
+
+
+
+
+getY
+
+public float getY ()
+
+
+
+Returns: the y
+
+
+
+
+
+setY
+
+public void setY (float y)
+
+
+Parameters: y - the y to set
+
+
+
+
+
+getZ
+
+public float getZ ()
+
+
+
+Returns: the z
+
+
+
+
+
+setZ
+
+public void setZ (float z)
+
+
+Parameters: z - the z to set
+
+
+
+
+
+toString
+
+public java.lang.String toString ()
+
+
+Overrides: toString in class java.lang.Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/Orientation.html b/WiiuseJ/doc/wiiusej/Orientation.html
new file mode 100644
index 0000000..91f6b4c
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/Orientation.html
@@ -0,0 +1,404 @@
+
+
+
+
+
+
+Orientation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiiusej
+
+Class Orientation
+
+java.lang.Object
+ wiiusej.Orientation
+
+
+
+public class Orientation extends java.lang.Object
+
+
+
+Class that represents the orientation of the wiimote.
+
+
+
+
+Author:
+ gduche
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+Orientation ()
+
+
+ Default constructor.
+
+
+Orientation (float r,
+ float p,
+ float y)
+
+
+ Contructor with raw, pitch , yaw.
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ float
+getPitch ()
+
+
+
+
+
+
+ float
+getRoll ()
+
+
+
+
+
+
+ float
+getYaw ()
+
+
+
+
+
+
+ void
+setPitch (float pitch)
+
+
+
+
+
+
+ void
+setRoll (float roll)
+
+
+
+
+
+
+ void
+setYaw (float yaw)
+
+
+
+
+
+
+ java.lang.String
+toString ()
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+Orientation
+
+public Orientation ()
+
+Default constructor.
+
+
+
+
+
+Orientation
+
+public Orientation (float r,
+ float p,
+ float y)
+
+Contructor with raw, pitch , yaw.
+
+
+Parameters: r - rawp - pitchy - yaw
+
+
+
+
+
+
+
+
+getRoll
+
+public float getRoll ()
+
+
+
+Returns: the roll
+
+
+
+
+
+setRoll
+
+public void setRoll (float roll)
+
+
+Parameters: roll - the roll to set
+
+
+
+
+
+getPitch
+
+public float getPitch ()
+
+
+
+Returns: the pitch
+
+
+
+
+
+setPitch
+
+public void setPitch (float pitch)
+
+
+Parameters: pitch - the pitch to set
+
+
+
+
+
+getYaw
+
+public float getYaw ()
+
+
+
+Returns: the yaw
+
+
+
+
+
+setYaw
+
+public void setYaw (float yaw)
+
+
+Parameters: yaw - the yaw to set
+
+
+
+
+
+toString
+
+public java.lang.String toString ()
+
+
+Overrides: toString in class java.lang.Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/Point2DInteger.html b/WiiuseJ/doc/wiiusej/Point2DInteger.html
new file mode 100644
index 0000000..fad2098
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/Point2DInteger.html
@@ -0,0 +1,357 @@
+
+
+
+
+
+
+Point2DInteger
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiiusej
+
+Class Point2DInteger
+
+java.lang.Object
+ java.awt.geom.Point2D
+ wiiusej.Point2DInteger
+
+
+All Implemented Interfaces: java.lang.Cloneable
+
+
+
+public class Point2DInteger extends java.awt.geom.Point2D
+
+
+
+
+
+
+
+
+
+
+
+
+Nested Class Summary
+
+
+
+
+
+Nested classes/interfaces inherited from class java.awt.geom.Point2D
+
+
+java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+Point2DInteger (int xx,
+ int yy)
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+ double
+getX ()
+
+
+
+
+
+
+ double
+getY ()
+
+
+
+
+
+
+ void
+setLocation (double xx,
+ double yy)
+
+
+
+
+
+
+ java.lang.String
+toString ()
+
+
+
+
+
+
+
+
+Methods inherited from class java.awt.geom.Point2D
+
+
+clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+getClass, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+Point2DInteger
+
+public Point2DInteger (int xx,
+ int yy)
+
+
+
+
+
+
+
+
+
+getX
+
+public double getX ()
+
+
+Specified by: getX in class java.awt.geom.Point2D
+
+
+
+
+
+
+
+
+getY
+
+public double getY ()
+
+
+Specified by: getY in class java.awt.geom.Point2D
+
+
+
+
+
+
+
+
+setLocation
+
+public void setLocation (double xx,
+ double yy)
+
+
+Specified by: setLocation in class java.awt.geom.Point2D
+
+
+
+
+
+
+
+
+toString
+
+public java.lang.String toString ()
+
+
+Overrides: toString in class java.lang.Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/WiiMoteEvent.html b/WiiuseJ/doc/wiiusej/WiiMoteEvent.html
new file mode 100644
index 0000000..1753a06
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/WiiMoteEvent.html
@@ -0,0 +1,1710 @@
+
+
+
+
+
+
+WiiMoteEvent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiiusej
+
+Class WiiMoteEvent
+
+java.lang.Object
+ wiiusej.WiiMoteEvent
+
+
+
+public class WiiMoteEvent extends java.lang.Object
+
+
+
+Class that is a bean to be filled by the wiiuse API.
+
+
+
+
+Author:
+ gduche
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+WiiMoteEvent ()
+
+
+ Default constructor
+
+
+WiiMoteEvent (int id)
+
+
+ Construct the Wiimote setting up the id.
+
+
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+WiiMoteEvent
+
+public WiiMoteEvent ()
+
+Default constructor
+
+
+
+
+
+WiiMoteEvent
+
+public WiiMoteEvent (int id)
+
+Construct the Wiimote setting up the id.
+
+
+Parameters: id - the Wiimote id
+
+
+
+
+
+
+
+
+getWiimoteId
+
+public int getWiimoteId ()
+
+Get Wiimote ID
+
+
+
+Returns: the wiimote id.
+
+
+
+
+
+setWiimoteId
+
+public void setWiimoteId (int wiimoteId)
+
+Set Wiimote ID
+
+
+Parameters: wiimoteId - id of the wiimote
+
+
+
+
+
+isConnected
+
+public boolean isConnected ()
+
+True if the wiimote is connected false otherwise.
+
+
+
+Returns: return the connected status.
+
+
+
+
+
+setConnected
+
+public void setConnected ()
+
+Set the connected value to true.
+
+
+
+
+
+
+
+
+setDisconnected
+
+public void setDisconnected ()
+
+Set the connected value to false.
+
+
+
+
+
+
+
+
+getBatteryLevel
+
+public float getBatteryLevel ()
+
+Get battery level.
+
+
+
+Returns: battery level. 1 = 100%
+
+
+
+
+
+setBatteryLevel
+
+public void setBatteryLevel (float batteryLevel)
+
+Set level battery.
+
+
+Parameters: batteryLevel - must be between 0 and 1
+
+
+
+
+
+getLeds
+
+public short getLeds ()
+
+Get status of the leds .
+
+
+
+Returns: an int representing LEDS turned on.
+
+
+
+
+
+setLeds
+
+public void setLeds (short leds)
+
+Set Status of the leds.
+
+
+Parameters: leds -
+
+
+
+
+
+isSpeakerEnabled
+
+public boolean isSpeakerEnabled ()
+
+Tell if the speaker is enable for this wiimote
+
+
+
+Returns: TRUE if it enabled false otherwise
+
+
+
+
+
+setSpeakerEnabled
+
+public void setSpeakerEnabled ()
+
+Set the flag for the speaker to "enabled"
+
+
+
+
+
+
+
+
+setSpeakerDisabled
+
+public void setSpeakerDisabled ()
+
+Set the flag for the speaker to "disabled"
+
+
+
+
+
+
+
+
+isThereAttachment
+
+public boolean isThereAttachment ()
+
+Tell if there is an attachment to the Wiimote
+
+
+
+Returns: TRUE if it there is one false otherwise
+
+
+
+
+
+setThereIsAnAttachment
+
+public void setThereIsAnAttachment ()
+
+Set the flag for the attachment to true
+
+
+
+
+
+
+
+
+setThereIsNoAttachment
+
+public void setThereIsNoAttachment ()
+
+Set the flag for the attachment to false
+
+
+
+
+
+
+
+
+isRumbleActive
+
+public boolean isRumbleActive ()
+
+Get the status of rumble.
+
+
+
+Returns: true if the rumble is active false otherwise
+
+
+
+
+
+setRumbleActive
+
+public void setRumbleActive ()
+
+Set Rumble flag to Active.
+
+
+
+
+
+
+
+
+setRumbleInactive
+
+public void setRumbleInactive ()
+
+Set Rumble flag to Inactive.
+
+
+
+
+
+
+
+
+getButtonsJustPressed
+
+public short getButtonsJustPressed ()
+
+Get the int storing the buttons just pressed
+
+
+
+Returns: the int storing the buttons just pressed
+
+
+
+
+
+setButtonsJustPressed
+
+public void setButtonsJustPressed (short buttonsJustPressed)
+
+set the int storing the buttons just pressed
+
+
+Parameters: buttonsJustPressed -
+
+
+
+
+
+getButtonsJustReleased
+
+public short getButtonsJustReleased ()
+
+Get the int storing the buttons just released
+
+
+
+Returns: the int storing the buttons just released
+
+
+
+
+
+setButtonsJustReleased
+
+public void setButtonsJustReleased (short buttonsJustReleased)
+
+set the int storing the buttons just released
+
+
+Parameters: buttonsJustReleased -
+
+
+
+
+
+getButtonsHeld
+
+public short getButtonsHeld ()
+
+get the int storing the buttons held
+
+
+
+Returns: the int storing the buttons held
+
+
+
+
+
+setButtonsHeld
+
+public void setButtonsHeld (short buttonsHeld)
+
+set the int storing the buttons held
+
+
+Parameters: buttonsHeld -
+
+
+
+
+
+isIrActive
+
+public boolean isIrActive ()
+
+Tell if the IR Tracking is active.
+
+
+
+Returns: TRUE if it is active or false otherwise.
+
+
+
+
+
+setIrActive
+
+public void setIrActive ()
+
+Set the value isIrActive to true
+
+
+
+
+
+
+
+
+setIrInactive
+
+public void setIrInactive ()
+
+Set the value isIrActive to true
+
+
+
+
+
+
+
+
+getIRPoints
+
+public Point2DInteger [] getIRPoints ()
+
+Get list of IR points.
+
+
+
+Returns: the list of 2D points
+
+
+
+
+
+addIRpoint
+
+public void addIRpoint (int x,
+ int y)
+
+Add IR Point in the list (Max 4 points)
+
+
+Parameters: x - x valuey - y value
+
+
+
+
+
+EmptyIRPoints
+
+public void EmptyIRPoints ()
+
+Clear IR points.
+
+
+
+
+
+
+
+
+isMotionSensingActive
+
+public boolean isMotionSensingActive ()
+
+Get the flag indicating if the motion sensing is active.
+
+
+
+Returns: true if the motion sensing is active false otherwise
+
+
+
+
+
+setMotionSensingActive
+
+public void setMotionSensingActive ()
+
+Set the motion sensing flag to active.
+
+
+
+
+
+
+
+
+setMotionSensingInactive
+
+public void setMotionSensingInactive ()
+
+Set the motion sensing flag to inactive.
+
+
+
+
+
+
+
+
+getOrientation
+
+public Orientation getOrientation ()
+
+
+
+Returns: the orientation
+
+
+
+
+
+setOrientation
+
+public void setOrientation (float r,
+ float p,
+ float y)
+
+Set orientation of the wiimote.
+
+
+Parameters: r - rollp - pitchy - yaw
+
+
+
+
+
+getGforce
+
+public GForce getGforce ()
+
+Get the gravity force.
+
+
+
+Returns: the gforce
+
+
+
+
+
+setGforce
+
+public void setGforce (float x,
+ float y,
+ float z)
+
+Set the gravity force.
+
+
+Parameters: x - gravity force on x axisy - gravity force on y axisz - gravity force on z axis
+
+
+
+
+
+isButtonOneJustPressed
+
+public boolean isButtonOneJustPressed ()
+
+
+
+
+
+
+
+
+isButtonOneJustReleased
+
+public boolean isButtonOneJustReleased ()
+
+
+
+
+
+
+
+
+isButtonOneHeld
+
+public boolean isButtonOneHeld ()
+
+
+
+
+
+
+
+
+isButtonTwoJustPressed
+
+public boolean isButtonTwoJustPressed ()
+
+
+
+
+
+
+
+
+isButtonTwoJustReleased
+
+public boolean isButtonTwoJustReleased ()
+
+
+
+
+
+
+
+
+isButtonTwoHeld
+
+public boolean isButtonTwoHeld ()
+
+
+
+
+
+
+
+
+isButtonAJustPressed
+
+public boolean isButtonAJustPressed ()
+
+
+
+
+
+
+
+
+isButtonAJustReleased
+
+public boolean isButtonAJustReleased ()
+
+
+
+
+
+
+
+
+isButtonAHeld
+
+public boolean isButtonAHeld ()
+
+
+
+
+
+
+
+
+isButtonBJustPressed
+
+public boolean isButtonBJustPressed ()
+
+
+
+
+
+
+
+
+isButtonBJustReleased
+
+public boolean isButtonBJustReleased ()
+
+
+
+
+
+
+
+
+isButtonBHeld
+
+public boolean isButtonBHeld ()
+
+
+
+
+
+
+
+
+isButtonLeftJustPressed
+
+public boolean isButtonLeftJustPressed ()
+
+
+
+
+
+
+
+
+isButtonLeftJustReleased
+
+public boolean isButtonLeftJustReleased ()
+
+
+
+
+
+
+
+
+isButtonLeftHeld
+
+public boolean isButtonLeftHeld ()
+
+
+
+
+
+
+
+
+isButtonRightJustPressed
+
+public boolean isButtonRightJustPressed ()
+
+
+
+
+
+
+
+
+isButtonRightJustReleased
+
+public boolean isButtonRightJustReleased ()
+
+
+
+
+
+
+
+
+isButtonRightHeld
+
+public boolean isButtonRightHeld ()
+
+
+
+
+
+
+
+
+isButtonUpJustPressed
+
+public boolean isButtonUpJustPressed ()
+
+
+
+
+
+
+
+
+isButtonUpJustReleased
+
+public boolean isButtonUpJustReleased ()
+
+
+
+
+
+
+
+
+isButtonUpHeld
+
+public boolean isButtonUpHeld ()
+
+
+
+
+
+
+
+
+isButtonDownJustPressed
+
+public boolean isButtonDownJustPressed ()
+
+
+
+
+
+
+
+
+isButtonDownJustReleased
+
+public boolean isButtonDownJustReleased ()
+
+
+
+
+
+
+
+
+isButtonDownHeld
+
+public boolean isButtonDownHeld ()
+
+
+
+
+
+
+
+
+isButtonMinusJustPressed
+
+public boolean isButtonMinusJustPressed ()
+
+
+
+
+
+
+
+
+isButtonMinusJustReleased
+
+public boolean isButtonMinusJustReleased ()
+
+
+
+
+
+
+
+
+isButtonMinusHeld
+
+public boolean isButtonMinusHeld ()
+
+
+
+
+
+
+
+
+isButtonPlusJustPressed
+
+public boolean isButtonPlusJustPressed ()
+
+
+
+
+
+
+
+
+isButtonPlusJustReleased
+
+public boolean isButtonPlusJustReleased ()
+
+
+
+
+
+
+
+
+isButtonPlusHeld
+
+public boolean isButtonPlusHeld ()
+
+
+
+
+
+
+
+
+isButtonHomeJustPressed
+
+public boolean isButtonHomeJustPressed ()
+
+
+
+
+
+
+
+
+isButtonHomeJustReleased
+
+public boolean isButtonHomeJustReleased ()
+
+
+
+
+
+
+
+
+isButtonHomeHeld
+
+public boolean isButtonHomeHeld ()
+
+
+
+
+
+
+
+
+toString
+
+public java.lang.String toString ()
+
+
+Overrides: toString in class java.lang.Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/WiiUseApi.html b/WiiuseJ/doc/wiiusej/WiiUseApi.html
new file mode 100644
index 0000000..ba93758
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/WiiUseApi.html
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+WiiUseApi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiiusej
+
+Class WiiUseApi
+
+java.lang.Object
+ wiiusej.WiiUseApi
+
+
+
+public class WiiUseApi extends java.lang.Object
+
+
+
+Singleton used to manipulate WiiUse Api.
+
+
+
+
+Author:
+ gduche
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+WiiUseApi ()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+static void
+main (java.lang.String[] args)
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+WiiUseApi
+
+public WiiUseApi ()
+
+
+
+
+
+
+
+
+
+main
+
+public static void main (java.lang.String[] args)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/WiiUseApiListener.html b/WiiuseJ/doc/wiiusej/WiiUseApiListener.html
new file mode 100644
index 0000000..6b6b328
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/WiiUseApiListener.html
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+WiiUseApiListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiiusej
+
+Interface WiiUseApiListener
+
+All Superinterfaces: java.util.EventListener
+
+
+All Known Implementing Classes: Tests
+
+
+
+public interface WiiUseApiListener extends java.util.EventListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiimoteEvent
+
+void wiimoteEvent (WiiMoteEvent e)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/WiiUseApiManager.html b/WiiuseJ/doc/wiiusej/WiiUseApiManager.html
new file mode 100644
index 0000000..26f981e
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/WiiUseApiManager.html
@@ -0,0 +1,652 @@
+
+
+
+
+
+
+WiiUseApiManager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+wiiusej
+
+Class WiiUseApiManager
+
+java.lang.Object
+ java.lang.Thread
+ wiiusej.WiiUseApiManager
+
+
+All Implemented Interfaces: java.lang.Runnable
+
+
+
+public class WiiUseApiManager extends java.lang.Thread
+
+
+
+
+
+
+
+
+
+
+
+
+Nested Class Summary
+
+
+
+
+
+Nested classes/interfaces inherited from class java.lang.Thread
+
+
+java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
+
+
+
+
+
+
+
+
+
+
+Fields inherited from class java.lang.Thread
+
+
+MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Thread
+
+
+activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+WiiUseApiManager
+
+public WiiUseApiManager ()
+
+
+
+
+
+
+
+
+
+getInstance
+
+public static WiiUseApiManager getInstance ()
+
+
+
+
+
+
+
+
+loadLibrary
+
+public boolean loadLibrary ()
+
+Load the wiimote library.
+
+
+
+Returns: false if the library is not loaded true otherwise.
+
+
+
+
+
+connectWiimotes
+
+public int connectWiimotes ()
+
+Connect wiimote and get the nu ber of wiimotes connected. Supposed to be
+ used once.
+
+
+
+Returns: 0 if nothing connected or the number of wiimotes connected.
+
+
+
+
+
+closeConnection
+
+public void closeConnection (int id)
+
+Ask the thread to close a connection.
+
+
+Parameters: id - id of the wiimote to disconnect.
+
+
+
+
+
+getNbConnectedWiimotes
+
+public int getNbConnectedWiimotes ()
+
+Get the number of wiimotes connected.
+
+
+
+Returns: the number of wiimotes connected.
+
+
+
+
+
+shutdown
+
+public void shutdown ()
+
+Stop thread and shutdown wiiuse Api.
+
+
+
+
+
+
+
+
+activateRumble
+
+public void activateRumble (int id)
+
+Activate the rumble for the wiimotes with the given id.
+
+
+Parameters: id - the id of the wiimote.
+
+
+
+
+
+deactivateRumble
+
+public void deactivateRumble (int id)
+
+Deactivate the rumble for the wiimotes with the given id.
+
+
+Parameters: id - the id of the wiimote.
+
+
+
+
+
+activateIRTRacking
+
+public void activateIRTRacking (int id)
+
+Activate IR Tracking for the wiimotes with the given id.
+
+
+Parameters: id - the id of the wiimote.
+
+
+
+
+
+deactivateIRTRacking
+
+public void deactivateIRTRacking (int id)
+
+Deactivate IR Tracking for the wiimotes with the given id.
+
+
+Parameters: id - the id of the wiimote.
+
+
+
+
+
+activateMotionSensing
+
+public void activateMotionSensing (int id)
+
+Activate IR Tracking of the wiimotes with the given id.
+
+
+Parameters: id - the id of the wiimote.
+
+
+
+
+
+deactivateMotionSensing
+
+public void deactivateMotionSensing (int id)
+
+
+
+
+
+
+
+
+getStatus
+
+public void getStatus (int id)
+
+
+
+
+
+
+
+
+run
+
+public void run ()
+
+
+Specified by: run in interface java.lang.RunnableOverrides: run in class java.lang.Thread
+
+
+
+
+
+
+
+
+addWiiUseApiListener
+
+public void addWiiUseApiListener (WiiUseApiListener listener)
+
+
+
+
+
+
+
+
+removeWiiUseApiListener
+
+public void removeWiiUseApiListener (WiiUseApiListener listener)
+
+
+
+
+
+
+
+
+getWiiUseApiListeners
+
+public WiiUseApiListener [] getWiiUseApiListeners ()
+
+
+
+
+
+
+
+
+notifyWiiUseApiListener
+
+public void notifyWiiUseApiListener (WiiMoteEvent evt)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/class-use/GForce.html b/WiiuseJ/doc/wiiusej/class-use/GForce.html
new file mode 100644
index 0000000..fd7eff6
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/class-use/GForce.html
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+Uses of Class wiiusej.GForce
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class wiiusej.GForce
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/class-use/Orientation.html b/WiiuseJ/doc/wiiusej/class-use/Orientation.html
new file mode 100644
index 0000000..33b181a
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/class-use/Orientation.html
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+Uses of Class wiiusej.Orientation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class wiiusej.Orientation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/class-use/Point2DInteger.html b/WiiuseJ/doc/wiiusej/class-use/Point2DInteger.html
new file mode 100644
index 0000000..cbc766f
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/class-use/Point2DInteger.html
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+Uses of Class wiiusej.Point2DInteger
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class wiiusej.Point2DInteger
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/class-use/WiiMoteEvent.html b/WiiuseJ/doc/wiiusej/class-use/WiiMoteEvent.html
new file mode 100644
index 0000000..f98961d
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/class-use/WiiMoteEvent.html
@@ -0,0 +1,217 @@
+
+
+
+
+
+
+Uses of Class wiiusej.WiiMoteEvent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class wiiusej.WiiMoteEvent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/class-use/WiiUseApi.html b/WiiuseJ/doc/wiiusej/class-use/WiiUseApi.html
new file mode 100644
index 0000000..122d1d7
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/class-use/WiiUseApi.html
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+Uses of Class wiiusej.WiiUseApi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class wiiusej.WiiUseApi
+
+No usage of wiiusej.WiiUseApi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/class-use/WiiUseApiListener.html b/WiiuseJ/doc/wiiusej/class-use/WiiUseApiListener.html
new file mode 100644
index 0000000..18def67
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/class-use/WiiUseApiListener.html
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+Uses of Interface wiiusej.WiiUseApiListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Interface wiiusej.WiiUseApiListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/class-use/WiiUseApiManager.html b/WiiuseJ/doc/wiiusej/class-use/WiiUseApiManager.html
new file mode 100644
index 0000000..575e9ed
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/class-use/WiiUseApiManager.html
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+Uses of Class wiiusej.WiiUseApiManager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Class wiiusej.WiiUseApiManager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/package-frame.html b/WiiuseJ/doc/wiiusej/package-frame.html
new file mode 100644
index 0000000..738c9c0
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/package-frame.html
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+wiiusej
+
+
+
+
+
+
+
+
+
+
+
+wiiusej
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/package-summary.html b/WiiuseJ/doc/wiiusej/package-summary.html
new file mode 100644
index 0000000..ffa864b
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/package-summary.html
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+wiiusej
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Package wiiusej
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/package-tree.html b/WiiuseJ/doc/wiiusej/package-tree.html
new file mode 100644
index 0000000..31fe288
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/package-tree.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+wiiusej Class Hierarchy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hierarchy For Package wiiusej
+
+
+
+Package Hierarchies: All Packages
+
+
+Class Hierarchy
+
+
+
+Interface Hierarchy
+
+
+java.util.EventListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/doc/wiiusej/package-use.html b/WiiuseJ/doc/wiiusej/package-use.html
new file mode 100644
index 0000000..7fcd238
--- /dev/null
+++ b/WiiuseJ/doc/wiiusej/package-use.html
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+Uses of Package wiiusej
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Uses of Package wiiusej
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WiiuseJ/libWiiuseJ.dll b/WiiuseJ/libWiiuseJ.dll
new file mode 100644
index 0000000..a045dbd
Binary files /dev/null and b/WiiuseJ/libWiiuseJ.dll differ
diff --git a/WiiuseJ/src/tests/LedsTask.java b/WiiuseJ/src/tests/LedsTask.java
new file mode 100644
index 0000000..d4adda2
--- /dev/null
+++ b/WiiuseJ/src/tests/LedsTask.java
@@ -0,0 +1,30 @@
+package tests;
+
+import java.util.TimerTask;
+
+import wiiusej.WiiUseApiManager;
+
+public class LedsTask extends TimerTask {
+
+ private int i = 0;
+ private int inc = 1;
+
+ @Override
+ public void run() {
+ if(i==0){
+ WiiUseApiManager.getInstance().setLeds(1, true, false, false, false);
+ }else if(i==1){
+ WiiUseApiManager.getInstance().setLeds(1, false, true, false, false);
+ }else if(i==2){
+ WiiUseApiManager.getInstance().setLeds(1, false, false, true, false);
+ }else if(i==3){
+ WiiUseApiManager.getInstance().setLeds(1, false, false, false, true);
+ }
+ if (i==0) i=1;
+ if (i==3) i=-1;
+ i = i+inc;
+
+ }
+
+}
+
diff --git a/WiiuseJ/src/tests/Tests.java b/WiiuseJ/src/tests/Tests.java
new file mode 100644
index 0000000..dbe4ccc
--- /dev/null
+++ b/WiiuseJ/src/tests/Tests.java
@@ -0,0 +1,374 @@
+package tests;
+
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.util.ArrayList;
+
+import wiiusej.Point2DInteger;
+import wiiusej.WiiMoteEvent;
+import wiiusej.WiiUseApiListener;
+import wiiusej.WiiUseApiManager;
+
+public class Tests implements WiiUseApiListener {
+
+ Robot robot;
+
+ private static int DISPLAY_EACH_VALUE = 1;
+ private static int DUMP = 2;
+ private static int MOVE_MOUSE = 3;
+ private static int ORIENT_THRESH_CONT = 4;
+ private static int TEST_LEDS = 5;
+
+ int dump = ORIENT_THRESH_CONT;
+
+ public Tests() {
+ try {
+ robot = new Robot();
+ } catch (AWTException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void wiimoteEvent(WiiMoteEvent e) {
+
+ /* leave if nothing is connected */
+ if (WiiUseApiManager.getInstance().getNbConnectedWiimotes() == 0) {
+ WiiUseApiManager.getInstance().shutdown();
+ }
+
+ if (dump == DISPLAY_EACH_VALUE) {
+ if (e.isConnected()) {
+ // System.out.println("*********** WIIMOTE ID : "+
+ // e.getWiimoteId() + " **************");
+ /* button ONE */
+ if (e.isButtonOneJustPressed()) {
+ System.out.println("button one pressed");
+ }
+ if (e.isButtonOneHeld()) {
+ System.out.println("button one held");
+ }
+ if (e.isButtonOneJustReleased()) {
+ System.out.println("button one released");
+ }
+
+ /* button TWO */
+ if (e.isButtonTwoJustPressed()) {
+ System.out.println("button two pressed");
+ }
+ if (e.isButtonTwoHeld()) {
+ System.out.println("button two held");
+ }
+ if (e.isButtonTwoJustReleased()) {
+ System.out.println("button two released");
+ }
+
+ /* button A */
+ if (e.isButtonAJustPressed()) {
+ System.out.println("button A pressed");
+ }
+ if (e.isButtonAHeld()) {
+ System.out.println("button A held");
+ }
+ if (e.isButtonAJustReleased()) {
+ System.out.println("button A released");
+ }
+
+ /* button B */
+ if (e.isButtonBJustPressed()) {
+ System.out.println("button B pressed");
+ }
+ if (e.isButtonBHeld()) {
+ System.out.println("button B held");
+ }
+ if (e.isButtonBJustReleased()) {
+ System.out.println("button B released");
+ }
+
+ /* button LEFT */
+ if (e.isButtonLeftJustPressed()) {
+ System.out.println("button Left pressed");
+ }
+ if (e.isButtonLeftHeld()) {
+ System.out.println("button Left held");
+ }
+ if (e.isButtonLeftJustReleased()) {
+ System.out.println("button Left released");
+ }
+
+ /* button RIGHT */
+ if (e.isButtonRightJustPressed()) {
+ System.out.println("button Right pressed");
+ }
+ if (e.isButtonRightHeld()) {
+ System.out.println("button Right held");
+ }
+ if (e.isButtonRightJustReleased()) {
+ System.out.println("button Right released");
+ }
+
+ /* button UP */
+ if (e.isButtonUpJustPressed()) {
+ System.out.println("button UP pressed");
+ }
+ if (e.isButtonUpHeld()) {
+ System.out.println("button UP held");
+ }
+ if (e.isButtonUpJustReleased()) {
+ System.out.println("button UP released");
+ }
+
+ /* button DOWN */
+ if (e.isButtonDownJustPressed()) {
+ System.out.println("button DOWN pressed");
+ }
+ if (e.isButtonDownHeld()) {
+ System.out.println("button DOWN held");
+ }
+ if (e.isButtonDownJustReleased()) {
+ System.out.println("button DOWN released");
+ }
+
+ /* button MINUS */
+ if (e.isButtonMinusJustPressed()) {
+ System.out.println("button MINUS pressed");
+ }
+ if (e.isButtonMinusHeld()) {
+ System.out.println("button MINUS held");
+ }
+ if (e.isButtonMinusJustReleased()) {
+ System.out.println("button MINUS released");
+ }
+
+ /* button PLUS */
+ if (e.isButtonPlusJustPressed()) {
+ System.out.println("button PLUS pressed");
+ }
+ if (e.isButtonPlusHeld()) {
+ System.out.println("button PLUS held");
+ }
+ if (e.isButtonPlusJustReleased()) {
+ System.out.println("button PLUS released");
+ }
+
+ /* button HOME */
+ if (e.isButtonHomeJustPressed()) {
+ System.out.println("button HOME pressed");
+ }
+ if (e.isButtonHomeHeld()) {
+ System.out.println("button HOME held");
+ }
+ if (e.isButtonHomeJustReleased()) {
+ System.out.println("button HOME released");
+ }
+
+ /* get status */
+ if (e.isButtonMinusJustPressed()&&e.isButtonPlusJustPressed()) {
+ WiiUseApiManager.getInstance().getStatus(1);
+ }
+
+ /* Activate rumble */
+ if (e.isButtonOneJustPressed()) {
+ System.out.println("Rumble Activated");
+ WiiUseApiManager.getInstance().activateRumble(1);
+ }
+ if (e.isButtonTwoJustPressed()) {
+ System.out.println("Rumble Deactivated");
+ WiiUseApiManager.getInstance().deactivateRumble(1);
+ }
+
+ /* Activate IR Tracking */
+ if (e.isButtonAJustPressed()) {
+ System.out.println("IR Activated");
+ WiiUseApiManager.getInstance().activateIRTRacking(1);
+ }
+ if (e.isButtonBJustPressed()) {
+ System.out.println("IR Deactivated");
+ WiiUseApiManager.getInstance().deactivateIRTRacking(1);
+ }
+
+ /* Activate Motion sensing */
+ if (e.isButtonPlusJustPressed()){
+ System.out.println("Motion sensing Activated");
+ WiiUseApiManager.getInstance().activateMotionSensing(1);
+ }
+ if (e.isButtonMinusJustPressed()){
+ System.out.println("Motion sensing Deactivated");
+ WiiUseApiManager.getInstance().deactivateMotionSensing(1);
+ }
+
+ /* display status */
+ if (e.getBatteryLevel() != -1) {
+ System.out
+ .println("battery level : " + e.getBatteryLevel());
+ System.out.println("= --- Leds : " + e.getLeds() + "\n");
+ System.out.println("= --- Rumble : " + e.isRumbleActive() + "\n");
+ }
+
+ /* display ir points */
+ if (e.isIrActive()) {
+ Point2DInteger[] list = e.getIRPoints();
+ for (int i = 0; i < list.length; i++) {
+ if (list[i] != null)
+ System.out.print("Point :(" + list[i].getX() + ","
+ + list[i].getY() + ") ");
+ }
+ System.out.println("");
+ }
+
+ /* display motion sensing */
+ if (e.isMotionSensingActive()){
+ System.out.println("Motion Sensing :"+e.getOrientation()+" , "+e.getGforce());
+ }
+
+ /* leave test */
+ if (e.isButtonHomeJustPressed()) {
+ System.out.println("LEAVING TEST");
+ WiiUseApiManager.getInstance().closeConnection(1);
+ }
+ } else {
+ System.out.println(" WIIMOTE ID : " + e.getWiimoteId()
+ + " DISCONNECTED !!!!!");
+ WiiUseApiManager.getInstance().closeConnection(1);
+ }
+ } else if (dump == DUMP) {
+ System.out.println(e);
+ /* Activate all */
+ if (e.isButtonAJustPressed()) {
+ System.out.println("IR Activated");
+ WiiUseApiManager.getInstance().activateIRTRacking(1);
+ WiiUseApiManager.getInstance().activateMotionSensing(1);
+ WiiUseApiManager.getInstance().activateRumble(1);
+ }
+ if (e.isButtonBJustPressed()) {
+ System.out.println("IR Deactivated");
+ WiiUseApiManager.getInstance().deactivateIRTRacking(1);
+ WiiUseApiManager.getInstance().deactivateMotionSensing(1);
+ WiiUseApiManager.getInstance().deactivateRumble(1);
+ }
+
+ /* leave test */
+ if (e.isButtonHomeJustPressed()) {
+ System.out.println("LEAVING TEST");
+ WiiUseApiManager.getInstance().closeConnection(1);
+ if (WiiUseApiManager.getInstance().getNbConnectedWiimotes() == 0) {
+ WiiUseApiManager.getInstance().shutdown();
+ }
+ }
+ } else if (dump == MOVE_MOUSE) {
+ /* Activate IR Tracking */
+ if (e.isButtonOneJustPressed()) {
+ System.out.println("IR Activated");
+ WiiUseApiManager.getInstance().activateIRTRacking(1);
+ }
+ if (e.isButtonTwoJustPressed()) {
+ System.out.println("IR Deactivated");
+ WiiUseApiManager.getInstance().deactivateIRTRacking(1);
+ }
+
+ /* button A */
+ if (e.isButtonAJustPressed()) {
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ }
+ if (e.isButtonAJustReleased()) {
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+ }
+
+ /* button B */
+ if (e.isButtonBJustPressed()) {
+ robot.mousePress(InputEvent.BUTTON2_MASK);
+ }
+ if (e.isButtonBJustReleased()) {
+ robot.mouseRelease(InputEvent.BUTTON2_MASK);
+ }
+
+ Point2DInteger[] list = e.getIRPoints();
+ if (e.isIrActive() && list[0] != null) {
+
+ int x1 = (int) list[0].getX();
+ int y1 = (int) list[0].getY();
+
+ int mousex = (int) Math.round(((double) x1 / 1024.0) * 1280.0);
+ int mousey = (int) Math.round(((double) y1 / 768.0) * 1024.0);
+ robot.mouseMove(mousex, mousey);
+ }
+
+ /* leave test */
+ if (e.isButtonHomeJustPressed()) {
+ System.out.println("LEAVING TEST");
+ WiiUseApiManager.getInstance().closeConnection(1);
+ }
+ }else if(dump == ORIENT_THRESH_CONT){
+ WiiUseApiManager.getInstance().activateMotionSensing(1);
+ if (e.isButtonOneJustPressed()) {
+ System.out.println("Continous activated");
+ WiiUseApiManager.getInstance().activateContinuous(1);
+ }
+ if (e.isButtonTwoJustPressed()) {
+ System.out.println("Continous deactivated");
+ WiiUseApiManager.getInstance().deactivateContinuous(1);
+ }
+ if (e.isButtonAJustPressed()) {
+ System.out.println("Smoothing activated");
+ WiiUseApiManager.getInstance().activateSmoothing(1);
+ }
+ if (e.isButtonBJustPressed()) {
+ System.out.println("Smoothing deactivated");
+ WiiUseApiManager.getInstance().deactivateSmoothing(1);
+ }
+ if (e.isButtonPlusJustPressed()) {
+ System.out.println("Threshold orientation 10 degrees");
+ WiiUseApiManager.getInstance().setOrientationThreshold(1, 10);
+ }
+ if (e.isButtonMinusJustPressed()) {
+ System.out.println("Threshold orientation 0.5 degrees");
+ WiiUseApiManager.getInstance().setOrientationThreshold(1, (float)0.5);
+ }
+ System.out.println(e);
+
+
+ /* leave test */
+ if (e.isButtonHomeJustPressed()) {
+ System.out.println("LEAVING TEST");
+ WiiUseApiManager.getInstance().closeConnection(1);
+ }
+ }else if(dump == TEST_LEDS){
+ WiiUseApiManager.getInstance().activateMotionSensing(1);
+ if (e.isButtonUpJustPressed()) {
+ WiiUseApiManager.getInstance().setLeds(1, true, false, false, false);
+ }
+ if (e.isButtonDownJustPressed()) {
+ WiiUseApiManager.getInstance().setLeds(1, false, true, false, false);
+ }
+ if (e.isButtonLeftJustPressed()) {
+ WiiUseApiManager.getInstance().setLeds(1, false, false, true, false);
+ }
+ if (e.isButtonRightJustPressed()) {
+ WiiUseApiManager.getInstance().setLeds(1, false, false, false, true);
+ }
+
+ /* leave test */
+ if (e.isButtonHomeJustPressed()) {
+ System.out.println("LEAVING TEST");
+ WiiUseApiManager.getInstance().closeConnection(1);
+ }
+ }
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ Tests tests = new Tests();
+ WiiUseApiManager manager = WiiUseApiManager.getInstance();
+ manager.addWiiUseApiListener(tests);
+ manager.loadLibrary();
+ manager.connectWiimotes();
+ manager.start();
+// java.util.Timer timer = new java.util.Timer();
+// timer.scheduleAtFixedRate(new LedsTask(), 0, 100);
+
+ }
+
+}
diff --git a/WiiuseJ/src/wiiusej/GForce.java b/WiiuseJ/src/wiiusej/GForce.java
new file mode 100644
index 0000000..3cd513d
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/GForce.java
@@ -0,0 +1,81 @@
+package wiiusej;
+
+/**
+ * Represents gravity force on each axis.
+ * @author gduche
+ *
+ */
+public class GForce {
+
+ private float x;
+ private float y;
+ private float z;
+
+ /**
+ * Default constructor;
+ */
+ public GForce(){
+ x = 0;
+ y = 0;
+ z = 0;
+ }
+
+ /**
+ * Constructor with gravity force on each axis.
+ * @param xx x value
+ * @param yy x value
+ * @param zz x value
+ */
+ public GForce(float xx, float yy, float zz){
+ x = xx;
+ y = yy;
+ z = zz;
+ }
+
+ /**
+ * @return the x
+ */
+ public float getX() {
+ return x;
+ }
+
+ /**
+ * @param x the x to set
+ */
+ public void setX(float x) {
+ this.x = x;
+ }
+
+ /**
+ * @return the y
+ */
+ public float getY() {
+ return y;
+ }
+
+ /**
+ * @param y the y to set
+ */
+ public void setY(float y) {
+ this.y = y;
+ }
+
+ /**
+ * @return the z
+ */
+ public float getZ() {
+ return z;
+ }
+
+ /**
+ * @param z the z to set
+ */
+ public void setZ(float z) {
+ this.z = z;
+ }
+
+ @Override
+ public String toString() {
+ return "Gravity force : ("+x+", "+y+","+z+")";
+ }
+}
diff --git a/WiiuseJ/src/wiiusej/LedsRequest.java b/WiiuseJ/src/wiiusej/LedsRequest.java
new file mode 100644
index 0000000..c068ba3
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/LedsRequest.java
@@ -0,0 +1,109 @@
+package wiiusej;
+
+/**
+ * Represents a request to set leds of the wiimote with WiiUse API.
+ * @author gduche
+ *
+ */
+public class LedsRequest extends wiiusej.WiiUseApiRequest {
+
+ private boolean led1, led2, led3, led4;
+
+ /**
+ * Constructor setting the id of the wiimote concerned.
+ *
+ * @param id
+ * id of the wiimote concerned
+ * @param type
+ * type of the request
+ */
+ public LedsRequest(int id, int type) {
+ super(id, type);
+ }
+
+ /**
+ * Constructor setting the id of the wiimote concerned.
+ *
+ * @param id
+ * id of the wiimote concerned
+ * @param type
+ * type of the request
+ * @param l1
+ * led1 status. True=ON, False=OFF
+ * @param l2
+ * led2 status. True=ON, False=OFF
+ * @param l3
+ * led3 status. True=ON, False=OFF
+ * @param l4
+ * led4 status. True=ON, False=OFF
+ */
+ public LedsRequest(int id, int type, boolean l1, boolean l2, boolean l3,
+ boolean l4) {
+ super(id, type);
+ led1 = l1;
+ led2 = l2;
+ led3 = l3;
+ led4 = l4;
+ }
+
+ /**
+ * @return the led1
+ */
+ public boolean isLed1() {
+ return led1;
+ }
+
+ /**
+ * @param led1
+ * the led1 to set
+ */
+ public void setLed1(boolean led1) {
+ this.led1 = led1;
+ }
+
+ /**
+ * @return the led2
+ */
+ public boolean isLed2() {
+ return led2;
+ }
+
+ /**
+ * @param led2
+ * the led2 to set
+ */
+ public void setLed2(boolean led2) {
+ this.led2 = led2;
+ }
+
+ /**
+ * @return the led3
+ */
+ public boolean isLed3() {
+ return led3;
+ }
+
+ /**
+ * @param led3
+ * the led3 to set
+ */
+ public void setLed3(boolean led3) {
+ this.led3 = led3;
+ }
+
+ /**
+ * @return the led4
+ */
+ public boolean isLed4() {
+ return led4;
+ }
+
+ /**
+ * @param led4
+ * the led4 to set
+ */
+ public void setLed4(boolean led4) {
+ this.led4 = led4;
+ }
+
+}
diff --git a/WiiuseJ/src/wiiusej/OrientThresholdRequest.java b/WiiuseJ/src/wiiusej/OrientThresholdRequest.java
new file mode 100644
index 0000000..0d3cc14
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/OrientThresholdRequest.java
@@ -0,0 +1,54 @@
+package wiiusej;
+
+/**
+ * Represents a request to set orientation Threshold in Wiiuse API.
+ * Orientation Threshold is the minimum angle (in degrees) between two events.
+ * @author gduche
+ *
+ */
+public class OrientThresholdRequest extends WiiUseApiRequest {
+
+ private float thresholhd;
+
+ /**
+ * Constructor setting the id of the wiimote concerned.
+ *
+ * @param id
+ * the id of the wiimote concerned.
+ */
+ public OrientThresholdRequest(int id, int type) {
+ super(id, type);
+ }
+
+ /**
+ * Constructor setting the id of the wiimote concerned.
+ *
+ * @param id
+ * the id of the wiimote concerned.
+ * @param type
+ * type of the request
+ * @param th
+ * threshold in degrees
+ */
+ public OrientThresholdRequest(int id, int type, float th) {
+ super(id, type);
+ thresholhd = th;
+ }
+
+ /**
+ * @return the thresholhd
+ */
+ public float getThresholhd() {
+ return thresholhd;
+ }
+
+ /**
+ * @param thresholhd the thresholhd to set
+ */
+ public void setThresholhd(float thresholhd) {
+ this.thresholhd = thresholhd;
+ }
+
+
+
+}
diff --git a/WiiuseJ/src/wiiusej/Orientation.java b/WiiuseJ/src/wiiusej/Orientation.java
new file mode 100644
index 0000000..52ebd7c
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/Orientation.java
@@ -0,0 +1,77 @@
+package wiiusej;
+
+/**
+ * Class that represents the orientation of the wiimote.
+ * @author gduche
+ *
+ */
+public class Orientation {
+
+ private float roll;
+ private float pitch;
+ private float yaw;
+
+ /**
+ * Default constructor.
+ */
+ public Orientation(){
+ roll = 0;
+ pitch = 0;
+ yaw = 0;
+ }
+
+ /**
+ * Contructor with raw, pitch , yaw.
+ * @param r raw
+ * @param p pitch
+ * @param y yaw
+ */
+ public Orientation(float r, float p, float y){
+ roll = r;
+ pitch = p;
+ yaw = y;
+ }
+
+ /**
+ * @return the roll
+ */
+ public float getRoll() {
+ return roll;
+ }
+ /**
+ * @param roll the roll to set
+ */
+ public void setRoll(float roll) {
+ this.roll = roll;
+ }
+ /**
+ * @return the pitch
+ */
+ public float getPitch() {
+ return pitch;
+ }
+ /**
+ * @param pitch the pitch to set
+ */
+ public void setPitch(float pitch) {
+ this.pitch = pitch;
+ }
+ /**
+ * @return the yaw
+ */
+ public float getYaw() {
+ return yaw;
+ }
+ /**
+ * @param yaw the yaw to set
+ */
+ public void setYaw(float yaw) {
+ this.yaw = yaw;
+ }
+
+ @Override
+ public String toString() {
+ return "Orientation : (roll: "+roll+", pitch: "+pitch+", yaw: "+yaw+")";
+ }
+
+}
diff --git a/WiiuseJ/src/wiiusej/Point2DInteger.java b/WiiuseJ/src/wiiusej/Point2DInteger.java
new file mode 100644
index 0000000..f2f9181
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/Point2DInteger.java
@@ -0,0 +1,35 @@
+package wiiusej;
+
+import java.awt.geom.Point2D;
+
+public class Point2DInteger extends Point2D {
+ private int x;
+ private int y;
+
+ public Point2DInteger(int xx, int yy) {
+ super();
+ setLocation(xx,yy);
+ }
+
+ @Override
+ public double getX() {
+ return x;
+ }
+
+ @Override
+ public double getY() {
+ return y;
+ }
+
+ @Override
+ public void setLocation(double xx, double yy) {
+ this.x = (int)xx;
+ this.y = (int)yy;
+ }
+
+ @Override
+ public String toString() {
+ return "("+x+","+y+")";
+ }
+
+}
diff --git a/WiiuseJ/src/wiiusej/WiiMoteEvent.java b/WiiuseJ/src/wiiusej/WiiMoteEvent.java
new file mode 100644
index 0000000..663298d
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/WiiMoteEvent.java
@@ -0,0 +1,706 @@
+package wiiusej;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * Class that is a bean to be filled by the wiiuse API.
+ *
+ * @author gduche
+ *
+ */
+public class WiiMoteEvent {
+
+ /* Buttons MACRO */
+ private static short WIIMOTE_BUTTON_TWO = 0x0001;
+ private static short WIIMOTE_BUTTON_ONE = 0x0002;
+ private static short WIIMOTE_BUTTON_B = 0x0004;
+ private static short WIIMOTE_BUTTON_A = 0x0008;
+ private static short WIIMOTE_BUTTON_MINUS = 0x0010;
+ private static short WIIMOTE_BUTTON_ZACCEL_BIT6 = 0x0020;
+ private static short WIIMOTE_BUTTON_ZACCEL_BIT7 = 0x0040;
+ private static short WIIMOTE_BUTTON_HOME = 0x0080;
+ private static short WIIMOTE_BUTTON_LEFT = 0x0100;
+ private static short WIIMOTE_BUTTON_RIGHT = 0x0200;
+ private static short WIIMOTE_BUTTON_DOWN = 0x0400;
+ private static short WIIMOTE_BUTTON_UP = 0x0800;
+ private static short WIIMOTE_BUTTON_PLUS = 0x1000;
+ private static short WIIMOTE_BUTTON_ZACCEL_BIT4 = 0x2000;
+ private static short WIIMOTE_BUTTON_ZACCEL_BIT5 = 0x4000;
+ private static int WIIMOTE_BUTTON_UNKNOWN = 0x8000;
+ private static short WIIMOTE_BUTTON_ALL = 0x1F9F;
+
+ private static short WIIMOTE_LED_1 = 1;
+ private static short WIIMOTE_LED_2 = 2;
+ private static short WIIMOTE_LED_3 = 4;
+ private static short WIIMOTE_LED_4 = 8;
+
+ private static short NB_LEDS = 4;
+
+ /* ID */
+ private int wiimoteId = -1;
+
+ /* Status variables */
+ private boolean connected = false;
+
+ private float batteryLevel = -1;
+
+ private short leds = 0;
+
+ private boolean isSpeakerEnabled = false;
+
+ private boolean isThereAttachment = false;
+
+ private boolean isRumbleActive = false;
+
+ private float orientationThreshold = 0;
+
+ private boolean isContinuousActive = false;
+
+ private boolean isSmoothingActive = false;
+
+ /* Buttons */
+ private short buttonsJustPressed = 0;
+ private short buttonsJustReleased = 0;
+ private short buttonsHeld = 0;
+
+ /* IR Tracking */
+ private boolean isIrActive = false;
+ private Point2DInteger[] IRPoints;
+
+ /* Motion Sensing */
+ private boolean isMotionSensingActive = false;
+ private Orientation orientation;
+ private GForce gforce;
+
+ /**
+ * Default constructor
+ */
+ public WiiMoteEvent() {
+ // init IRPoints array
+ IRPoints = new Point2DInteger[NB_LEDS];
+ }
+
+ /**
+ * Construct the Wiimote setting up the id.
+ *
+ * @param id
+ * the Wiimote id
+ */
+ public WiiMoteEvent(int id) {
+ this();
+ wiimoteId = id;
+ }
+
+ /**
+ * Get Wiimote ID
+ *
+ * @return the wiimote id.
+ */
+ public int getWiimoteId() {
+ return wiimoteId;
+ }
+
+ /**
+ * Set Wiimote ID
+ *
+ * @param wiimoteId
+ * id of the wiimote
+ */
+ void setWiimoteId(int wiimoteId) {
+ this.wiimoteId = wiimoteId;
+ }
+
+ /**
+ * True if the wiimote is connected false otherwise.
+ *
+ * @return return the connected status.
+ */
+ public boolean isConnected() {
+ return connected;
+ }
+
+ /**
+ * Set the connected value to true.
+ */
+ void setConnected() {
+ this.connected = true;
+ }
+
+ /**
+ * Set the connected value to false.
+ */
+ void setDisconnected() {
+ this.connected = false;
+ }
+
+ /**
+ * Get battery level.
+ *
+ * @return battery level. 1 = 100%
+ */
+ public float getBatteryLevel() {
+ return batteryLevel;
+ }
+
+ /**
+ * Set level battery.
+ *
+ * @param batteryLevel
+ * must be between 0 and 1
+ */
+ void setBatteryLevel(float batteryLevel) {
+ this.batteryLevel = batteryLevel;
+ }
+
+ /**
+ * Get status of the leds .
+ *
+ * @return a short representing LEDS turned on.
+ */
+ public short getLeds() {
+ return leds;
+ }
+
+ /**
+ * Set Status of the leds.
+ *
+ * @param leds
+ */
+ void setLeds(short leds) {
+ this.leds = leds;
+ }
+
+ /**
+ * Tell if the speaker is enable for this wiimote
+ *
+ * @return TRUE if it enabled false otherwise
+ */
+ public boolean isSpeakerEnabled() {
+ return isSpeakerEnabled;
+ }
+
+ /**
+ * Set the flag for the speaker to "enabled"
+ */
+ void setSpeakerEnabled() {
+ this.isSpeakerEnabled = true;
+ }
+
+ /**
+ * Set the flag for the speaker to "disabled"
+ */
+ void setSpeakerDisabled() {
+ this.isSpeakerEnabled = false;
+ }
+
+ /**
+ * Tell if there is an attachment to the Wiimote
+ *
+ * @return TRUE if it there is one false otherwise
+ */
+ public boolean isThereAttachment() {
+ return isThereAttachment;
+ }
+
+ /**
+ * Set the flag for the attachment to true
+ */
+ void setThereIsAnAttachment() {
+ this.isThereAttachment = true;
+ }
+
+ /**
+ * Set the flag for the attachment to false
+ */
+ void setThereIsNoAttachment() {
+ this.isThereAttachment = false;
+ }
+
+ /**
+ * Get the status of rumble.
+ *
+ * @return true if the rumble is active false otherwise
+ */
+ public boolean isRumbleActive() {
+ return isRumbleActive;
+ }
+
+ /**
+ * Set Rumble flag to Active.
+ */
+ void setRumbleActive() {
+ this.isRumbleActive = true;
+ }
+
+ /**
+ * Set Rumble flag to Inactive.
+ */
+ void setRumbleInactive() {
+ this.isRumbleActive = false;
+ }
+
+ /**
+ * Get orientation threshold.
+ *
+ * @return the orientationThreshold
+ */
+ public float getOrientationThreshold() {
+ return orientationThreshold;
+ }
+
+ /**
+ * Set the orientation threshold.
+ *
+ * @param orientationThreshold
+ * the orientationThreshold to set
+ */
+ void setOrientationThreshold(float orientationThreshold) {
+ this.orientationThreshold = orientationThreshold;
+ }
+
+ /**
+ * Tell if the CONTINUOUS option is activated.
+ *
+ * @return the isContinuousActive
+ */
+ public boolean isContinuousActive() {
+ return isContinuousActive;
+ }
+
+ /**
+ * Set the CONTINUOUS option active.
+ */
+ void setContinuousActive() {
+ this.isContinuousActive = true;
+ }
+
+ /**
+ * Set the CONTINUOUS option inactive.
+ */
+ void setContinuousInactive() {
+ this.isContinuousActive = false;
+ }
+
+ /**
+ * Tell if the option SMOOTHING is activated.
+ *
+ * @return the isSmoothingActive
+ */
+ public boolean isSmoothingActive() {
+ return isSmoothingActive;
+ }
+
+ /**
+ * Set SMOOTHING option to active.
+ */
+ void setSmoothingActive() {
+ this.isSmoothingActive = true;
+ }
+
+ /**
+ * Set SMOOTHING option to inactive.
+ */
+ void setSmoothingInactive() {
+ this.isSmoothingActive = false;
+ }
+
+ /**
+ * Get the short storing the buttons just pressed
+ *
+ * @return the short storing the buttons just pressed
+ */
+ public short getButtonsJustPressed() {
+ return buttonsJustPressed;
+ }
+
+ /**
+ * set the short storing the buttons just pressed
+ *
+ * @param buttonsJustPressed
+ */
+ void setButtonsJustPressed(short buttonsJustPressed) {
+ this.buttonsJustPressed = buttonsJustPressed;
+ }
+
+ /**
+ * Get the short storing the buttons just released
+ *
+ * @return the short storing the buttons just released
+ */
+ public short getButtonsJustReleased() {
+ return buttonsJustReleased;
+ }
+
+ /**
+ * set the short storing the buttons just released
+ *
+ * @param buttonsJustReleased
+ */
+ void setButtonsJustReleased(short buttonsJustReleased) {
+ this.buttonsJustReleased = buttonsJustReleased;
+ }
+
+ /**
+ * get the short storing the buttons held
+ *
+ * @return the short storing the buttons held
+ */
+ public short getButtonsHeld() {
+ return buttonsHeld;
+ }
+
+ /**
+ * set the short storing the buttons held
+ *
+ * @param buttonsHeld
+ */
+ void setButtonsHeld(short buttonsHeld) {
+ this.buttonsHeld = buttonsHeld;
+ }
+
+ /**
+ * Tell if the IR Tracking is active.
+ *
+ * @return TRUE if it is active or false otherwise.
+ */
+ public boolean isIrActive() {
+ return isIrActive;
+ }
+
+ /**
+ * Set the value isIrActive to true
+ */
+ void setIrActive() {
+ this.isIrActive = true;
+ }
+
+ /**
+ * Set the value isIrActive to true
+ */
+ void setIrInactive() {
+ this.isIrActive = false;
+ }
+
+ /**
+ * Get list of IR points.
+ *
+ * @return the list of 2D points
+ */
+ public Point2DInteger[] getIRPoints() {
+ return IRPoints;
+ }
+
+ /**
+ * Add IR Point in the list (Max 4 points)
+ *
+ * @param x
+ * x value
+ * @param y
+ * y value
+ */
+ void addIRpoint(int x, int y) {
+ for (int i = 0; i < IRPoints.length; i++) {
+ if (IRPoints[i] == null) {
+ IRPoints[i] = new Point2DInteger(x, y);
+ return;
+ }
+ }
+ return;
+ }
+
+ /**
+ * Clear IR points.
+ */
+ void EmptyIRPoints() {
+ for (int i = 0; i < IRPoints.length; i++) {
+ IRPoints[i] = null;
+ }
+ }
+
+ /**
+ * Get the flag indicating if the motion sensing is active.
+ *
+ * @return true if the motion sensing is active false otherwise
+ */
+ public boolean isMotionSensingActive() {
+ return isMotionSensingActive;
+ }
+
+ /**
+ * Set the motion sensing flag to active.
+ */
+ void setMotionSensingActive() {
+ this.isMotionSensingActive = true;
+ }
+
+ /**
+ * Set the motion sensing flag to inactive.
+ */
+ void setMotionSensingInactive() {
+ this.isMotionSensingActive = false;
+ }
+
+ /**
+ * @return the orientation
+ */
+ public Orientation getOrientation() {
+ return orientation;
+ }
+
+ /**
+ * Set orientation of the wiimote.
+ *
+ * @param r
+ * roll
+ * @param p
+ * pitch
+ * @param y
+ * yaw
+ */
+ void setOrientation(float r, float p, float y) {
+ this.orientation = new Orientation(r, p, y);
+ }
+
+ /**
+ * Get the gravity force.
+ *
+ * @return the gforce
+ */
+ public GForce getGforce() {
+ return gforce;
+ }
+
+ /**
+ * Set the gravity force.
+ *
+ * @param x
+ * gravity force on x axis
+ * @param y
+ * gravity force on y axis
+ * @param z
+ * gravity force on z axis
+ */
+ void setGforce(float x, float y, float z) {
+ this.gforce = new GForce(x, y, z);
+ }
+
+ /** **************** BUTTONS Methods ***************** */
+ /* generic button functions */
+
+ private boolean buttonTest(short buttonBitsDefinition, short buttons) {
+ return (buttons & buttonBitsDefinition) == buttonBitsDefinition;
+ }
+
+ private boolean isButtonJustPressed(short buttonBitsDefinition) {
+ return buttonTest(buttonBitsDefinition, buttonsJustPressed)
+ && !isButtonHeld(buttonBitsDefinition);
+ }
+
+ private boolean isButtonJustReleased(short buttonBitsDefinition) {
+ return buttonTest(buttonBitsDefinition, buttonsJustReleased);
+ }
+
+ private boolean isButtonHeld(short buttonBitsDefinition) {
+ return buttonTest(buttonBitsDefinition, buttonsHeld);
+ }
+
+ /* Button ONE */
+
+ public boolean isButtonOneJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_ONE);
+ }
+
+ public boolean isButtonOneJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_ONE);
+ }
+
+ public boolean isButtonOneHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_ONE);
+ }
+
+ /* Button TWO */
+
+ public boolean isButtonTwoJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_TWO);
+ }
+
+ public boolean isButtonTwoJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_TWO);
+ }
+
+ public boolean isButtonTwoHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_TWO);
+ }
+
+ /* Button A */
+
+ public boolean isButtonAJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_A);
+ }
+
+ public boolean isButtonAJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_A);
+ }
+
+ public boolean isButtonAHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_A);
+ }
+
+ /* Button B */
+
+ public boolean isButtonBJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_B);
+ }
+
+ public boolean isButtonBJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_B);
+ }
+
+ public boolean isButtonBHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_B);
+ }
+
+ /* Button LEFT */
+
+ public boolean isButtonLeftJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_LEFT);
+ }
+
+ public boolean isButtonLeftJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_LEFT);
+ }
+
+ public boolean isButtonLeftHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_LEFT);
+ }
+
+ /* Button RIGHT */
+
+ public boolean isButtonRightJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_RIGHT);
+ }
+
+ public boolean isButtonRightJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_RIGHT);
+ }
+
+ public boolean isButtonRightHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_RIGHT);
+ }
+
+ /* Button UP */
+
+ public boolean isButtonUpJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_UP);
+ }
+
+ public boolean isButtonUpJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_UP);
+ }
+
+ public boolean isButtonUpHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_UP);
+ }
+
+ /* Button DOWN */
+
+ public boolean isButtonDownJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_DOWN);
+ }
+
+ public boolean isButtonDownJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_DOWN);
+ }
+
+ public boolean isButtonDownHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_DOWN);
+ }
+
+ /* Button - */
+
+ public boolean isButtonMinusJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_MINUS);
+ }
+
+ public boolean isButtonMinusJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_MINUS);
+ }
+
+ public boolean isButtonMinusHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_MINUS);
+ }
+
+ /* Button + */
+
+ public boolean isButtonPlusJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_PLUS);
+ }
+
+ public boolean isButtonPlusJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_PLUS);
+ }
+
+ public boolean isButtonPlusHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_PLUS);
+ }
+
+ /* Button HOME */
+
+ public boolean isButtonHomeJustPressed() {
+ return isButtonJustPressed(WIIMOTE_BUTTON_HOME);
+ }
+
+ public boolean isButtonHomeJustReleased() {
+ return isButtonJustReleased(WIIMOTE_BUTTON_HOME);
+ }
+
+ public boolean isButtonHomeHeld() {
+ return isButtonHeld(WIIMOTE_BUTTON_HOME);
+ }
+
+ @Override
+ public String toString() {
+ super.toString();
+ String out = "";
+ /* Status */
+ out += "/*********** WIIMOTE ID :" + wiimoteId + " ********/\n";
+ out += "--- connected : " + connected + "\n";
+ out += "--- Battery level : " + batteryLevel + "\n";
+ out += "= --- Leds : " + leds + "\n";
+ out += "--- Speaker enabled : " + isSpeakerEnabled + "\n";
+ out += "--- Attachment ? : " + isThereAttachment + "\n";
+ out += "--- Rumble ? : " + isRumbleActive + "\n";
+ out += "--- Orientation threshold value ? : " + orientationThreshold
+ + "\n";
+ out += "--- Continuous ? : " + isContinuousActive + "\n";
+ out += "--- Smoothing ? : " + isSmoothingActive + "\n";
+ /* Display buttons */
+ out += "/******** Buttons ********/\n";
+ out += "--- Buttons just pressed : " + buttonsJustPressed + "\n";
+ out += "--- Buttons just released : " + buttonsJustReleased + "\n";
+ out += "--- Buttons held : " + buttonsHeld + "\n";
+
+ /* Display IR Tracking */
+ out += "/******** IR Tracking ********/\n";
+ out += "--- Active : " + isIrActive + "\n";
+ if (isIrActive) {
+ out += "--- Seen points\n";
+ for (int i = 0; i < IRPoints.length; i++) {
+ if (IRPoints[i] != null) {
+ out += IRPoints[i].toString();
+ }
+ }
+ }
+
+ /* Motion sensing */
+ out += "/******** Motion sensing ********/\n";
+ out += "--- Motion sensing : " + isMotionSensingActive + "\n";
+ if (isMotionSensingActive) {
+ out += "--- " + orientation + "\n";
+ out += "--- " + gforce + "\n";
+ }
+ return out;
+ }
+
+}
diff --git a/WiiuseJ/src/wiiusej/WiiUseApi.java b/WiiuseJ/src/wiiusej/WiiUseApi.java
new file mode 100644
index 0000000..091f269
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/WiiUseApi.java
@@ -0,0 +1,174 @@
+package wiiusej;
+
+/**
+ * Singleton used to manipulate WiiUse Api.
+ * @author gduche
+ *
+ */
+public class WiiUseApi {
+
+ static {
+ System.loadLibrary("libWiiuseJ");
+ }
+
+ private static WiiUseApi instance = new WiiUseApi();
+
+ /**
+ * Get the only instance of WiiUseApi.
+ * @return
+ */
+ static WiiUseApi getInstance(){
+ return instance;
+ }
+
+ /**
+ * Load the library.
+ *
+ * @return 0 if there is an error, 1 if everything is ok.
+ */
+ native int loadLibrary();
+
+ /**
+ * Try to connect to 2 wiimotes. Make them rumble to show they are
+ * connected.
+ *
+ * @return 0 if there is an error otherwise it returns the number of
+ * wiimotes connected.
+ */
+ native int doConnections();
+
+ /**
+ * Close connection to the wiimote with the given id.
+ *
+ */
+ native void closeConnection(int id);
+
+ /**
+ * Shutdown Wiiuse API.
+ * @return 0 if there is an error, 1 if everything is ok.
+ */
+ native void shutdownApi();
+
+ /**
+ * Activate rumble on the wiimote with the given id.
+ * @param id the id of the wiimote.
+ */
+ native void activateRumble(int id);
+
+ /**
+ * Deactivate rumble on the wiimote with the given id.
+ *
+ * @param id the id of the wiimote.
+ */
+ native void deactivateRumble(int id);
+
+ /**
+ * Activate IR Tracking on the wiimote with the given id.
+ * @param id the id of the wiimote.
+ */
+ native void activateIRTracking(int id);
+
+ /**
+ * Deactivate IR Tracking on the wiimote with the given id.
+ * @param id the id of the wiimote.
+ */
+ native void deactivateIRTracking(int id);
+
+ /**
+ * Activate motion sensing on the wiimote with the given id.
+ * @param id the id of the wiimote.
+ */
+ native void activateMotionSensing(int id);
+
+ /**
+ * Deactivate motion sensing on the wiimote with the given id.
+ * @param id the id of the wiimote.
+ */
+ native void deactivateMotionSensing(int id);
+
+ /**
+ * Set wiimote leds status.
+ * @param id the id of the wiimote concerned
+ * @param led1 status of led1: True=ON, False=OFF
+ * @param led2 status of led2: True=ON, False=OFF
+ * @param led3 status of led3: True=ON, False=OFF
+ * @param led4 status of led4: True=ON, False=OFF
+ */
+ native void setLeds(int id, boolean led1, boolean led2, boolean led3, boolean led4);
+
+ /**
+ * Set how many degrees an angle must change to generate an event.
+ * @param id id of the wiimote concerned
+ * @param angle minimum angle detected by an event
+ */
+ native void setOrientThreshold(int id, float angle);
+
+ /**
+ * Make the the accelerometers give smoother results.
+ * This is set by default.
+ * @param id the id of the wiimote concerned
+ */
+ native void activateSmoothing(int id);
+
+ /**
+ * Make the the accelerometers give raw results.
+ * @param id the id of the wiimote concerned
+ */
+ native void deactivateSmoothing(int id);
+
+ /**
+ * Make the wiimote generate an event each time we poll.
+ * Not set by default.
+ * @param id the id of the wiimote concerned
+ */
+ native void activateContinuous(int id);
+
+ /**
+ * Make the wiimote generate an event only when there is one.
+ * @param id the id of the wiimote concerned
+ */
+ native void deactivateContinuous(int id);
+
+ /**
+ * Get status and values from the wiimotes and send it through callbacks.
+ *
+ * @param id the id of the wiimote of which we want the status.
+ */
+ native void getStatus(int id);
+
+ /**
+ * Get status and values from the wiimotes and send it through callbacks.
+ *
+ * @param mote The WiimoteEvent object to fill with the datas.
+ */
+ native void specialPoll(WiiMoteEvent mote);
+
+
+ /* Tests */
+ public static void main(String[] args) {
+
+ /* Test JNI Side */
+ WiiUseApi manager = new WiiUseApi();
+
+ int value = manager.loadLibrary();
+ System.out.println("loadLibrary : " + value);
+
+ value = manager.doConnections();
+ System.out.println("doConnections : " + value);
+
+ WiiMoteEvent mote = new WiiMoteEvent();
+
+ manager.getStatus(1);
+ System.out.println("Status : \n" + mote);
+
+ System.out.println("");
+ System.out.println("!!!!!!!!!!!!!! Polling !!!!!!!!!");
+ while (true) {
+ manager.specialPoll(mote);
+ System.out.println(mote);
+ mote.EmptyIRPoints();
+ }
+ // manager.closeConnectionsAndShutDown();
+ }
+
+}
diff --git a/WiiuseJ/src/wiiusej/WiiUseApiListener.java b/WiiuseJ/src/wiiusej/WiiUseApiListener.java
new file mode 100644
index 0000000..81f3792
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/WiiUseApiListener.java
@@ -0,0 +1,9 @@
+package wiiusej;
+
+
+
+public interface WiiUseApiListener extends java.util.EventListener {
+
+ void wiimoteEvent(WiiMoteEvent e);
+
+}
diff --git a/WiiuseJ/src/wiiusej/WiiUseApiManager.java b/WiiuseJ/src/wiiusej/WiiUseApiManager.java
new file mode 100644
index 0000000..178e0c4
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/WiiUseApiManager.java
@@ -0,0 +1,374 @@
+package wiiusej;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.swing.event.EventListenerList;
+
+/**
+ * Class that manage the use of Wiiuse API.
+ *
+ * @author gduche
+ *
+ */
+public class WiiUseApiManager extends Thread {
+
+ private static WiiUseApiManager instance = new WiiUseApiManager();
+
+ private final EventListenerList listeners = new EventListenerList();
+
+ private WiiUseApi wiiuse = WiiUseApi.getInstance();
+
+ private boolean loaded = false;
+
+ private int connected = 0;
+
+ private AtomicBoolean running = new AtomicBoolean(false);
+
+ private ConcurrentLinkedQueue requests = new ConcurrentLinkedQueue();
+
+ public static WiiUseApiManager getInstance() {
+ return instance;
+ }
+
+ /**
+ * Load the wiimote library.
+ *
+ * @return false if the library is not loaded true otherwise.
+ */
+ public boolean loadLibrary() {
+ if (!loaded) {// not yet loaded try to load it
+ int load = wiiuse.loadLibrary();
+ if (load > 0) {
+ loaded = true;
+ return true;
+ } else {
+ loaded = false;
+ System.out.println("Error loading the Wiimote library !!!");
+ return false;
+ }
+ }
+ // already loaded
+ return loaded;
+ }
+
+ /**
+ * Connect wiimote and get the nu ber of wiimotes connected. Supposed to be
+ * used once.
+ *
+ * @return 0 if nothing connected or the number of wiimotes connected.
+ */
+ public int connectWiimotes() {
+ if (loaded) {
+ connected = wiiuse.doConnections();
+ System.out.println(connected + " wiimote(s) connected !!!");
+ return connected;
+ } else {// library not loaded, no wiimotes connected
+ return 0;
+ }
+ }
+
+ /**
+ * Ask the thread to close a connection.
+ *
+ * @param id
+ * id of the wiimote to disconnect.
+ */
+ public void closeConnection(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_CLOSE_CONNECTION_REQUEST));
+ }
+
+ /**
+ * Get the number of wiimotes connected.
+ *
+ * @return the number of wiimotes connected.
+ */
+ public int getNbConnectedWiimotes() {
+ return connected;
+ }
+
+ /**
+ * Stop thread and shutdown wiiuse Api.
+ */
+ public void shutdown() {
+ running.set(false);
+ wiiuse.shutdownApi();
+ }
+
+ /**
+ * Activate the rumble for the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void activateRumble(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_ACTIVATE_RUMBLE_REQUEST));
+ }
+
+ /**
+ * Deactivate the rumble for the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void deactivateRumble(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_DEACTIVATE_RUMBLE_REQUEST));
+ }
+
+ /**
+ * Activate IR Tracking for the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void activateIRTRacking(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_ACTIVATE_IR_TRACKING_REQUEST));
+ }
+
+ /**
+ * Deactivate IR Tracking for the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void deactivateIRTRacking(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_DEACTIVATE_IR_TRACKING_REQUEST));
+ }
+
+ /**
+ * Activate IR Tracking of the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void activateMotionSensing(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_ACTIVATE_MOTION_SENSING_REQUEST));
+ }
+
+ /**
+ * Deactivate IR Tracking of the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void deactivateMotionSensing(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_DEACTIVATE_MOTION_SENSING_REQUEST));
+ }
+
+ /**
+ * Activate smoothing the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void activateSmoothing(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_ACTIVATE_SMOOTHING_REQUEST));
+ }
+
+ /**
+ * Deactivate smoothing the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void deactivateSmoothing(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_DEACTIVATE_SMOOTHING_REQUEST));
+ }
+
+ /**
+ * Activate continuous for the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote.
+ */
+ public void activateContinuous(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_ACTIVATE_CONTINUOUS_REQUEST));
+ }
+
+ /**
+ * Deactivate continuous for the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote
+ */
+ public void deactivateContinuous(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_DEACTIVATE_CONTINUOUS_REQUEST));
+ }
+
+ /**
+ * Set leds for the wiimotes with the given id.
+ *
+ * @param id
+ * id of the wiimote
+ * @param l1
+ * status of led1. True : ON, False : OFF
+ * @param l2
+ * status of led2. True : ON, False : OFF
+ * @param l3
+ * status of led3. True : ON, False : OFF
+ * @param l4
+ * status of led4. True : ON, False : OFF
+ */
+ public void setLeds(int id, boolean l1, boolean l2, boolean l3, boolean l4) {
+ requests.add(new LedsRequest(id, WiiUseApiRequest.WIIUSE_LEDS_REQUEST,
+ l1, l2, l3, l4));
+ }
+
+ /**
+ * Set the orientation threshold for the given id.
+ *
+ * @param id
+ * id of the wiimote
+ * @param th
+ * threshold in degrees
+ */
+ public void setOrientationThreshold(int id, float th) {
+ requests.add(new OrientThresholdRequest(id,
+ WiiUseApiRequest.WIIUSE_ORIENT_THRESHOLHD_REQUEST, th));
+ }
+
+ /**
+ * Get Status for the wiimote for the given id.
+ *
+ * @param id
+ * id of the wiimote
+ */
+ public void getStatus(int id) {
+ requests.add(new WiiUseApiRequest(id,
+ WiiUseApiRequest.WIIUSE_STATUS_REQUEST));
+ }
+
+ @Override
+ public void run() {
+
+ if (loaded && (connected > 0)) {
+ running.set(true);
+
+ WiiMoteEvent evt = new WiiMoteEvent();
+
+ // Start polling and tell the observers when there Wiimote events
+ while (running.get()) {
+ WiiUseApiRequest req = requests.poll();
+ if (req != null) {// there is a request for the wiiuse api
+ int id = req.getId();
+ if (req.getRequestType() == WiiUseApiRequest.WIIUSE_CLOSE_CONNECTION_REQUEST) {
+ /* Close connections requests */
+ wiiuse.closeConnection(id);
+ connected--;
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_STATUS_REQUEST) {
+ /* Status requests */
+ wiiuse.getStatus(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_ACTIVATE_RUMBLE_REQUEST) {
+ /* Activate Rumble requests */
+ wiiuse.activateRumble(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_DEACTIVATE_RUMBLE_REQUEST) {
+ /* Deactivate Rumble requests */
+ wiiuse.deactivateRumble(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_ACTIVATE_IR_TRACKING_REQUEST) {
+ /* Activate IR Tracking requests */
+ wiiuse.activateIRTracking(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_DEACTIVATE_IR_TRACKING_REQUEST) {
+ /* Deactivate IR Tracking requests */
+ wiiuse.deactivateIRTracking(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_ACTIVATE_MOTION_SENSING_REQUEST) {
+ /* Activate Motion sensing requests */
+ wiiuse.activateMotionSensing(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_DEACTIVATE_MOTION_SENSING_REQUEST) {
+ /* Deactivate Motion sensing requests */
+ wiiuse.deactivateMotionSensing(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_LEDS_REQUEST) {
+ /* leds requests */
+ LedsRequest reqLed = (LedsRequest) req;
+ wiiuse.setLeds(id, reqLed.isLed1(), reqLed.isLed2(),
+ reqLed.isLed3(), reqLed.isLed4());
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_ACTIVATE_SMOOTHING_REQUEST) {
+ /* Activate smoothing requests */
+ wiiuse.activateSmoothing(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_DEACTIVATE_SMOOTHING_REQUEST) {
+ /* Deactivate smoothing requests */
+ wiiuse.deactivateSmoothing(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_ACTIVATE_CONTINUOUS_REQUEST) {
+ /* Activate continuous requests */
+ wiiuse.activateContinuous(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_DEACTIVATE_CONTINUOUS_REQUEST) {
+ /* Deactivate continuous requests */
+ wiiuse.deactivateContinuous(id);
+ } else if (req.getRequestType() == WiiUseApiRequest.WIIUSE_ORIENT_THRESHOLHD_REQUEST) {
+ /* set orientation request */
+ wiiuse.setOrientThreshold(req.getId(),
+ ((OrientThresholdRequest) req).getThresholhd());
+ } else {
+ System.out.println("Bad request to Wiiuse API !!!!!");
+ }
+ }
+
+ /* Polling */
+ wiiuse.specialPoll(evt);
+
+ if (evt.getWiimoteId() != -1) {// there is an event notify
+ // observers
+ notifyWiiUseApiListener(evt);
+ }
+ if (evt.getWiimoteId() != -1) {// create a new event when the last event created was filled
+ if (!evt.isConnected()){//check if it was a disconnection
+ connected --;
+ if (connected == 0){
+ System.out.println("No more wiimotes connected !!!");
+ }
+ }
+ evt = new WiiMoteEvent();
+ }
+ }
+
+ } else {
+ System.out.println("No polling possible !!!");
+ }
+
+ }
+
+ /**
+ *
+ * @param listener
+ */
+ public void addWiiUseApiListener(WiiUseApiListener listener) {
+ listeners.add(WiiUseApiListener.class, listener);
+ }
+
+ /**
+ *
+ * @param listener
+ */
+ public void removeWiiUseApiListener(WiiUseApiListener listener) {
+ listeners.remove(WiiUseApiListener.class, listener);
+ }
+
+ /**
+ *
+ * @return
+ */
+ public WiiUseApiListener[] getWiiUseApiListeners() {
+ return listeners.getListeners(WiiUseApiListener.class);
+ }
+
+ /**
+ *
+ * @param evt
+ */
+ public void notifyWiiUseApiListener(WiiMoteEvent evt) {
+ for (WiiUseApiListener listener : getWiiUseApiListeners()) {
+ listener.wiimoteEvent(evt);
+ }
+ }
+
+}
diff --git a/WiiuseJ/src/wiiusej/WiiUseApiRequest.java b/WiiuseJ/src/wiiusej/WiiUseApiRequest.java
new file mode 100644
index 0000000..56998c7
--- /dev/null
+++ b/WiiuseJ/src/wiiusej/WiiUseApiRequest.java
@@ -0,0 +1,82 @@
+package wiiusej;
+
+/**
+ * Represents a request we could do to the WiiUse API.
+ * @author gduche
+ *
+ */
+public class WiiUseApiRequest {
+
+ public static int WIIUSE_STATUS_REQUEST=1;
+ public static int WIIUSE_ACTIVATE_SMOOTHING_REQUEST=2;
+ public static int WIIUSE_DEACTIVATE_SMOOTHING_REQUEST=-2;
+ public static int WIIUSE_ACTIVATE_IR_TRACKING_REQUEST=3;
+ public static int WIIUSE_DEACTIVATE_IR_TRACKING_REQUEST=-3;
+ public static int WIIUSE_ACTIVATE_MOTION_SENSING_REQUEST=4;
+ public static int WIIUSE_DEACTIVATE_MOTION_SENSING_REQUEST=-4;
+ public static int WIIUSE_CLOSE_CONNECTION_REQUEST=5;
+ public static int WIIUSE_ACTIVATE_CONTINUOUS_REQUEST=6;
+ public static int WIIUSE_DEACTIVATE_CONTINUOUS_REQUEST=-6;
+ public static int WIIUSE_ACTIVATE_RUMBLE_REQUEST=7;
+ public static int WIIUSE_DEACTIVATE_RUMBLE_REQUEST=-7;
+ public static int WIIUSE_LEDS_REQUEST=8;
+ public static int WIIUSE_ORIENT_THRESHOLHD_REQUEST=9;
+
+
+ private int wiimoteId=0;
+ private int requestType=0;
+
+ /**
+ * Constructor setting the id of the wiimote concerned.
+ * @param id the id of the wiimote concerned.
+ */
+ public WiiUseApiRequest(int id){
+ wiimoteId = id;
+ }
+
+ /**
+ * Constructor setting the id of the wiimote concerned.
+ * @param id the id of the wiimote concerned.
+ *
+ */
+ public WiiUseApiRequest(int id, int type){
+ wiimoteId = id;
+ requestType = type;
+ }
+
+ /**
+ * Get id of the wiimote concerned by this request.
+ * @return id of the wiimote concerned
+ */
+ public int getId(){
+ return wiimoteId;
+ }
+
+ /**
+ * Set id of the wiimote concerned by this request.
+ * @param id id fh the wiimote concernet
+ */
+ public void setId(int id){
+ wiimoteId = id;
+ }
+
+ /**
+ * Get the request type.
+ * @return the requestType
+ */
+ public int getRequestType() {
+ return requestType;
+ }
+
+ /**
+ * Set the request type.
+ * @param requestType the requestType to set
+ */
+ public void setRequestType(int requestType) {
+ this.requestType = requestType;
+ }
+
+
+
+}
+
diff --git a/WiiuseJ/wiiuse.dll b/WiiuseJ/wiiuse.dll
new file mode 100644
index 0000000..c6ea93f
Binary files /dev/null and b/WiiuseJ/wiiuse.dll differ