From 937b29bc3b3d33d2928956ceacbfe55ef77346de Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Wed, 13 Nov 2013 17:53:57 +0100
Subject: NEWT: Add more documentation to WindowImpl's doPointerEvent(..) and
consumePointerEvent(..) impl. details
---
src/newt/classes/jogamp/newt/WindowImpl.java | 55 +++++++++++++++++++++++-----
1 file changed, 46 insertions(+), 9 deletions(-)
(limited to 'src/newt/classes')
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 77c19ae05..246c288d0 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -2416,6 +2416,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* using a hash-map if normalPNames
is false
.
* Otherwise a simple int
to short
type cast is performed.
*
+ *
+ * See {@link #doPointerEvent(boolean, boolean, PointerType[], short, int, int, short[], int[], int[], float[], float, float[], float)}
+ * for details!
+ *
*
* @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
* otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
@@ -2469,11 +2473,29 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/**
- * Send multiple-pointer event either to be directly consumed or to be enqueued
+ * Send multiple-pointer event either to be directly consumed or to be enqueued.
+ *
+ * Pointer/Mouse Processing Pass 1 (Pass 2 is performed in {@link #consumePointerEvent(MouseEvent)}.
+ *
+ *
+ * Usually directly called by event source to enqueue and process event.
+ *
*
* The index for the element of multiple-pointer arrays represents the pointer which triggered the event
* is passed via actionIdx.
*
+ *
+ *
+ * - Determine ENTERED/EXITED state
+ * - Remove redundant move/drag events
+ * - Reset states if applicable
+ * - Drop exterior events
+ * - Determine CLICK COUNT
+ * - Ignore sent CLICKED
+ * - Track buttonPressed incl. buttonPressedMask
+ * - Synthesize DRAGGED event (from MOVED if pointer is pressed)
+ *
+ *
*
* @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
* otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
@@ -2584,6 +2606,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
+ //
+ // Drop exterior events
+ //
if( x < 0 || y < 0 || x >= getWidth() || y >= getHeight() ) {
if(DEBUG_MOUSE_EVENT) {
System.err.println("doPointerEvent: drop: "+MouseEvent.getEventTypeString(eventType)+
@@ -2614,7 +2639,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// - Determine CLICK COUNT
// - Ignore sent CLICKED
// - Track buttonPressed incl. buttonPressedMask
- // - Fix MOVED/DRAGGED event
+ // - Synthesize DRAGGED event (from MOVED if pointer is pressed)
//
final MouseEvent e;
switch( eventType ) {
@@ -2795,13 +2820,22 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/**
- * Consume the {@link MouseEvent}, i.e.
- *
- * - validate
- * - handle gestures
- * - synthesize events if applicable (like gestures)
- * - dispatch event to listener
- *
+ * Consume the {@link MouseEvent}.
+ *
+ * Pointer/Mouse Processing Pass 2 (Pass 1 is performed in {@link #doPointerEvent(boolean, boolean, PointerType[], short, int, int, short[], int[], int[], float[], float, float[], float)}).
+ *
+ *
+ * Invoked before dispatching the dequeued event.
+ *
+ *
+ *
+ * - Validate
+ * - Handle gestures
+ * - Synthesize events ENTERED, CLICK and gestures.
+ * - Drop exterior events
+ * - Dispatch event to listener
+ *
+ *
*/
protected void consumePointerEvent(MouseEvent pe) {
int x = pe.getX();
@@ -2845,6 +2879,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
dispatchMouseEvent(eEntered);
} else if( x < 0 || y < 0 || x >= getWidth() || y >= getHeight() ) {
+ //
+ // Drop exterior events
+ //
if(DEBUG_MOUSE_EVENT) {
System.err.println("consumePointerEvent.drop: "+pe);
}
--
cgit v1.2.3