Commits

Michael Ludwig  committed 3066416

Update autoformatting rules

  • Participants
  • Parent commits b96092e

Comments (0)

Files changed (250)

File ferox-input/src/main/java/com/ferox/input/AWTEventAdapter.java

  * 
  * @author Michael Ludwig
  */
-public class AWTEventAdapter implements java.awt.event.KeyListener, java.awt.event.MouseListener, MouseMotionListener, MouseWheelListener {
+public class AWTEventAdapter implements
+                            java.awt.event.KeyListener,
+                            java.awt.event.MouseListener,
+                            MouseMotionListener,
+                            MouseWheelListener {
     private Component component;
-    
+
     private final MouseKeyEventDispatcher dispatcher;
-    
+
     /**
      * Create a new AWTEventAdapter that will convert AWT events and dispatch
      * them to the given MouseKeyEventDispatcher.
      * @param dispatcher The dispatcher to use
      */
     public AWTEventAdapter(MouseKeyEventDispatcher dispatcher) {
-        if (dispatcher == null)
+        if (dispatcher == null) {
             throw new NullPointerException("Dispatcher cannot be null");
-        
+        }
+
         this.dispatcher = dispatcher;
     }
-    
+
     /**
      * <p>
      * Attach the adapter to the given component. The adapter can only be
      *             another component
      */
     public void attach(Component component) {
-        if (component == null)
+        if (component == null) {
             throw new NullPointerException("Component cannot be null");
-        
-        synchronized(this) {
-            if (this.component != null)
+        }
+
+        synchronized (this) {
+            if (this.component != null) {
                 throw new IllegalStateException("AWTEventAdapter already attached to another Component");
-            
+            }
+
             component.addKeyListener(this);
             component.addMouseListener(this);
             component.addMouseMotionListener(this);
             component.addMouseWheelListener(this);
-            
+
             this.component = component;
         }
     }
-    
+
     /**
      * Detach this adapter from the component it's currently attached to. If the
      * adapter is not attached to a component, nothing happens. After detaching,
      * the adapter will not convert and dispatch AWT events.
      */
     public void detach() {
-        synchronized(this) {
+        synchronized (this) {
             if (component != null) {
                 component.removeKeyListener(this);
                 component.removeMouseListener(this);
                 component.removeMouseMotionListener(this);
                 component.removeMouseWheelListener(this);
-                
+
                 component = null;
             }
         }
     }
-    
+
     /* AWT event listener methods */
-    
+
     private KeyCode getKeyCode(java.awt.event.KeyEvent e) {
-        switch(e.getKeyCode()) {
-        case java.awt.event.KeyEvent.VK_ESCAPE: return KeyEvent.KeyCode.ESCAPE;
-        case java.awt.event.KeyEvent.VK_BACK_QUOTE: return KeyEvent.KeyCode.BACK_QUOTE;
-        case java.awt.event.KeyEvent.VK_TAB: return KeyEvent.KeyCode.TAB;
-        case java.awt.event.KeyEvent.VK_OPEN_BRACKET: return KeyEvent.KeyCode.LEFT_BRACKET;
-        case java.awt.event.KeyEvent.VK_CLOSE_BRACKET: return KeyEvent.KeyCode.RIGHT_BRACKET;
-        case java.awt.event.KeyEvent.VK_BACK_SLASH: return KeyEvent.KeyCode.BACK_SLASH;
-        case java.awt.event.KeyEvent.VK_SLASH: return KeyEvent.KeyCode.FORWARD_SLASH;
-        case java.awt.event.KeyEvent.VK_ENTER: return KeyEvent.KeyCode.RETURN;
-        case java.awt.event.KeyEvent.VK_SEMICOLON: return KeyEvent.KeyCode.SEMICOLON;
-        case java.awt.event.KeyEvent.VK_QUOTE: return KeyEvent.KeyCode.QUOTE;
-        case java.awt.event.KeyEvent.VK_COMMA: return KeyEvent.KeyCode.COMMA;
-        case java.awt.event.KeyEvent.VK_PERIOD: return KeyEvent.KeyCode.PERIOD;
-        case java.awt.event.KeyEvent.VK_MINUS: return KeyEvent.KeyCode.MINUS;
-        case java.awt.event.KeyEvent.VK_EQUALS: return KeyEvent.KeyCode.EQUALS;
-        case java.awt.event.KeyEvent.VK_BACK_SPACE: return KeyEvent.KeyCode.BACK_SPACE;
-        case java.awt.event.KeyEvent.VK_DELETE: return KeyEvent.KeyCode.DELETE;
-        
-        case java.awt.event.KeyEvent.VK_SPACE: return KeyEvent.KeyCode.SPACE;
-        
-        case java.awt.event.KeyEvent.VK_PAUSE: return KeyEvent.KeyCode.PAUSE;
-        case java.awt.event.KeyEvent.VK_INSERT: return KeyEvent.KeyCode.INSERT;
+        switch (e.getKeyCode()) {
+        case java.awt.event.KeyEvent.VK_ESCAPE:
+            return KeyEvent.KeyCode.ESCAPE;
+        case java.awt.event.KeyEvent.VK_BACK_QUOTE:
+            return KeyEvent.KeyCode.BACK_QUOTE;
+        case java.awt.event.KeyEvent.VK_TAB:
+            return KeyEvent.KeyCode.TAB;
+        case java.awt.event.KeyEvent.VK_OPEN_BRACKET:
+            return KeyEvent.KeyCode.LEFT_BRACKET;
+        case java.awt.event.KeyEvent.VK_CLOSE_BRACKET:
+            return KeyEvent.KeyCode.RIGHT_BRACKET;
+        case java.awt.event.KeyEvent.VK_BACK_SLASH:
+            return KeyEvent.KeyCode.BACK_SLASH;
+        case java.awt.event.KeyEvent.VK_SLASH:
+            return KeyEvent.KeyCode.FORWARD_SLASH;
+        case java.awt.event.KeyEvent.VK_ENTER:
+            return KeyEvent.KeyCode.RETURN;
+        case java.awt.event.KeyEvent.VK_SEMICOLON:
+            return KeyEvent.KeyCode.SEMICOLON;
+        case java.awt.event.KeyEvent.VK_QUOTE:
+            return KeyEvent.KeyCode.QUOTE;
+        case java.awt.event.KeyEvent.VK_COMMA:
+            return KeyEvent.KeyCode.COMMA;
+        case java.awt.event.KeyEvent.VK_PERIOD:
+            return KeyEvent.KeyCode.PERIOD;
+        case java.awt.event.KeyEvent.VK_MINUS:
+            return KeyEvent.KeyCode.MINUS;
+        case java.awt.event.KeyEvent.VK_EQUALS:
+            return KeyEvent.KeyCode.EQUALS;
+        case java.awt.event.KeyEvent.VK_BACK_SPACE:
+            return KeyEvent.KeyCode.BACK_SPACE;
+        case java.awt.event.KeyEvent.VK_DELETE:
+            return KeyEvent.KeyCode.DELETE;
 
-        case java.awt.event.KeyEvent.VK_HOME: return KeyEvent.KeyCode.HOME;
-        case java.awt.event.KeyEvent.VK_END: return KeyEvent.KeyCode.END;
-        case java.awt.event.KeyEvent.VK_PAGE_UP: return KeyEvent.KeyCode.PAGE_UP;
-        case java.awt.event.KeyEvent.VK_PAGE_DOWN: return KeyEvent.KeyCode.PAGE_DOWN;
+        case java.awt.event.KeyEvent.VK_SPACE:
+            return KeyEvent.KeyCode.SPACE;
 
-        case java.awt.event.KeyEvent.VK_UP: return KeyEvent.KeyCode.UP;
-        case java.awt.event.KeyEvent.VK_LEFT: return KeyEvent.KeyCode.LEFT;
-        case java.awt.event.KeyEvent.VK_RIGHT: return KeyEvent.KeyCode.RIGHT;
-        case java.awt.event.KeyEvent.VK_DOWN: return KeyEvent.KeyCode.DOWN;
-        
-        case java.awt.event.KeyEvent.VK_F1: return KeyEvent.KeyCode.F1;
-        case java.awt.event.KeyEvent.VK_F2: return KeyEvent.KeyCode.F2;
-        case java.awt.event.KeyEvent.VK_F3: return KeyEvent.KeyCode.F3;
-        case java.awt.event.KeyEvent.VK_F4: return KeyEvent.KeyCode.F4;
-        case java.awt.event.KeyEvent.VK_F5: return KeyEvent.KeyCode.F5;
-        case java.awt.event.KeyEvent.VK_F6: return KeyEvent.KeyCode.F6;
-        case java.awt.event.KeyEvent.VK_F7: return KeyEvent.KeyCode.F7;
-        case java.awt.event.KeyEvent.VK_F8: return KeyEvent.KeyCode.F8;
-        case java.awt.event.KeyEvent.VK_F9: return KeyEvent.KeyCode.F9;
-        case java.awt.event.KeyEvent.VK_F10: return KeyEvent.KeyCode.F10;
-        case java.awt.event.KeyEvent.VK_F11: return KeyEvent.KeyCode.F11;
-        case java.awt.event.KeyEvent.VK_F12: return KeyEvent.KeyCode.F12;
-        
-        case java.awt.event.KeyEvent.VK_1: return KeyEvent.KeyCode.N1;
-        case java.awt.event.KeyEvent.VK_2: return KeyEvent.KeyCode.N2;
-        case java.awt.event.KeyEvent.VK_3: return KeyEvent.KeyCode.N3;
-        case java.awt.event.KeyEvent.VK_4: return KeyEvent.KeyCode.N4;
-        case java.awt.event.KeyEvent.VK_5: return KeyEvent.KeyCode.N5;
-        case java.awt.event.KeyEvent.VK_6: return KeyEvent.KeyCode.N6;
-        case java.awt.event.KeyEvent.VK_7: return KeyEvent.KeyCode.N7;
-        case java.awt.event.KeyEvent.VK_8: return KeyEvent.KeyCode.N8;
-        case java.awt.event.KeyEvent.VK_9: return KeyEvent.KeyCode.N9;
-        case java.awt.event.KeyEvent.VK_0: return KeyEvent.KeyCode.N0;
-        
-        case java.awt.event.KeyEvent.VK_A: return KeyEvent.KeyCode.A;
-        case java.awt.event.KeyEvent.VK_B: return KeyEvent.KeyCode.B;
-        case java.awt.event.KeyEvent.VK_C: return KeyEvent.KeyCode.C;
-        case java.awt.event.KeyEvent.VK_D: return KeyEvent.KeyCode.D;
-        case java.awt.event.KeyEvent.VK_E: return KeyEvent.KeyCode.E;
-        case java.awt.event.KeyEvent.VK_F: return KeyEvent.KeyCode.F;
-        case java.awt.event.KeyEvent.VK_G: return KeyEvent.KeyCode.G;
-        case java.awt.event.KeyEvent.VK_H: return KeyEvent.KeyCode.H;
-        case java.awt.event.KeyEvent.VK_I: return KeyEvent.KeyCode.I;
-        case java.awt.event.KeyEvent.VK_J: return KeyEvent.KeyCode.J;
-        case java.awt.event.KeyEvent.VK_K: return KeyEvent.KeyCode.K;
-        case java.awt.event.KeyEvent.VK_L: return KeyEvent.KeyCode.L;
-        case java.awt.event.KeyEvent.VK_M: return KeyEvent.KeyCode.M;
-        case java.awt.event.KeyEvent.VK_N: return KeyEvent.KeyCode.N;
-        case java.awt.event.KeyEvent.VK_O: return KeyEvent.KeyCode.O;
-        case java.awt.event.KeyEvent.VK_P: return KeyEvent.KeyCode.P;
-        case java.awt.event.KeyEvent.VK_Q: return KeyEvent.KeyCode.Q;
-        case java.awt.event.KeyEvent.VK_R: return KeyEvent.KeyCode.R;
-        case java.awt.event.KeyEvent.VK_S: return KeyEvent.KeyCode.S;
-        case java.awt.event.KeyEvent.VK_T: return KeyEvent.KeyCode.T;
-        case java.awt.event.KeyEvent.VK_U: return KeyEvent.KeyCode.U;
-        case java.awt.event.KeyEvent.VK_V: return KeyEvent.KeyCode.V;
-        case java.awt.event.KeyEvent.VK_W: return KeyEvent.KeyCode.W;
-        case java.awt.event.KeyEvent.VK_X: return KeyEvent.KeyCode.X;
-        case java.awt.event.KeyEvent.VK_Y: return KeyEvent.KeyCode.Y;
-        case java.awt.event.KeyEvent.VK_Z: return KeyEvent.KeyCode.Z;
+        case java.awt.event.KeyEvent.VK_PAUSE:
+            return KeyEvent.KeyCode.PAUSE;
+        case java.awt.event.KeyEvent.VK_INSERT:
+            return KeyEvent.KeyCode.INSERT;
 
-        case java.awt.event.KeyEvent.VK_NUM_LOCK: return KeyEvent.KeyCode.NUM_LOCK;
-        case java.awt.event.KeyEvent.VK_SCROLL_LOCK: return KeyEvent.KeyCode.SCROLL_LOCK;
-        case java.awt.event.KeyEvent.VK_CAPS_LOCK: return KeyEvent.KeyCode.CAPS_LOCK;
+        case java.awt.event.KeyEvent.VK_HOME:
+            return KeyEvent.KeyCode.HOME;
+        case java.awt.event.KeyEvent.VK_END:
+            return KeyEvent.KeyCode.END;
+        case java.awt.event.KeyEvent.VK_PAGE_UP:
+            return KeyEvent.KeyCode.PAGE_UP;
+        case java.awt.event.KeyEvent.VK_PAGE_DOWN:
+            return KeyEvent.KeyCode.PAGE_DOWN;
 
-        case java.awt.event.KeyEvent.VK_NUMPAD1: return KeyEvent.KeyCode.NUMPAD_1;
-        case java.awt.event.KeyEvent.VK_NUMPAD2: return KeyEvent.KeyCode.NUMPAD_2;
-        case java.awt.event.KeyEvent.VK_NUMPAD3: return KeyEvent.KeyCode.NUMPAD_3;
-        case java.awt.event.KeyEvent.VK_NUMPAD4: return KeyEvent.KeyCode.NUMPAD_4;
-        case java.awt.event.KeyEvent.VK_NUMPAD5: return KeyEvent.KeyCode.NUMPAD_5;
-        case java.awt.event.KeyEvent.VK_NUMPAD6: return KeyEvent.KeyCode.NUMPAD_6;
-        case java.awt.event.KeyEvent.VK_NUMPAD7: return KeyEvent.KeyCode.NUMPAD_7;
-        case java.awt.event.KeyEvent.VK_NUMPAD8: return KeyEvent.KeyCode.NUMPAD_8;
-        case java.awt.event.KeyEvent.VK_NUMPAD9: return KeyEvent.KeyCode.NUMPAD_9;
-        case java.awt.event.KeyEvent.VK_NUMPAD0: return KeyEvent.KeyCode.NUMPAD_0;
-        case java.awt.event.KeyEvent.VK_ADD: return KeyEvent.KeyCode.NUMPAD_ADD;
-        case java.awt.event.KeyEvent.VK_SUBTRACT: return KeyEvent.KeyCode.NUMPAD_SUBTRACT;
-        case java.awt.event.KeyEvent.VK_DECIMAL: return KeyEvent.KeyCode.NUMPAD_DECIMAL;
-        case java.awt.event.KeyEvent.VK_DIVIDE: return KeyEvent.KeyCode.NUMPAD_DIVIDE;
-        case java.awt.event.KeyEvent.VK_MULTIPLY: return KeyEvent.KeyCode.NUMPAD_MULTIPLY;
-        
+        case java.awt.event.KeyEvent.VK_UP:
+            return KeyEvent.KeyCode.UP;
+        case java.awt.event.KeyEvent.VK_LEFT:
+            return KeyEvent.KeyCode.LEFT;
+        case java.awt.event.KeyEvent.VK_RIGHT:
+            return KeyEvent.KeyCode.RIGHT;
+        case java.awt.event.KeyEvent.VK_DOWN:
+            return KeyEvent.KeyCode.DOWN;
+
+        case java.awt.event.KeyEvent.VK_F1:
+            return KeyEvent.KeyCode.F1;
+        case java.awt.event.KeyEvent.VK_F2:
+            return KeyEvent.KeyCode.F2;
+        case java.awt.event.KeyEvent.VK_F3:
+            return KeyEvent.KeyCode.F3;
+        case java.awt.event.KeyEvent.VK_F4:
+            return KeyEvent.KeyCode.F4;
+        case java.awt.event.KeyEvent.VK_F5:
+            return KeyEvent.KeyCode.F5;
+        case java.awt.event.KeyEvent.VK_F6:
+            return KeyEvent.KeyCode.F6;
+        case java.awt.event.KeyEvent.VK_F7:
+            return KeyEvent.KeyCode.F7;
+        case java.awt.event.KeyEvent.VK_F8:
+            return KeyEvent.KeyCode.F8;
+        case java.awt.event.KeyEvent.VK_F9:
+            return KeyEvent.KeyCode.F9;
+        case java.awt.event.KeyEvent.VK_F10:
+            return KeyEvent.KeyCode.F10;
+        case java.awt.event.KeyEvent.VK_F11:
+            return KeyEvent.KeyCode.F11;
+        case java.awt.event.KeyEvent.VK_F12:
+            return KeyEvent.KeyCode.F12;
+
+        case java.awt.event.KeyEvent.VK_1:
+            return KeyEvent.KeyCode.N1;
+        case java.awt.event.KeyEvent.VK_2:
+            return KeyEvent.KeyCode.N2;
+        case java.awt.event.KeyEvent.VK_3:
+            return KeyEvent.KeyCode.N3;
+        case java.awt.event.KeyEvent.VK_4:
+            return KeyEvent.KeyCode.N4;
+        case java.awt.event.KeyEvent.VK_5:
+            return KeyEvent.KeyCode.N5;
+        case java.awt.event.KeyEvent.VK_6:
+            return KeyEvent.KeyCode.N6;
+        case java.awt.event.KeyEvent.VK_7:
+            return KeyEvent.KeyCode.N7;
+        case java.awt.event.KeyEvent.VK_8:
+            return KeyEvent.KeyCode.N8;
+        case java.awt.event.KeyEvent.VK_9:
+            return KeyEvent.KeyCode.N9;
+        case java.awt.event.KeyEvent.VK_0:
+            return KeyEvent.KeyCode.N0;
+
+        case java.awt.event.KeyEvent.VK_A:
+            return KeyEvent.KeyCode.A;
+        case java.awt.event.KeyEvent.VK_B:
+            return KeyEvent.KeyCode.B;
+        case java.awt.event.KeyEvent.VK_C:
+            return KeyEvent.KeyCode.C;
+        case java.awt.event.KeyEvent.VK_D:
+            return KeyEvent.KeyCode.D;
+        case java.awt.event.KeyEvent.VK_E:
+            return KeyEvent.KeyCode.E;
+        case java.awt.event.KeyEvent.VK_F:
+            return KeyEvent.KeyCode.F;
+        case java.awt.event.KeyEvent.VK_G:
+            return KeyEvent.KeyCode.G;
+        case java.awt.event.KeyEvent.VK_H:
+            return KeyEvent.KeyCode.H;
+        case java.awt.event.KeyEvent.VK_I:
+            return KeyEvent.KeyCode.I;
+        case java.awt.event.KeyEvent.VK_J:
+            return KeyEvent.KeyCode.J;
+        case java.awt.event.KeyEvent.VK_K:
+            return KeyEvent.KeyCode.K;
+        case java.awt.event.KeyEvent.VK_L:
+            return KeyEvent.KeyCode.L;
+        case java.awt.event.KeyEvent.VK_M:
+            return KeyEvent.KeyCode.M;
+        case java.awt.event.KeyEvent.VK_N:
+            return KeyEvent.KeyCode.N;
+        case java.awt.event.KeyEvent.VK_O:
+            return KeyEvent.KeyCode.O;
+        case java.awt.event.KeyEvent.VK_P:
+            return KeyEvent.KeyCode.P;
+        case java.awt.event.KeyEvent.VK_Q:
+            return KeyEvent.KeyCode.Q;
+        case java.awt.event.KeyEvent.VK_R:
+            return KeyEvent.KeyCode.R;
+        case java.awt.event.KeyEvent.VK_S:
+            return KeyEvent.KeyCode.S;
+        case java.awt.event.KeyEvent.VK_T:
+            return KeyEvent.KeyCode.T;
+        case java.awt.event.KeyEvent.VK_U:
+            return KeyEvent.KeyCode.U;
+        case java.awt.event.KeyEvent.VK_V:
+            return KeyEvent.KeyCode.V;
+        case java.awt.event.KeyEvent.VK_W:
+            return KeyEvent.KeyCode.W;
+        case java.awt.event.KeyEvent.VK_X:
+            return KeyEvent.KeyCode.X;
+        case java.awt.event.KeyEvent.VK_Y:
+            return KeyEvent.KeyCode.Y;
+        case java.awt.event.KeyEvent.VK_Z:
+            return KeyEvent.KeyCode.Z;
+
+        case java.awt.event.KeyEvent.VK_NUM_LOCK:
+            return KeyEvent.KeyCode.NUM_LOCK;
+        case java.awt.event.KeyEvent.VK_SCROLL_LOCK:
+            return KeyEvent.KeyCode.SCROLL_LOCK;
+        case java.awt.event.KeyEvent.VK_CAPS_LOCK:
+            return KeyEvent.KeyCode.CAPS_LOCK;
+
+        case java.awt.event.KeyEvent.VK_NUMPAD1:
+            return KeyEvent.KeyCode.NUMPAD_1;
+        case java.awt.event.KeyEvent.VK_NUMPAD2:
+            return KeyEvent.KeyCode.NUMPAD_2;
+        case java.awt.event.KeyEvent.VK_NUMPAD3:
+            return KeyEvent.KeyCode.NUMPAD_3;
+        case java.awt.event.KeyEvent.VK_NUMPAD4:
+            return KeyEvent.KeyCode.NUMPAD_4;
+        case java.awt.event.KeyEvent.VK_NUMPAD5:
+            return KeyEvent.KeyCode.NUMPAD_5;
+        case java.awt.event.KeyEvent.VK_NUMPAD6:
+            return KeyEvent.KeyCode.NUMPAD_6;
+        case java.awt.event.KeyEvent.VK_NUMPAD7:
+            return KeyEvent.KeyCode.NUMPAD_7;
+        case java.awt.event.KeyEvent.VK_NUMPAD8:
+            return KeyEvent.KeyCode.NUMPAD_8;
+        case java.awt.event.KeyEvent.VK_NUMPAD9:
+            return KeyEvent.KeyCode.NUMPAD_9;
+        case java.awt.event.KeyEvent.VK_NUMPAD0:
+            return KeyEvent.KeyCode.NUMPAD_0;
+        case java.awt.event.KeyEvent.VK_ADD:
+            return KeyEvent.KeyCode.NUMPAD_ADD;
+        case java.awt.event.KeyEvent.VK_SUBTRACT:
+            return KeyEvent.KeyCode.NUMPAD_SUBTRACT;
+        case java.awt.event.KeyEvent.VK_DECIMAL:
+            return KeyEvent.KeyCode.NUMPAD_DECIMAL;
+        case java.awt.event.KeyEvent.VK_DIVIDE:
+            return KeyEvent.KeyCode.NUMPAD_DIVIDE;
+        case java.awt.event.KeyEvent.VK_MULTIPLY:
+            return KeyEvent.KeyCode.NUMPAD_MULTIPLY;
+
         case java.awt.event.KeyEvent.VK_ALT:
-            if (e.getKeyLocation() == java.awt.event.KeyEvent.KEY_LOCATION_RIGHT)
+            if (e.getKeyLocation() == java.awt.event.KeyEvent.KEY_LOCATION_RIGHT) {
                 return KeyEvent.KeyCode.RIGHT_ALT;
-            else
+            } else {
                 return KeyEvent.KeyCode.LEFT_ALT;
-        case java.awt.event.KeyEvent.VK_CONTROL: 
-            if (e.getKeyLocation() == java.awt.event.KeyEvent.KEY_LOCATION_RIGHT)
+            }
+        case java.awt.event.KeyEvent.VK_CONTROL:
+            if (e.getKeyLocation() == java.awt.event.KeyEvent.KEY_LOCATION_RIGHT) {
                 return KeyEvent.KeyCode.RIGHT_CONTROL;
-            else
+            } else {
                 return KeyEvent.KeyCode.LEFT_CONTROL;
-        case java.awt.event.KeyEvent.VK_SHIFT: 
-            if (e.getKeyLocation() == java.awt.event.KeyEvent.KEY_LOCATION_RIGHT)
+            }
+        case java.awt.event.KeyEvent.VK_SHIFT:
+            if (e.getKeyLocation() == java.awt.event.KeyEvent.KEY_LOCATION_RIGHT) {
                 return KeyEvent.KeyCode.RIGHT_SHIFT;
-            else
+            } else {
                 return KeyEvent.KeyCode.LEFT_SHIFT;
-        case java.awt.event.KeyEvent.VK_META: 
-            if (e.getKeyLocation() == java.awt.event.KeyEvent.KEY_LOCATION_RIGHT)
+            }
+        case java.awt.event.KeyEvent.VK_META:
+            if (e.getKeyLocation() == java.awt.event.KeyEvent.KEY_LOCATION_RIGHT) {
                 return KeyEvent.KeyCode.RIGHT_META;
-            else
+            } else {
                 return KeyEvent.KeyCode.LEFT_META;
-            
+            }
+
         default:
             return KeyEvent.KeyCode.UNKNOWN;
         }
     }
-    
+
     private char getCharacter(java.awt.event.KeyEvent e) {
-        if (e.getKeyChar() == java.awt.event.KeyEvent.CHAR_UNDEFINED)
+        if (e.getKeyChar() == java.awt.event.KeyEvent.CHAR_UNDEFINED) {
             return KeyEvent.CHAR_UNKNOWN;
-        else
+        } else {
             return e.getKeyChar();
+        }
     }
-    
+
     private MouseButton getButton(java.awt.event.MouseEvent e) {
-        switch(e.getButton()) {
+        switch (e.getButton()) {
         case java.awt.event.MouseEvent.NOBUTTON:
             return MouseEvent.MouseButton.NONE;
         case java.awt.event.MouseEvent.BUTTON1:
             throw new IllegalArgumentException("Unknown AWT button code");
         }
     }
-    
+
     private int getY(java.awt.event.MouseEvent e) {
         return component.getHeight() - e.getY();
     }
 
     @Override
     public void keyPressed(java.awt.event.KeyEvent e) {
-        KeyEvent event = new KeyEvent(KeyEvent.Type.PRESS, dispatcher.getSource(), 
-                                      getKeyCode(e), getCharacter(e));
+        KeyEvent event = new KeyEvent(KeyEvent.Type.PRESS,
+                                      dispatcher.getSource(),
+                                      getKeyCode(e),
+                                      getCharacter(e));
         dispatcher.dispatchEvent(event);
     }
 
     @Override
     public void keyReleased(java.awt.event.KeyEvent e) {
-        KeyEvent event = new KeyEvent(KeyEvent.Type.RELEASE, dispatcher.getSource(),
-                                      getKeyCode(e), getCharacter(e));
+        KeyEvent event = new KeyEvent(KeyEvent.Type.RELEASE,
+                                      dispatcher.getSource(),
+                                      getKeyCode(e),
+                                      getCharacter(e));
         dispatcher.dispatchEvent(event);
     }
 
 
     @Override
     public void mousePressed(java.awt.event.MouseEvent e) {
-        MouseEvent event = new MouseEvent(MouseEvent.Type.PRESS, dispatcher.getSource(), 
-                                          e.getX(), getY(e), 0, getButton(e));
+        MouseEvent event = new MouseEvent(MouseEvent.Type.PRESS,
+                                          dispatcher.getSource(),
+                                          e.getX(),
+                                          getY(e),
+                                          0,
+                                          getButton(e));
         dispatcher.dispatchEvent(event);
     }
 
     @Override
     public void mouseReleased(java.awt.event.MouseEvent e) {
-        MouseEvent event = new MouseEvent(MouseEvent.Type.RELEASE, dispatcher.getSource(), 
-                                          e.getX(), getY(e), 0, getButton(e));
+        MouseEvent event = new MouseEvent(MouseEvent.Type.RELEASE,
+                                          dispatcher.getSource(),
+                                          e.getX(),
+                                          getY(e),
+                                          0,
+                                          getButton(e));
         dispatcher.dispatchEvent(event);
     }
 
 
     @Override
     public void mouseMoved(java.awt.event.MouseEvent e) {
-        MouseEvent event = new MouseEvent(MouseEvent.Type.MOVE, dispatcher.getSource(), 
-                                          e.getX(), getY(e), 0, MouseButton.NONE);
+        MouseEvent event = new MouseEvent(MouseEvent.Type.MOVE,
+                                          dispatcher.getSource(),
+                                          e.getX(),
+                                          getY(e),
+                                          0,
+                                          MouseButton.NONE);
         dispatcher.dispatchEvent(event);
     }
-    
+
     @Override
     public void mouseWheelMoved(MouseWheelEvent e) {
-        MouseEvent event = new MouseEvent(MouseEvent.Type.SCROLL, dispatcher.getSource(), 
-                                          e.getX(), getY(e), e.getWheelRotation(), MouseButton.NONE);
+        MouseEvent event = new MouseEvent(MouseEvent.Type.SCROLL,
+                                          dispatcher.getSource(),
+                                          e.getX(),
+                                          getY(e),
+                                          e.getWheelRotation(),
+                                          MouseButton.NONE);
         dispatcher.dispatchEvent(event);
     }
 }

File ferox-input/src/main/java/com/ferox/input/EventListener.java

  * 
  * @author Michael Ludwig
  */
-public interface EventListener {
-}
+public interface EventListener {}

File ferox-input/src/main/java/com/ferox/input/EventSource.java

  * 
  * @author Michael Ludwig
  */
-public interface EventSource { }
+public interface EventSource {}

File ferox-input/src/main/java/com/ferox/input/KeyEvent.java

      * modifiers that would not produce characters by themselves.
      */
     public static enum KeyCode {
-        UNKNOWN("Unknown"), 
-        
-        ESCAPE("Esc"), 
-        BACK_QUOTE("`"), 
-        TAB("Tab"), 
-        LEFT_BRACKET("["), 
+        UNKNOWN("Unknown"),
+
+        ESCAPE("Esc"),
+        BACK_QUOTE("`"),
+        TAB("Tab"),
+        LEFT_BRACKET("["),
         RIGHT_BRACKET("]"),
-        BACK_SLASH("\\"), 
-        FORWARD_SLASH("/"), 
-        RETURN("Return"), 
-        SEMICOLON(";"), 
-        QUOTE("'"), 
-        COMMA(","), 
-        PERIOD("."), 
-        MINUS("-"), 
-        EQUALS("="), 
+        BACK_SLASH("\\"),
+        FORWARD_SLASH("/"),
+        RETURN("Return"),
+        SEMICOLON(";"),
+        QUOTE("'"),
+        COMMA(","),
+        PERIOD("."),
+        MINUS("-"),
+        EQUALS("="),
         BACK_SPACE("Back Space"),
-        DELETE("Delete"), 
+        DELETE("Delete"),
         SPACE("Space"),
-        INSERT("Insert"), 
-        PAUSE("Pause"), 
-        HOME("Home"), 
-        END("End"), 
-        PAGE_UP("Page Up"), 
+        INSERT("Insert"),
+        PAUSE("Pause"),
+        HOME("Home"),
+        END("End"),
+        PAGE_UP("Page Up"),
         PAGE_DOWN("Page Down"),
-        
-        UP("Up"), LEFT("Left"), RIGHT("Right"), DOWN("Down"), 
-        
-        F1("F1"), F2("F2"), F3("F3"), F4("F4"), F5("F5"), F6("F6"), F7("F7"), F8("F8"), F9("F9"), F10("F10"), F11("F11"), F12("F12"), 
-        
-        N1("1"), N2("2"), N3("3"), N4("4"), N5("5"), N6("6"), N7("7"), N8("8"), N9("9"), N0("0"), 
-        
-        A("a"), B("b"), C("c"), D("d"), E("e"), F("f"), G("g"), H("h"), I("i"), J("j"), K("k"), L("l"), M("m"), 
-        N("n"), O("o"), P("p"), Q("q"), R("r"), S("s"), T("t"), U("u"), V("v"), W("w"), X("x"), Y("y"), Z("z"), 
-        
-        NUM_LOCK("Num Lock"), SCROLL_LOCK("Scroll Lock"), CAPS_LOCK("Caps Lock"), 
-        
-        NUMPAD_0("Numpad 0"), NUMPAD_1("Numpad 1"), NUMPAD_2("Numpad 2"), NUMPAD_3("Numpad 3"), NUMPAD_4("Numpad 4"), 
-        NUMPAD_5("Numpad 5"), NUMPAD_6("Numpad 6"), NUMPAD_7("Numpad 7"), NUMPAD_8("Numpad 8"), NUMPAD_9("Numpad 9"), 
-        NUMPAD_ADD("Numpad +"), NUMPAD_SUBTRACT("Numpad -"), NUMPAD_DECIMAL("Numpad ."), NUMPAD_DIVIDE("Numpad /"), NUMPAD_MULTIPLY("NUMPAD *"), 
-        
-        RIGHT_ALT("Right Alt"), LEFT_ALT("Left Alt"),
-        RIGHT_CONTROL("Right Control"), LEFT_CONTROL("Left Control"), 
-        RIGHT_SHIFT("Right Shift"), LEFT_SHIFT("Left Shift"),
-        RIGHT_META("Right Meta"), LEFT_META("Left Meta");
-        
+
+        UP("Up"),
+        LEFT("Left"),
+        RIGHT("Right"),
+        DOWN("Down"),
+
+        F1("F1"),
+        F2("F2"),
+        F3("F3"),
+        F4("F4"),
+        F5("F5"),
+        F6("F6"),
+        F7("F7"),
+        F8("F8"),
+        F9("F9"),
+        F10("F10"),
+        F11("F11"),
+        F12("F12"),
+
+        N1("1"),
+        N2("2"),
+        N3("3"),
+        N4("4"),
+        N5("5"),
+        N6("6"),
+        N7("7"),
+        N8("8"),
+        N9("9"),
+        N0("0"),
+
+        A("a"),
+        B("b"),
+        C("c"),
+        D("d"),
+        E("e"),
+        F("f"),
+        G("g"),
+        H("h"),
+        I("i"),
+        J("j"),
+        K("k"),
+        L("l"),
+        M("m"),
+        N("n"),
+        O("o"),
+        P("p"),
+        Q("q"),
+        R("r"),
+        S("s"),
+        T("t"),
+        U("u"),
+        V("v"),
+        W("w"),
+        X("x"),
+        Y("y"),
+        Z("z"),
+
+        NUM_LOCK("Num Lock"),
+        SCROLL_LOCK("Scroll Lock"),
+        CAPS_LOCK("Caps Lock"),
+
+        NUMPAD_0("Numpad 0"),
+        NUMPAD_1("Numpad 1"),
+        NUMPAD_2("Numpad 2"),
+        NUMPAD_3("Numpad 3"),
+        NUMPAD_4("Numpad 4"),
+        NUMPAD_5("Numpad 5"),
+        NUMPAD_6("Numpad 6"),
+        NUMPAD_7("Numpad 7"),
+        NUMPAD_8("Numpad 8"),
+        NUMPAD_9("Numpad 9"),
+        NUMPAD_ADD("Numpad +"),
+        NUMPAD_SUBTRACT("Numpad -"),
+        NUMPAD_DECIMAL("Numpad ."),
+        NUMPAD_DIVIDE("Numpad /"),
+        NUMPAD_MULTIPLY("NUMPAD *"),
+
+        RIGHT_ALT("Right Alt"),
+        LEFT_ALT("Left Alt"),
+        RIGHT_CONTROL("Right Control"),
+        LEFT_CONTROL("Left Control"),
+        RIGHT_SHIFT("Right Shift"),
+        LEFT_SHIFT("Left Shift"),
+        RIGHT_META("Right Meta"),
+        LEFT_META("Left Meta");
+
         private final String descr;
-        private KeyCode(String descr) { this.descr = descr; }
-        
-        public String getDescription() { return descr; }
+
+        private KeyCode(String descr) {
+            this.descr = descr;
+        }
+
+        public String getDescription() {
+            return descr;
+        }
     }
-    
+
     private final KeyCode keyCode;
     private final char charValue;
     private final Type type;
     private final KeyEventSource source;
-    
+
     /**
      * Create a new KeyEvent with the given parameters.
      * 
      * @throws NullPointerException if type, source, or keyCode are null
      */
     public KeyEvent(Type type, KeyEventSource source, KeyCode keyCode, char charValue) {
-        if (source == null)
+        if (source == null) {
             throw new NullPointerException("Event source cannot be null");
-        if (type == null)
+        }
+        if (type == null) {
             throw new NullPointerException("Event type cannot be null");
-        if (keyCode == null)
+        }
+        if (keyCode == null) {
             throw new NullPointerException("KeyCode cannot be null");
-        
+        }
+
         this.source = source;
         this.type = type;
         this.keyCode = keyCode;
         this.charValue = charValue;
     }
-    
+
     /**
      * Get the character typed by this event. This will correctly have any
      * previously pressed modifier keys or language layouts applied to produce
     public char getCharacter() {
         return charValue;
     }
-    
+
     /**
      * @return The KeyCode representing the physical key that was pressed or
      *         released for this event
     public KeyCode getKeyCode() {
         return keyCode;
     }
-    
+
     /**
      * @return The type of key event
      */
     public Type getEventType() {
         return type;
     }
-    
+
     @Override
     public KeyEventSource getSource() {
         return source;
     }
-    
+
     @Override
     public String toString() {
         return "[Key " + type + " on " + keyCode.getDescription() + "]";

File ferox-input/src/main/java/com/ferox/input/KeyEventSource.java

  */
 public interface KeyEventSource extends EventSource {
     /**
-     * Register the given KeyListener with this KeyEventSource. Nothing is
-     * done if the given listener has already been added.
+     * Register the given KeyListener with this KeyEventSource. Nothing is done
+     * if the given listener has already been added.
      * 
      * @param listener The listener to add
      * @throws NullPointerException if listener is null
      */
     public void addKeyListener(KeyListener listener);
-    
+
     /**
-     * Remove the given KeyListener from this KeyEventSource. Nothing is
-     * done if the given listener has never been added, or was already removed.
+     * Remove the given KeyListener from this KeyEventSource. Nothing is done if
+     * the given listener has never been added, or was already removed.
      * 
      * @param listener The listener to remove
      * @throws NullPointerException if listener is null

File ferox-input/src/main/java/com/ferox/input/MouseEvent.java

          * yet. Use {@link MouseEvent#getButton()} to determine which button was
          * pressed.
          */
-        PRESS, 
+        PRESS,
         /**
          * One of the mouse's buttons was released that has previously been
          * pressed. Use {@link MouseEvent#getButton()} to determine which button
          */
         SCROLL
     }
-    
+
     /**
      * MouseButton is an enum representing all supported buttons in this event
      * framework. Some mice might not be capable of using the right or center
          */
         CENTER
     }
-    
+
     private final MouseEventSource source;
     private final Type type;
-    
+
     private final int x;
     private final int y;
     private final int scrollDelta;
-    
+
     private final MouseButton button;
-    
+
     /**
      * Create a new MouseEvent with the given arguments.
      * 
      * @throws IllegalArgumentException if type, scrollDelta and button are
      *             incompatible
      */
-    public MouseEvent(Type type, MouseEventSource source, int x, int y, int scrollDelta, MouseButton button) {
-        if (source == null)
+    public MouseEvent(Type type,
+                      MouseEventSource source,
+                      int x,
+                      int y,
+                      int scrollDelta,
+                      MouseButton button) {
+        if (source == null) {
             throw new NullPointerException("Event source cannot be null");
-        if (type == null)
+        }
+        if (type == null) {
             throw new NullPointerException("Type cannot be null");
-        if (button == null)
+        }
+        if (button == null) {
             throw new IllegalArgumentException("Mouse button cannot be null");
-        
+        }
+
         // verify state
         if (type == Type.PRESS || type == Type.RELEASE) {
-            if (button == MouseButton.NONE)
-                throw new IllegalArgumentException("Button cannot be NONE for a " + type + " event");
+            if (button == MouseButton.NONE) {
+                throw new IllegalArgumentException("Button cannot be NONE for a " + type
+                                                   + " event");
+            }
         } else {
-            if (button != MouseButton.NONE)
-                throw new IllegalArgumentException("Button must be NONE for a " + type + " event");
+            if (button != MouseButton.NONE) {
+                throw new IllegalArgumentException("Button must be NONE for a " + type
+                                                   + " event");
+            }
         }
         if (type == Type.SCROLL) {
-            if (scrollDelta == 0)
-                throw new IllegalArgumentException("Scroll delta must be non-zero for a " + type + " event");
+            if (scrollDelta == 0) {
+                throw new IllegalArgumentException("Scroll delta must be non-zero for a " + type
+                                                   + " event");
+            }
         } else {
-            if (scrollDelta != 0)
-                throw new IllegalArgumentException("Scroll delta must be 0 for a " + type + " event");
+            if (scrollDelta != 0) {
+                throw new IllegalArgumentException("Scroll delta must be 0 for a " + type
+                                                   + " event");
+            }
         }
-        
+
         this.source = source;
         this.type = type;
         this.x = x;
         this.scrollDelta = scrollDelta;
         this.button = button;
     }
-    
+
     /**
      * @return The type of mouse event
      */
     public Type getEventType() {
         return type;
     }
-    
+
     /**
      * <p>
      * Get the x position of the mouse at the time of the event. Given that most
     public int getX() {
         return x;
     }
-    
+
     /**
      * <p>
      * Get the y position of the mouse at the time of the event. Given that most
     public int getY() {
         return y;
     }
-    
+
     /**
      * Get the amount of scroll increments the scroll wheel has been adjusted
      * by. This value is always 0 if the type is not SCROLL. When the event is a
     public int getScrollDelta() {
         return scrollDelta;
     }
-    
+
     /**
      * Get the mouse button that produced the event if the type is PRESS or
      * RELEASE. MOVE and SCROLL will always return NONE. PRESS and RELEASE will
     public MouseButton getButton() {
         return button;
     }
-    
+
     @Override
     public MouseEventSource getSource() {
         return source;
     }
-    
+
     @Override
     public String toString() {
-        return "[Mouse " + type + " at (" + x + ", " + y + "), button: " + button + ", scroll: " + scrollDelta + "]";
+        return "[Mouse " + type
+               + " at ("
+               + x
+               + ", "
+               + y
+               + "), button: "
+               + button
+               + ", scroll: "
+               + scrollDelta
+               + "]";
     }
 }

File ferox-input/src/main/java/com/ferox/input/MouseEventSource.java

      * @throws NullPointerException if listener is null
      */
     public void addMouseListener(MouseListener listener);
-    
+
     /**
      * Remove the given MouseListener from this MouseEventSource. Nothing is
      * done if the given listener has never been added, or was already removed.

File ferox-input/src/main/java/com/ferox/input/MouseKeyEventDispatcher.java

     private final ExecutorService executor;
     private final CopyOnWriteArrayList<KeyListener> keyListeners;
     private final CopyOnWriteArrayList<MouseListener> mouseListeners;
-    
+
     private final MouseKeyEventSource source;
-    
+
     /**
      * Create a new MouseKeyEventDispatcher.
      * 
      *            dispatcher
      */
     public MouseKeyEventDispatcher(MouseKeyEventSource source) {
-        if (source == null)
+        if (source == null) {
             throw new NullPointerException("Source cannot be null");
+        }
         this.source = source;
         executor = Executors.newFixedThreadPool(1);
         keyListeners = new CopyOnWriteArrayList<KeyListener>();
         mouseListeners = new CopyOnWriteArrayList<MouseListener>();
     }
-    
+
     /**
      * @return The source of events that are dispatched by this dispatcher
      */
     public MouseKeyEventSource getSource() {
         return source;
     }
-    
+
     /**
      * Function compatible with
      * {@link KeyEventSource#addKeyListener(KeyListener)}.
      * @param listener The listener to register
      */
     public void addKeyListener(KeyListener listener) {
-        if (listener == null)
+        if (listener == null) {
             throw new NullPointerException("KeyListener cannot be null");
+        }
         keyListeners.addIfAbsent(listener);
     }
-    
+
     /**
      * Function compatible with
      * {@link KeyEventSource#removeKeyListener(KeyListener)}.
      * @param listener The listener to unregister
      */
     public void removeKeyListener(KeyListener listener) {
-        if (listener == null)
+        if (listener == null) {
             throw new NullPointerException("KeyListener cannot be null");
+        }
         keyListeners.remove(listener);
     }
 
      * @param listener The listener to register
      */
     public void addMouseListener(MouseListener listener) {
-        if (listener == null)
+        if (listener == null) {
             throw new NullPointerException("MouseListener cannot be null");
+        }
         mouseListeners.addIfAbsent(listener);
     }
 
      * @param listener The listener to unregister
      */
     public void removeMouseListener(MouseListener listener) {
-        if (listener == null)
+        if (listener == null) {
             throw new NullPointerException("MouseListener cannot be null");
+        }
         mouseListeners.remove(listener);
     }
-    
+
     /**
      * Dispatch the given event to all registered listeners that are interested
      * in the event. This will be invoked on an internal thread managed by this
      *             the dispatcher's
      */
     public void dispatchEvent(Event e) {
-        if (e.getSource() != source)
+        if (e.getSource() != source) {
             throw new IllegalArgumentException("Event's source does not match this dispatcher's source");
-        
+        }
+
         try {
-            if (e instanceof MouseEvent)
+            if (e instanceof MouseEvent) {
                 executor.submit(new MouseEventTask((MouseEvent) e));
-            else if (e instanceof KeyEvent)
+            } else if (e instanceof KeyEvent) {
                 executor.submit(new KeyEventTask((KeyEvent) e));
-            else
+            } else {
                 throw new UnsupportedOperationException("Unsupported type of event: " + e.getClass());
-        } catch(RejectedExecutionException ree) {
+            }
+        } catch (RejectedExecutionException ree) {
             // ignore
         }
     }
     public void shutdown() {
         executor.shutdownNow();
     }
-    
+
     private class KeyEventTask implements Runnable {
         private final KeyEvent e;
-        
+
         public KeyEventTask(KeyEvent e) {
             this.e = e;
         }
-        
+
         @Override
         public void run() {
-            for (KeyListener l: keyListeners) {
+            for (KeyListener l : keyListeners) {
                 l.handleEvent(e);
             }
         }
     }
-    
+
     private class MouseEventTask implements Runnable {
         private final MouseEvent e;
-        
+
         public MouseEventTask(MouseEvent e) {
             this.e = e;
         }
-        
+
         @Override
         public void run() {
-            for (MouseListener l: mouseListeners) {
+            for (MouseListener l : mouseListeners) {
                 l.handleEvent(e);
             }
         }

File ferox-input/src/main/java/com/ferox/input/logic/InputManager.java

     private InputState lastState;
     private InputState lastProcessedState;
     private final Queue<InputState> stateQueue;
-    
-    private final InternalListener listener; // also acts as synchronization lock
+
+    private final InternalListener listener; // also acts as synchronization
+                                             // lock
     private final List<PredicatedAction> triggers;
-    
+
     private MouseKeyEventSource source;
-    
+
     /**
      * Create a new InputManager that is not attached to any
      * MouseKeyEventSource, and must be attached before it can process any
     public InputManager() {
         stateQueue = new ArrayDeque<InputState>();
         triggers = new ArrayList<PredicatedAction>();
-        
+
         listener = new InternalListener();
         lastState = new InputState();
         lastProcessedState = lastState;
     }
-    
+
     /**
      * <p>
      * Attach the InputManager to the given MouseKeyEventSource. The manager can
      *             another component
      */
     public void attach(MouseKeyEventSource source) {
-        if (source == null)
+        if (source == null) {
             throw new NullPointerException("Source cannot be null");
-        
-        synchronized(this) {
-            if (this.source != null)
+        }
+
+        synchronized (this) {
+            if (this.source != null) {
                 throw new IllegalStateException("InputManager already attached to another event source");
-            
+            }
+
             source.addKeyListener(listener);
             source.addMouseListener(listener);
-            
+
             this.source = source;
         }
     }
-    
+
     /**
      * Detach this InputManager from the event source it's currently attached
      * to. If the adapter is not attached to a component, nothing happens. After
      * {@link #process()} will no longer work.
      */
     public void detach() {
-        synchronized(this) {
+        synchronized (this) {
             if (source != null) {
                 source.removeKeyListener(listener);
                 source.removeMouseListener(listener);
-                
+
                 source = null;
             }
         }
     }
-    
+
     /**
      * @return The event source this manager is attached to or null
      */
     public MouseKeyEventSource getEventSource() {
         return source;
     }
-    
+
     /**
      * <p>
      * Begin registering a new action with this InputManager that will be
     public ActionBuilder on(Predicate predicate) {
         return new ActionBuilderImpl(predicate);
     }
-    
+
     /**
      * Remove or unregister the given action from this manager. If the action
      * was registered with multiple predicates, all occurrences of it will be
      * @throws NullPointerException if trigger is null
      */
     public void removeAction(Action trigger) {
-        if (trigger == null)
+        if (trigger == null) {
             throw new NullPointerException("Action cannot be null");
-        
-        synchronized(listener) {
+        }
+
+        synchronized (listener) {
             Iterator<PredicatedAction> it = triggers.iterator();
-            while(it.hasNext()) {
+            while (it.hasNext()) {
                 // remove all occurrences of the action
                 if (it.next().trigger == trigger) {
                     it.remove();
             }
         }
     }
-    
+
     /**
      * Process all events that have been accumulated since the last call to
      * {@link #process()} and run all actions that are triggered based on their
      * associated predicate. This will run the actions on the calling thread.
      */
     public void process() {
-        synchronized(listener) {
+        synchronized (listener) {
             InputState prev = lastProcessedState;
-            for (InputState next: stateQueue) {
+            for (InputState next : stateQueue) {
                 processTriggers(prev, next);
                 prev = next;
             }
 
     private void processTriggers(InputState prev, InputState next) {
         int ct = triggers.size();
-        for (int i = 0; i < ct; i++)
+        for (int i = 0; i < ct; i++) {
             triggers.get(i).apply(prev, next);
+        }
     }
-    
+
     // caller must be synchronized on event listener
     private void advanceState(InputState next) {
         lastState = next;
         stateQueue.add(next);
     }
-    
+
     /*
      * Internal class used to listen for events to prevent InputManager being
      * used as a listener directly. It is also the monitor used by each manager.
     private class InternalListener implements KeyListener, MouseListener {
         @Override
         public void handleEvent(KeyEvent event) {
-            synchronized(this) {
+            synchronized (this) {
                 advanceState(new InputState(lastState, event));
             }
         }
 
         @Override
         public void handleEvent(MouseEvent event) {
-            synchronized(this) {
+            synchronized (this) {
                 advanceState(new InputState(lastState, event));
             }
         }
     }
-    
+
     /*
      * Internal ActionBuilder implementation
      */
     private class ActionBuilderImpl implements ActionBuilder {
         Predicate condition;
-        
+
         public ActionBuilderImpl(Predicate base) {
-            if (base == null)
+            if (base == null) {
                 throw new NullPointerException("Predicate cannot be null");
+            }
             condition = base;
         }
-        
+
         @Override
         public void trigger(Action action) {
-            if (action == null)
+            if (action == null) {
                 throw new NullPointerException("Action cannot be null");
-            
-            synchronized(listener) {
+            }
+
+            synchronized (listener) {
                 triggers.add(new PredicatedAction(action, condition));
             }
         }
     }
-    
+
     /*
      * Simple pair between an action and its triggering predicate
      */
     private static class PredicatedAction {
         final Action trigger;
         final Predicate condition;
-        
+
         public PredicatedAction(Action trigger, Predicate condition) {
             this.trigger = trigger;
             this.condition = condition;
         }
-        
+
         public void apply(InputState prev, InputState next) {
-            if (condition.apply(prev, next))
+            if (condition.apply(prev, next)) {
                 trigger.perform(prev, next);
+            }
         }
     }
 }

File ferox-input/src/main/java/com/ferox/input/logic/InputState.java

 public class InputState {
     private final KeyboardState keyboard;
     private final MouseState mouse;
-    
+
     private final long timestamp; // nanos
-    
+
     /**
      * Create a new InputState that has the empty or default keyboard and mouse
      * states. Its timestamp is set to the currently reporting system time.
     public InputState() {
         keyboard = new KeyboardState();
         mouse = new MouseState();
-        
-        timestamp = System.currentTimeMillis();
+
+        timestamp = System.nanoTime();
     }
-    
+
     /**
      * Create a new InputState that clones the mouse and keyboard states from
      * the given InputState, but has an updated timestamp to the current system
     public InputState(InputState prev) {
         keyboard = prev.keyboard;
         mouse = prev.mouse;
-        
+
         timestamp = System.nanoTime();
     }
-    
+
     /**
      * Create a new InputState that computes the effective state of applying the
      * given key event to the previous keyboard state, and preserving the
             keyboard = new KeyboardState(null, event);
             mouse = new MouseState();
         }
-        
+
         timestamp = System.nanoTime();
     }
-    
+
     /**
      * Create a new InputState that computes the effective state of applying the
      * given mouse event to the previous mouse state, and preserving the
             keyboard = new KeyboardState();
             mouse = new MouseState(null, event);