mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2025-12-06 08:01:59 +01:00
Fixed compile warnings for awt plugin
This commit is contained in:
parent
81c9c872cd
commit
2bc8a793c8
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2004 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -43,7 +43,7 @@ import java.lang.reflect.Modifier;
|
|||
* @author elias
|
||||
*/
|
||||
final class AWTKeyboard extends Keyboard implements AWTEventListener {
|
||||
private final List awt_events = new ArrayList();
|
||||
private final List<KeyEvent> awt_events = new ArrayList<>();
|
||||
private Event[] processed_events;
|
||||
private int processed_events_index;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ final class AWTKeyboard extends Keyboard implements AWTEventListener {
|
|||
}
|
||||
|
||||
private final static Component[] createComponents() {
|
||||
List components = new ArrayList();
|
||||
List<Component> components = new ArrayList<>();
|
||||
Field[] vkey_fields = KeyEvent.class.getFields();
|
||||
for (int i = 0; i < vkey_fields.length; i++) {
|
||||
Field vkey_field = vkey_fields[i];
|
||||
|
|
@ -80,7 +80,7 @@ final class AWTKeyboard extends Keyboard implements AWTEventListener {
|
|||
components.add(new Key(Component.Identifier.Key.RETURN));
|
||||
components.add(new Key(Component.Identifier.Key.NUMPADCOMMA));
|
||||
components.add(new Key(Component.Identifier.Key.COMMA));
|
||||
return (Component[])components.toArray(new Component[]{});
|
||||
return components.toArray(new Component[]{});
|
||||
}
|
||||
|
||||
private final void resizeEventQueue(int size) {
|
||||
|
|
@ -96,13 +96,12 @@ final class AWTKeyboard extends Keyboard implements AWTEventListener {
|
|||
|
||||
public final synchronized void eventDispatched(AWTEvent event) {
|
||||
if (event instanceof KeyEvent)
|
||||
awt_events.add(event);
|
||||
awt_events.add((KeyEvent)event);
|
||||
}
|
||||
|
||||
public final synchronized void pollDevice() throws IOException {
|
||||
for (int i = 0; i < awt_events.size(); i++) {
|
||||
KeyEvent event = (KeyEvent)awt_events.get(i);
|
||||
processEvent(event);
|
||||
processEvent(awt_events.get(i));
|
||||
}
|
||||
awt_events.clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
* Copyright (C) 2004 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -27,7 +27,6 @@
|
|||
package net.java.games.input;
|
||||
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Point;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.AWTEventListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
|
@ -47,8 +46,8 @@ final class AWTMouse extends Mouse implements AWTEventListener {
|
|||
private final static int EVENT_Y = 2;
|
||||
private final static int EVENT_BUTTON = 4;
|
||||
|
||||
private final List awt_events = new ArrayList();
|
||||
private final List processed_awt_events = new ArrayList();
|
||||
private final List<AWTEvent> awt_events = new ArrayList<>();
|
||||
private final List<AWTEvent> processed_awt_events = new ArrayList<>();
|
||||
|
||||
private int event_state = EVENT_X;
|
||||
|
||||
|
|
@ -115,7 +114,7 @@ final class AWTMouse extends Mouse implements AWTEventListener {
|
|||
Axis wheel = (Axis)getWheel();
|
||||
wheel.setValue(0);
|
||||
for (int i = 0; i < awt_events.size(); i++) {
|
||||
AWTEvent event = (AWTEvent)awt_events.get(i);
|
||||
AWTEvent event = awt_events.get(i);
|
||||
processEvent(event);
|
||||
processed_awt_events.add(event);
|
||||
}
|
||||
|
|
@ -126,7 +125,7 @@ final class AWTMouse extends Mouse implements AWTEventListener {
|
|||
while (true) {
|
||||
if (processed_awt_events.isEmpty())
|
||||
return false;
|
||||
AWTEvent awt_event = (AWTEvent)processed_awt_events.get(0);
|
||||
AWTEvent awt_event = processed_awt_events.get(0);
|
||||
if (awt_event instanceof MouseWheelEvent) {
|
||||
MouseWheelEvent awt_wheel_event = (MouseWheelEvent)awt_event;
|
||||
long nanos = awt_wheel_event.getWhen()*1000000L;
|
||||
|
|
|
|||
Loading…
Reference in a new issue