Structuur consequenter gemaakt met initialise en exit methoden. De start methode wordt gereserveerd voor wanneer er een Thread moet worden gestart. Exceptions georganiseerd, hierbij opletten op het doorgeven van exceptions vanuit Threads! Poging tot het dynamisch toevoegen van devices is niet helemaal gelukt.

This commit is contained in:
2011-02-11 19:32:47 +00:00
parent c25e293c85
commit 2061376efe
26 changed files with 203 additions and 110 deletions

View File

@@ -24,8 +24,8 @@ public class WiimoteDevice extends Device {
wiimote = wiimoteService.getDevice(this);
}
public void start() {
super.start();
public void initialise() {
super.initialise();
try {
add(
new Press(WiimoteButton.A),

View File

@@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import pm.exception.DeviceException;
import pm.exception.device.JavaInputDeviceNotFoundException;
import pm.exception.device.javainput.JavaInputDeviceSpecificException;
import wiiusej.WiiUseApiManager;
import wiiusej.Wiimote;
import wiiusej.wiiusejevents.GenericEvent;
@@ -54,7 +54,7 @@ public class WiimoteService extends WiiUseApiManager implements WiimoteListener
return wiimote;
}
}
throw new JavaInputDeviceNotFoundException();
throw new JavaInputDeviceSpecificException();
}
public Wiimote getWiimote(GenericEvent event) {