return sessionInfo;
}
+ /**
+ * The listening object that run() wakes up on new input.
+ */
+ private Object listener;
+
/**
* The event queue, filled up by a thread reading on input.
*/
/**
* Constructor sets up state for getEvent().
*
+ * @param listener the object this backend needs to wake up when new
+ * input comes in
* @param screen the top-level AWT frame
*/
- public AWTTerminal(final AWTScreen screen) {
+ public AWTTerminal(final Object listener, final AWTScreen screen) {
+ this.listener = listener;
this.screen = screen;
mouse1 = false;
mouse2 = false;
}
}
- /**
- * Return any events in the IO queue due to timeout.
- *
- * @param queue list to append new events to
- */
- public void getIdleEvents(final List<TInputEvent> queue) {
-
- // Insert any polling action here...
-
- // Return any events that showed up
- synchronized (eventQueue) {
- if (eventQueue.size() > 0) {
- synchronized (queue) {
- queue.addAll(eventQueue);
- }
- eventQueue.clear();
- }
- }
- }
-
/**
* Pass AWT keystrokes into the event queue.
*
synchronized (eventQueue) {
eventQueue.add(new TKeypressEvent(keypress));
}
- // Wake up the backend
- synchronized (this) {
- this.notifyAll();
+ synchronized (listener) {
+ listener.notifyAll();
}
}
synchronized (eventQueue) {
eventQueue.add(new TCommandEvent(cmAbort));
}
- // Wake up the backend
- synchronized (this) {
- this.notifyAll();
+ synchronized (listener) {
+ listener.notifyAll();
}
}
sessionInfo.getWindowWidth(), sessionInfo.getWindowHeight());
eventQueue.add(windowResize);
}
- // Wake up the backend
- synchronized (this) {
- this.notifyAll();
+ synchronized (listener) {
+ listener.notifyAll();
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
}
- // Wake up the backend
- synchronized (this) {
- this.notifyAll();
+ synchronized (listener) {
+ listener.notifyAll();
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
}
- // Wake up the backend
- synchronized (this) {
- this.notifyAll();
+ synchronized (listener) {
+ listener.notifyAll();
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
}
- // Wake up the backend
- synchronized (this) {
- this.notifyAll();
+ synchronized (listener) {
+ listener.notifyAll();
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
}
- // Wake up the backend
- synchronized (this) {
- this.notifyAll();
+ synchronized (listener) {
+ listener.notifyAll();
}
}
synchronized (eventQueue) {
eventQueue.add(mouseEvent);
}
- // Wake up the backend
- synchronized (this) {
- this.notifyAll();
+ synchronized (listener) {
+ listener.notifyAll();
}
}