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

View File

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

View File

@@ -85,6 +85,5 @@ public class JIntellitypeDevice extends Device implements HotkeyListener, Intell
jit.removeHotKeyListener(this); jit.removeHotKeyListener(this);
jit.removeIntellitypeListener(this); jit.removeIntellitypeListener(this);
jit.cleanUp(); 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() { public final void run() {
System.out.println(this);
while (run) { while (run) {
if (eventQueue.isEmpty()) { if (eventQueue.isEmpty()) {
sleep(); sleep();

View File

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