Miniscule aanpassingen

This commit is contained in:
2011-04-25 14:39:12 +00:00
parent 10ec337a51
commit 12467a043e
5 changed files with 11 additions and 16 deletions

View File

@@ -17,12 +17,12 @@ import pm.macro.state.Release;
public abstract class Device extends EventListener {
protected SequenceListener sequenceListener;
protected InterruptListener interruptListener;
//protected InterruptListener interruptListener;
public Device() {
super();
sequenceListener = new SequenceListener(this);
interruptListener = new InterruptListener(this);
//interruptListener = new InterruptListener(this);
}
/* Register macro's */
@@ -72,10 +72,10 @@ public abstract class Device extends EventListener {
add(new Press(button), new Release(button), continuous);
}
/* Register interruptibles */
/* Register interruptibles *
protected void add(Interruptible interruptible) {
interruptListener.add(interruptible);
}
}*/
/* Recognize events */
protected void add(State state) {

View File

@@ -117,9 +117,7 @@ public class Main extends EventListener {
for (Application application : applicationCycle) {
try {
application.exit();
} catch (ApplicationExitException e) {
e.printStackTrace();
}
} catch (ApplicationExitException e) {}
}
System.out.println("Exit main...");
stop();

View File

@@ -85,6 +85,5 @@ public class JIntellitypeDevice extends Device implements HotkeyListener, Intell
jit.removeHotKeyListener(this);
jit.removeIntellitypeListener(this);
jit.cleanUp();
System.out.println("klaar" + run);
}
}

View File

@@ -16,7 +16,6 @@ public abstract class EventListener extends Listener implements Runnable {
}
public final void run() {
System.out.println(this);
while (run) {
if (eventQueue.isEmpty()) {
sleep();

View File

@@ -10,20 +10,20 @@ import pm.event.task.Stopper;
import pm.value.Target;
public class EventManager {
protected static ArrayList<EventListener> taskListenerList;
protected static ArrayList<EventListener> eventListenerList;
protected static ApplicationCycle applicationCycle;
public static void initialise(ApplicationCycle applicationCycle) {
taskListenerList = new ArrayList<EventListener>();
eventListenerList = new ArrayList<EventListener>();
EventManager.applicationCycle = applicationCycle;
}
public static void add(EventListener eventListener) {
taskListenerList.add(eventListener);
eventListenerList.add(eventListener);
}
public static void add(Feedback feedback) {
for (EventListener eventListener : taskListenerList) {
for (EventListener eventListener : eventListenerList) {
eventListener.add(feedback);
}
}
@@ -44,7 +44,7 @@ public class EventManager {
}
break;
default:
for (EventListener eventListener : taskListenerList) {
for (EventListener eventListener : eventListenerList) {
switch (target) {
case ALL:
eventListener.add(task);
@@ -65,7 +65,6 @@ public class EventManager {
}
break;
}
break;
}
}
}
@@ -78,6 +77,6 @@ public class EventManager {
}
public static void remove(EventListener eventListener) {
taskListenerList.remove(eventListener);
eventListenerList.remove(eventListener);
}
}