aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/event/GestureHandler.java8
-rw-r--r--src/newt/classes/com/jogamp/newt/event/InputEvent.java24
-rw-r--r--src/newt/classes/com/jogamp/newt/event/KeyEvent.java12
-rw-r--r--src/newt/classes/com/jogamp/newt/event/MonitorEvent.java4
-rw-r--r--src/newt/classes/com/jogamp/newt/event/MouseEvent.java36
-rw-r--r--src/newt/classes/com/jogamp/newt/event/NEWTEvent.java8
-rw-r--r--src/newt/classes/com/jogamp/newt/event/OutputEvent.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/event/WindowEvent.java4
-rw-r--r--src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java2
9 files changed, 52 insertions, 48 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/GestureHandler.java b/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
index 2e98a8a01..89f5e42d2 100644
--- a/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
+++ b/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
@@ -61,7 +61,7 @@ public interface GestureHandler {
* @param modifiers
* @param handler
*/
- public GestureEvent(Object source, long when, int modifiers, GestureHandler handler) {
+ public GestureEvent(final Object source, final long when, final int modifiers, final GestureHandler handler) {
super(EVENT_GESTURE_DETECTED, source, when, modifiers);
this.handler = handler;
}
@@ -74,13 +74,17 @@ public interface GestureHandler {
* @param modifiers
* @param handler
*/
- public GestureEvent(short event_type, Object source, long when, int modifiers, GestureHandler handler) {
+ public GestureEvent(final short event_type, final Object source, final long when, final int modifiers, final GestureHandler handler) {
super(event_type, source, when, modifiers);
this.handler = handler;
}
/** Return the {@link GestureHandler}, which produced the event. */
public final GestureHandler getHandler() { return handler; }
+
+ public String toString() {
+ return "GestureEvent[handler "+handler+"]";
+ }
}
/**
diff --git a/src/newt/classes/com/jogamp/newt/event/InputEvent.java b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
index f29b632e8..7889098ea 100644
--- a/src/newt/classes/com/jogamp/newt/event/InputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
@@ -84,56 +84,56 @@ public abstract class InputEvent extends NEWTEvent
* null is returned.
* </p>
*/
- public static final int getButtonMask(int button) {
+ public static final int getButtonMask(final int button) {
if( 0 < button && button <= MouseEvent.BUTTON_COUNT ) {
return 1 << ( 4 + button ) ;
}
return 0;
}
- protected InputEvent(short eventType, Object source, long when, int modifiers) {
+ protected InputEvent(final short eventType, final Object source, final long when, final int modifiers) {
super(eventType, source, when);
this.modifiers=modifiers;
}
/** Return the modifier bits of this event, e.g. see {@link #SHIFT_MASK} .. etc. */
- public int getModifiers() {
+ public final int getModifiers() {
return modifiers;
}
/** {@link #getModifiers()} contains {@link #ALT_MASK}. */
- public boolean isAltDown() {
+ public final boolean isAltDown() {
return (modifiers&ALT_MASK)!=0;
}
/** {@link #getModifiers()} contains {@link #ALT_GRAPH_MASK}. */
- public boolean isAltGraphDown() {
+ public final boolean isAltGraphDown() {
return (modifiers&ALT_GRAPH_MASK)!=0;
}
/** {@link #getModifiers()} contains {@link #CTRL_MASK}. */
- public boolean isControlDown() {
+ public final boolean isControlDown() {
return (modifiers&CTRL_MASK)!=0;
}
/** {@link #getModifiers()} contains {@link #META_MASK}. */
- public boolean isMetaDown() {
+ public final boolean isMetaDown() {
return (modifiers&META_MASK)!=0;
}
/** {@link #getModifiers()} contains {@link #SHIFT_MASK}. */
- public boolean isShiftDown() {
+ public final boolean isShiftDown() {
return (modifiers&SHIFT_MASK)!=0;
}
/** {@link #getModifiers()} contains {@link #AUTOREPEAT_MASK}. */
- public boolean isAutoRepeat() {
+ public final boolean isAutoRepeat() {
return (modifiers&AUTOREPEAT_MASK)!=0;
}
/** {@link #getModifiers()} contains {@link #CONFINED_MASK}. Pointer is confined, see {@link Window#confinePointer(boolean)}. */
- public boolean isConfined() {
+ public final boolean isConfined() {
return (modifiers&CONFINED_MASK)!=0;
}
/** {@link #getModifiers()} contains {@link #INVISIBLE_MASK}. Pointer is invisible, see {@link Window#setPointerVisible(boolean)}. */
- public boolean isInvisible() {
+ public final boolean isInvisible() {
return (modifiers&INVISIBLE_MASK)!=0;
}
- public StringBuilder getModifiersString(StringBuilder sb) {
+ public final StringBuilder getModifiersString(StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
}
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
index 49aa4e054..8cdfb0db3 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
@@ -118,7 +118,7 @@ import com.jogamp.common.util.IntBitfield;
@SuppressWarnings("serial")
public class KeyEvent extends InputEvent
{
- private KeyEvent(short eventType, Object source, long when, int modifiers, short keyCode, short keySym, int keySymModMask, char keyChar) {
+ private KeyEvent(final short eventType, final Object source, final long when, final int modifiers, final short keyCode, final short keySym, final int keySymModMask, final char keyChar) {
super(eventType, source, when, modifiers | keySymModMask);
this.keyCode=keyCode;
this.keySym=keySym;
@@ -148,7 +148,7 @@ public class KeyEvent extends InputEvent
}
}
- public static KeyEvent create(short eventType, Object source, long when, int modifiers, short keyCode, short keySym, char keyChar) {
+ public static KeyEvent create(final short eventType, final Object source, final long when, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
return new KeyEvent(eventType, source, when, modifiers, keyCode, keySym, getModifierMask(keySym), keyChar);
}
@@ -211,7 +211,7 @@ public class KeyEvent extends InputEvent
return super.toString(sb).append("]");
}
- public static String getEventTypeString(short type) {
+ public static String getEventTypeString(final short type) {
switch(type) {
case EVENT_KEY_PRESSED: return "EVENT_KEY_PRESSED";
case EVENT_KEY_RELEASED: return "EVENT_KEY_RELEASED";
@@ -224,7 +224,7 @@ public class KeyEvent extends InputEvent
* however, lower case a-z is mapped to {@link KeyEvent#VK_A} - {@link KeyEvent#VK_Z}.
* @return {@link KeyEvent} virtual key (VK) value.
*/
- public static short utf16ToVKey(char keyChar) {
+ public static short utf16ToVKey(final char keyChar) {
if( 'a' <= keyChar && keyChar <= 'z' ) {
return (short) ( ( keyChar - 'a' ) + KeyEvent.VK_A );
}
@@ -237,7 +237,7 @@ public class KeyEvent extends InputEvent
* A modifier key is one of {@link #VK_SHIFT}, {@link #VK_CONTROL}, {@link #VK_ALT}, {@link #VK_ALT_GRAPH}, {@link #VK_META}.
* </p>
*/
- public static boolean isModifierKey(short vKey) {
+ public static boolean isModifierKey(final short vKey) {
switch (vKey) {
case VK_SHIFT:
case VK_CONTROL:
@@ -254,7 +254,7 @@ public class KeyEvent extends InputEvent
* If <code>vKey</code> is a {@link #isModifierKey() modifier key}, method returns the corresponding modifier mask,
* otherwise 0.
*/
- public static int getModifierMask(short vKey) {
+ public static int getModifierMask(final short vKey) {
switch (vKey) {
case VK_SHIFT:
return InputEvent.SHIFT_MASK;
diff --git a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
index 03242e147..2e42f3392 100644
--- a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
@@ -38,7 +38,7 @@ public class MonitorEvent extends OutputEvent {
private final MonitorMode mode;
- public MonitorEvent (short eventType, MonitorDevice source, long when, MonitorMode mode) {
+ public MonitorEvent (final short eventType, final MonitorDevice source, final long when, final MonitorMode mode) {
super(eventType, source, when);
this.mode = mode;
}
@@ -48,7 +48,7 @@ public class MonitorEvent extends OutputEvent {
public final MonitorMode getMode() { return mode; }
- public static String getEventTypeString(short type) {
+ public static String getEventTypeString(final short type) {
switch(type) {
case EVENT_MONITOR_MODE_CHANGE_NOTIFY: return "EVENT_MONITOR_MODE_CHANGE_NOTIFY";
case EVENT_MONITOR_MODE_CHANGED: return "EVENT_MONITOR_MODE_CHANGED";
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
index 272e4beb0..84c78727e 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -101,7 +101,7 @@ public class MouseEvent extends InputEvent
* </pre>
* @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. PointerType.values().length-1 ]
*/
- public static PointerType valueOf(int ordinal) throws IllegalArgumentException {
+ public static PointerType valueOf(final int ordinal) throws IllegalArgumentException {
final PointerType[] all = PointerType.values();
if( 0 <= ordinal && ordinal < all.length ) {
return all[ordinal];
@@ -116,7 +116,7 @@ public class MouseEvent extends InputEvent
* </p>
* @throws IllegalArgumentException if one of the given ordinal values is out of range, i.e. not within [ 0 .. PointerType.values().length-1 ]
*/
- public static PointerType[] valuesOf(int[] ordinals) throws IllegalArgumentException {
+ public static PointerType[] valuesOf(final int[] ordinals) throws IllegalArgumentException {
final int count = ordinals.length;
final PointerType[] types = new PointerType[count];
for(int i=count-1; i>=0; i--) {
@@ -189,9 +189,9 @@ public class MouseEvent extends InputEvent
* @param rotationXYZ Rotation of all axis
* @param rotationScale Rotation scale
*/
- public MouseEvent(short eventType, Object source, long when,
- int modifiers, int x, int y, short clickCount, short button,
- float[] rotationXYZ, float rotationScale)
+ public MouseEvent(final short eventType, final Object source, final long when,
+ final int modifiers, final int x, final int y, final short clickCount, final short button,
+ final float[] rotationXYZ, final float rotationScale)
{
super(eventType, source, when, modifiers);
this.x = new int[]{x};
@@ -239,10 +239,10 @@ public class MouseEvent extends InputEvent
* @param rotationXYZ Rotation of all axis
* @param rotationScale Rotation scale
*/
- public MouseEvent(short eventType, Object source, long when, int modifiers,
- PointerType pointerType[], short[] pointerID,
- int[] x, int[] y, float[] pressure, float maxPressure,
- short button, short clickCount, float[] rotationXYZ, float rotationScale)
+ public MouseEvent(final short eventType, final Object source, final long when, final int modifiers,
+ final PointerType pointerType[], final short[] pointerID,
+ final int[] x, final int[] y, final float[] pressure, final float maxPressure,
+ final short button, final short clickCount, final float[] rotationXYZ, final float rotationScale)
{
super(eventType, source, when, modifiers);
this.x = x;
@@ -267,7 +267,7 @@ public class MouseEvent extends InputEvent
this.pointerType = pointerType;
}
- public MouseEvent createVariant(short newEventType) {
+ public final MouseEvent createVariant(final short newEventType) {
return new MouseEvent(newEventType, source, getWhen(), getModifiers(), pointerType, pointerID,
x, y, pressure, maxPressure, button, clickCount, rotationXYZ, rotationScale);
}
@@ -284,7 +284,7 @@ public class MouseEvent extends InputEvent
* See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
* @return the {@link PointerType} for the data at index or null if index not available.
*/
- public final PointerType getPointerType(int index) {
+ public final PointerType getPointerType(final int index) {
if(0 > index || index >= pointerType.length) {
return null;
}
@@ -311,7 +311,7 @@ public class MouseEvent extends InputEvent
* See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
* </p>
*/
- public final short getPointerId(int index) {
+ public final short getPointerId(final int index) {
if(0 > index || index >= pointerID.length) {
return -1;
}
@@ -322,7 +322,7 @@ public class MouseEvent extends InputEvent
* See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
* @return the pointer index for the given pointer id or -1 if id not available.
*/
- public final int getPointerIdx(short id) {
+ public final int getPointerIdx(final short id) {
if( id >= 0 ) {
for(int i=pointerID.length-1; i>=0; i--) {
if( pointerID[i] == id ) {
@@ -372,7 +372,7 @@ public class MouseEvent extends InputEvent
* @return X-Coord associated with the pointer-index.
* @see getPointerId(index)
*/
- public final int getX(int index) {
+ public final int getX(final int index) {
return x[index];
}
@@ -382,7 +382,7 @@ public class MouseEvent extends InputEvent
* @return Y-Coord associated with the pointer-index.
* @see getPointerId(index)
*/
- public final int getY(int index) {
+ public final int getY(final int index) {
return y[index];
}
@@ -408,7 +408,7 @@ public class MouseEvent extends InputEvent
* The value of zero is return if not available.
* @see #getMaxPressure()
*/
- public final float getPressure(boolean normalized){
+ public final float getPressure(final boolean normalized){
return normalized ? pressure[0] / maxPressure : pressure[0];
}
@@ -420,7 +420,7 @@ public class MouseEvent extends InputEvent
* The value of zero is return if not available.
* @see #getMaxPressure()
*/
- public final float getPressure(int index, boolean normalized){
+ public final float getPressure(final int index, final boolean normalized){
return normalized ? pressure[index] / maxPressure : pressure[index];
}
@@ -540,7 +540,7 @@ public class MouseEvent extends InputEvent
return super.toString(sb).append("]");
}
- public static String getEventTypeString(short type) {
+ public static String getEventTypeString(final short type) {
switch(type) {
case EVENT_MOUSE_CLICKED: return "EVENT_MOUSE_CLICKED";
case EVENT_MOUSE_ENTERED: return "EVENT_MOUSE_ENTERED";
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
index af800e61e..78bb7420a 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
@@ -61,7 +61,7 @@ public class NEWTEvent extends java.util.EventObject {
static final boolean DEBUG = false;
- protected NEWTEvent(short eventType, Object source, long when) {
+ protected NEWTEvent(final short eventType, final Object source, final long when) {
super(source);
this.eventType = eventType;
this.when = when;
@@ -86,7 +86,7 @@ public class NEWTEvent extends java.util.EventObject {
* communication.
* @param attachment User application specific object
*/
- public final void setAttachment(Object attachment) {
+ public final void setAttachment(final Object attachment) {
this.attachment = attachment;
}
@@ -123,7 +123,7 @@ public class NEWTEvent extends java.util.EventObject {
* </ul>
* </p>
*/
- public final void setConsumed(boolean consumed) {
+ public final void setConsumed(final boolean consumed) {
if( consumed ) {
setAttachment( consumedTag );
} else if( consumedTag == attachment ) {
@@ -144,6 +144,6 @@ public class NEWTEvent extends java.util.EventObject {
}
public static String toHexString(short hex) {
- return "0x" + Integer.toHexString( (int)hex & 0x0000FFFF );
+ return "0x" + Integer.toHexString( hex & 0x0000FFFF );
}
}
diff --git a/src/newt/classes/com/jogamp/newt/event/OutputEvent.java b/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
index 80c7780f8..bd3a11a13 100644
--- a/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
@@ -31,7 +31,7 @@ package com.jogamp.newt.event;
@SuppressWarnings("serial")
public abstract class OutputEvent extends NEWTEvent
{
- protected OutputEvent(short eventType, Object source, long when) {
+ protected OutputEvent(final short eventType, final Object source, final long when) {
super(eventType, source, when);
}
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
index 2841fd0f6..021bd6cae 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
@@ -49,11 +49,11 @@ public class WindowEvent extends NEWTEvent {
public static final short EVENT_WINDOW_REPAINT = 105;
public static final short EVENT_WINDOW_DESTROYED = 106;
- public WindowEvent(short eventType, Object source, long when) {
+ public WindowEvent(final short eventType, final Object source, final long when) {
super(eventType, source, when);
}
- public static String getEventTypeString(short type) {
+ public static String getEventTypeString(final short type) {
switch(type) {
case EVENT_WINDOW_RESIZED: return "WINDOW_RESIZED";
case EVENT_WINDOW_MOVED: return "WINDOW_MOVED";
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
index 9044517b5..4a5fecd83 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
@@ -34,7 +34,7 @@ import javax.media.nativewindow.util.Rectangle;
public class WindowUpdateEvent extends WindowEvent {
final Rectangle bounds;
- public WindowUpdateEvent(short eventType, Object source, long when, Rectangle bounds)
+ public WindowUpdateEvent(final short eventType, final Object source, final long when, final Rectangle bounds)
{
super(eventType, source, when);
this.bounds = bounds;