4646import de .lessvoid .nifty .spi .input .InputSystem ;
4747import de .lessvoid .nifty .tools .resourceloader .NiftyResourceLoader ;
4848import java .util .ArrayList ;
49+ import java .util .List ;
4950import java .util .logging .Level ;
5051import java .util .logging .Logger ;
5152
5253public class InputSystemJme implements InputSystem , RawInputListener {
5354
54- private final ArrayList <InputEvent > inputQueue = new ArrayList <InputEvent >();
55- private InputManager inputManager ;
56- private boolean [] niftyOwnsDragging = new boolean [3 ];
55+ private final List <InputEvent > inputQueue = new ArrayList <>();
56+ private final InputManager inputManager ;
57+ private final boolean [] niftyOwnsDragging = new boolean [3 ];
5758 private int inputPointerId = -1 ;
5859 private int x , y ;
5960 private int height ;
@@ -65,6 +66,7 @@ public InputSystemJme(InputManager inputManager) {
6566 this .inputManager = inputManager ;
6667 }
6768
69+ @ Override
6870 public void setResourceLoader (NiftyResourceLoader niftyResourceLoader ) {
6971 }
7072
@@ -101,15 +103,18 @@ public void setHeight(int height) {
101103 this .height = height ;
102104 }
103105
106+ @ Override
104107 public void setMousePosition (int x , int y ) {
105108 // TODO: When does nifty use this?
106109 }
107110
111+ @ Override
108112 public void beginInput () {
109113 }
110114
115+ @ Override
111116 public void endInput () {
112- boolean result = nifty .update ();
117+ nifty .update ();
113118 }
114119
115120 private void handleMouseEvent (int button , boolean value , NiftyInputConsumer nic , InputEvent evt ) {
@@ -251,6 +256,7 @@ private void onKeyEventQueued(KeyInputEvent evt, NiftyInputConsumer nic) {
251256 }
252257 }
253258
259+ @ Override
254260 public void onMouseMotionEvent (MouseMotionEvent evt ) {
255261 // Only forward the event if there's actual motion involved.
256262 if (inputManager .isCursorVisible () && (evt .getDX () != 0
@@ -260,6 +266,7 @@ public void onMouseMotionEvent(MouseMotionEvent evt) {
260266 }
261267 }
262268
269+ @ Override
263270 public void onMouseButtonEvent (MouseButtonEvent evt ) {
264271 if (evt .getButtonIndex () >= 0 && evt .getButtonIndex () <= 2 ) {
265272 if (evt .isReleased () || inputManager .isCursorVisible ()) {
@@ -270,20 +277,25 @@ public void onMouseButtonEvent(MouseButtonEvent evt) {
270277 }
271278 }
272279
280+ @ Override
273281 public void onJoyAxisEvent (JoyAxisEvent evt ) {
274282 }
275283
284+ @ Override
276285 public void onJoyButtonEvent (JoyButtonEvent evt ) {
277286 }
278287
288+ @ Override
279289 public void onKeyEvent (KeyInputEvent evt ) {
280290 inputQueue .add (evt );
281291 }
282292
293+ @ Override
283294 public void onTouchEvent (TouchEvent evt ) {
284295 inputQueue .add (evt );
285296 }
286297
298+ @ Override
287299 public void forwardEvents (NiftyInputConsumer nic ) {
288300 int queueSize = inputQueue .size ();
289301
@@ -317,6 +329,8 @@ private void processSoftKeyboard() {
317329 }
318330
319331 softTextDialogInput .requestDialog (SoftTextDialogInput .TEXT_ENTRY_DIALOG , "Enter Text" , initialValue , new SoftTextDialogInputListener () {
332+
333+ @ Override
320334 public void onSoftText (int action , String text ) {
321335 if (action == SoftTextDialogInputListener .COMPLETE ) {
322336 textField .setText (text );
0 commit comments