mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2025-12-06 08:01:59 +01:00
Fixed compile warnings
This commit is contained in:
parent
67902800ab
commit
466e4a6bdb
|
|
@ -46,6 +46,7 @@ import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.WindowConstants;
|
||||||
|
|
||||||
import net.java.games.input.Component;
|
import net.java.games.input.Component;
|
||||||
import net.java.games.input.Controller;
|
import net.java.games.input.Controller;
|
||||||
|
|
@ -55,7 +56,10 @@ import net.java.games.input.Event;
|
||||||
import net.java.games.input.Version;
|
import net.java.games.input.Version;
|
||||||
|
|
||||||
public class ControllerEventTest extends JFrame{
|
public class ControllerEventTest extends JFrame{
|
||||||
|
private static final long serialVersionUID = -8266185848160199092L;
|
||||||
|
|
||||||
private static abstract class AxisPanel extends JPanel{
|
private static abstract class AxisPanel extends JPanel{
|
||||||
|
private static final long serialVersionUID = -6200599064870672000L;
|
||||||
Component axis;
|
Component axis;
|
||||||
float data;
|
float data;
|
||||||
|
|
||||||
|
|
@ -79,6 +83,7 @@ public class ControllerEventTest extends JFrame{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DigitalAxisPanel extends AxisPanel {
|
private static class DigitalAxisPanel extends AxisPanel {
|
||||||
|
private static final long serialVersionUID = -4729666037860134626L;
|
||||||
JLabel digitalState = new JLabel("<unread>");
|
JLabel digitalState = new JLabel("<unread>");
|
||||||
|
|
||||||
public DigitalAxisPanel(Component ax) {
|
public DigitalAxisPanel(Component ax) {
|
||||||
|
|
@ -102,6 +107,7 @@ public class ControllerEventTest extends JFrame{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DigitalHatPanel extends AxisPanel {
|
private static class DigitalHatPanel extends AxisPanel {
|
||||||
|
private static final long serialVersionUID = -6582605379682496832L;
|
||||||
JLabel digitalState = new JLabel("<unread>");
|
JLabel digitalState = new JLabel("<unread>");
|
||||||
|
|
||||||
public DigitalHatPanel(Component ax) {
|
public DigitalHatPanel(Component ax) {
|
||||||
|
|
@ -145,6 +151,7 @@ public class ControllerEventTest extends JFrame{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static class AnalogAxisPanel extends AxisPanel {
|
private static class AnalogAxisPanel extends AxisPanel {
|
||||||
|
private static final long serialVersionUID = 7536173405896285590L;
|
||||||
JLabel analogState = new JLabel("<unread>");
|
JLabel analogState = new JLabel("<unread>");
|
||||||
|
|
||||||
public AnalogAxisPanel(Component ax) {
|
public AnalogAxisPanel(Component ax) {
|
||||||
|
|
@ -164,8 +171,9 @@ public class ControllerEventTest extends JFrame{
|
||||||
|
|
||||||
|
|
||||||
private static class ControllerWindow extends JFrame {
|
private static class ControllerWindow extends JFrame {
|
||||||
|
private static final long serialVersionUID = 8623977198558568961L;
|
||||||
Controller ca;
|
Controller ca;
|
||||||
Map axes_to_panels = new HashMap();
|
Map<Component, AxisPanel> axes_to_panels = new HashMap<>();
|
||||||
boolean disabled = false;
|
boolean disabled = false;
|
||||||
|
|
||||||
public ControllerWindow(JFrame frame,Controller ca){
|
public ControllerWindow(JFrame frame,Controller ca){
|
||||||
|
|
@ -207,7 +215,7 @@ public class ControllerEventTest extends JFrame{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAxis(JPanel p, Component ax){
|
private void addAxis(JPanel p, Component ax){
|
||||||
JPanel p2;
|
AxisPanel p2;
|
||||||
if (ax.isAnalog()) {
|
if (ax.isAnalog()) {
|
||||||
p2 = new AnalogAxisPanel(ax);
|
p2 = new AnalogAxisPanel(ax);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -234,14 +242,14 @@ public class ControllerEventTest extends JFrame{
|
||||||
EventQueue event_queue = ca.getEventQueue();
|
EventQueue event_queue = ca.getEventQueue();
|
||||||
Event event = new Event();
|
Event event = new Event();
|
||||||
while (event_queue.getNextEvent(event)) {
|
while (event_queue.getNextEvent(event)) {
|
||||||
AxisPanel panel = (AxisPanel)axes_to_panels.get(event.getComponent());
|
AxisPanel panel = axes_to_panels.get(event.getComponent());
|
||||||
panel.setPollData(event.getValue());
|
panel.setPollData(event.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static final long HEARTBEATMS =100; // 10th of a second
|
static final long HEARTBEATMS =100; // 10th of a second
|
||||||
List controllers = new ArrayList();
|
List<ControllerWindow> controllers = new ArrayList<>();
|
||||||
|
|
||||||
public ControllerEventTest() {
|
public ControllerEventTest() {
|
||||||
super("Controller Event Test. Version: " + Version.getVersion());
|
super("Controller Event Test. Version: " + Version.getVersion());
|
||||||
|
|
@ -251,14 +259,12 @@ public class ControllerEventTest extends JFrame{
|
||||||
makeController(ca[i]);
|
makeController(ca[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
new Thread(new Runnable() {
|
new Thread(() -> {
|
||||||
public void run(){
|
|
||||||
try {
|
try {
|
||||||
while(true){
|
while(true){
|
||||||
for(Iterator i=controllers.iterator();i.hasNext();){
|
for(Iterator<ControllerWindow> i=controllers.iterator();i.hasNext();){
|
||||||
try {
|
try {
|
||||||
ControllerWindow cw = (ControllerWindow)i.next();
|
i.next().poll();
|
||||||
cw.poll();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
@ -268,11 +274,10 @@ public class ControllerEventTest extends JFrame{
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}).start();
|
}).start();
|
||||||
pack();
|
pack();
|
||||||
setSize(400,400);
|
setSize(400,400);
|
||||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,13 +49,17 @@ import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.WindowConstants;
|
||||||
|
|
||||||
import net.java.games.input.Component;
|
import net.java.games.input.Component;
|
||||||
import net.java.games.input.Controller;
|
import net.java.games.input.Controller;
|
||||||
import net.java.games.input.ControllerEnvironment;
|
import net.java.games.input.ControllerEnvironment;
|
||||||
|
|
||||||
public class ControllerReadTest extends JFrame{
|
public class ControllerReadTest extends JFrame{
|
||||||
|
private static final long serialVersionUID = -7129976919159465311L;
|
||||||
|
|
||||||
private abstract static class AxisPanel extends JPanel{
|
private abstract static class AxisPanel extends JPanel{
|
||||||
|
private static final long serialVersionUID = -2117191506803328790L;
|
||||||
Component axis;
|
Component axis;
|
||||||
float data;
|
float data;
|
||||||
|
|
||||||
|
|
@ -79,6 +83,7 @@ public class ControllerReadTest extends JFrame{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DigitalAxisPanel extends AxisPanel {
|
private static class DigitalAxisPanel extends AxisPanel {
|
||||||
|
private static final long serialVersionUID = -4006900519933869168L;
|
||||||
JLabel digitalState = new JLabel("<unread>");
|
JLabel digitalState = new JLabel("<unread>");
|
||||||
|
|
||||||
public DigitalAxisPanel(Component ax) {
|
public DigitalAxisPanel(Component ax) {
|
||||||
|
|
@ -102,6 +107,7 @@ public class ControllerReadTest extends JFrame{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DigitalHatPanel extends AxisPanel {
|
private static class DigitalHatPanel extends AxisPanel {
|
||||||
|
private static final long serialVersionUID = -3293100130201231029L;
|
||||||
JLabel digitalState = new JLabel("<unread>");
|
JLabel digitalState = new JLabel("<unread>");
|
||||||
|
|
||||||
public DigitalHatPanel(Component ax) {
|
public DigitalHatPanel(Component ax) {
|
||||||
|
|
@ -145,6 +151,7 @@ public class ControllerReadTest extends JFrame{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static class AnalogAxisPanel extends AxisPanel {
|
private static class AnalogAxisPanel extends AxisPanel {
|
||||||
|
private static final long serialVersionUID = -3220244985697453835L;
|
||||||
JLabel analogState = new JLabel("<unread>");
|
JLabel analogState = new JLabel("<unread>");
|
||||||
|
|
||||||
public AnalogAxisPanel(Component ax) {
|
public AnalogAxisPanel(Component ax) {
|
||||||
|
|
@ -164,8 +171,9 @@ public class ControllerReadTest extends JFrame{
|
||||||
|
|
||||||
|
|
||||||
private static class ControllerWindow extends JFrame {
|
private static class ControllerWindow extends JFrame {
|
||||||
|
private static final long serialVersionUID = 5812903945250431578L;
|
||||||
Controller ca;
|
Controller ca;
|
||||||
List axisList = new ArrayList();
|
List<AxisPanel> axisList = new ArrayList<>();
|
||||||
boolean disabled = false;
|
boolean disabled = false;
|
||||||
|
|
||||||
public ControllerWindow(JFrame frame,Controller ca){
|
public ControllerWindow(JFrame frame,Controller ca){
|
||||||
|
|
@ -207,7 +215,7 @@ public class ControllerReadTest extends JFrame{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAxis(JPanel p, Component ax){
|
private void addAxis(JPanel p, Component ax){
|
||||||
JPanel p2;
|
AxisPanel p2;
|
||||||
if (ax.isAnalog()) {
|
if (ax.isAnalog()) {
|
||||||
p2 = new AnalogAxisPanel(ax);
|
p2 = new AnalogAxisPanel(ax);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -233,9 +241,9 @@ public class ControllerReadTest extends JFrame{
|
||||||
setDisabled(false);
|
setDisabled(false);
|
||||||
}
|
}
|
||||||
//System.out.println("Polled "+ca.getName());
|
//System.out.println("Polled "+ca.getName());
|
||||||
for(Iterator i =axisList.iterator();i.hasNext();){
|
for(Iterator<AxisPanel> i =axisList.iterator();i.hasNext();){
|
||||||
try {
|
try {
|
||||||
((AxisPanel)i.next()).poll();
|
i.next().poll();
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
@ -244,7 +252,7 @@ public class ControllerReadTest extends JFrame{
|
||||||
}
|
}
|
||||||
|
|
||||||
static final long HEARTBEATMS =100; // 10th of a second
|
static final long HEARTBEATMS =100; // 10th of a second
|
||||||
List controllers = new ArrayList();
|
List<ControllerWindow> controllers = new ArrayList<>();
|
||||||
|
|
||||||
public ControllerReadTest() {
|
public ControllerReadTest() {
|
||||||
super("Controller Read Test. Version: " + Version.getVersion());
|
super("Controller Read Test. Version: " + Version.getVersion());
|
||||||
|
|
@ -254,13 +262,12 @@ public class ControllerReadTest extends JFrame{
|
||||||
makeController(ca[i]);
|
makeController(ca[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
new Thread(new Runnable() {
|
new Thread(() ->{
|
||||||
public void run(){
|
|
||||||
try {
|
try {
|
||||||
while(true){
|
while(true){
|
||||||
for(Iterator i=controllers.iterator();i.hasNext();){
|
for(Iterator<ControllerWindow> i=controllers.iterator();i.hasNext();){
|
||||||
try {
|
try {
|
||||||
ControllerWindow cw = (ControllerWindow)i.next();
|
ControllerWindow cw = i.next();
|
||||||
cw.poll();
|
cw.poll();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -271,11 +278,10 @@ public class ControllerReadTest extends JFrame{
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}).start();
|
}).start();
|
||||||
pack();
|
pack();
|
||||||
setSize(400,400);
|
setSize(400,400);
|
||||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,6 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author administrator
|
|
||||||
*/
|
|
||||||
import net.java.games.input.*;
|
|
||||||
|
|
||||||
public class ControllerTextTest {
|
public class ControllerTextTest {
|
||||||
ControllerEnvironment ce;
|
ControllerEnvironment ce;
|
||||||
/** Creates a new instance of ControllerScanner */
|
/** Creates a new instance of ControllerScanner */
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,30 @@
|
||||||
/*
|
/*
|
||||||
* RumbleTest.java
|
* Copyright (C) 2003 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
*
|
*
|
||||||
* Created on 01 December 2003, 23:02
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
*/
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
import net.java.games.input.ControllerEnvironment;
|
|
||||||
import net.java.games.input.Controller;
|
|
||||||
import net.java.games.input.Rumbler;
|
|
||||||
import net.java.games.input.Version;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Jeremy
|
|
||||||
*/
|
|
||||||
public class RumbleTest {
|
public class RumbleTest {
|
||||||
|
|
||||||
/** Creates a new instance of RumbleTest */
|
/** Creates a new instance of RumbleTest */
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2003 Jeremy Booth (jeremy@newdawnsoftware.com)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer. Redistributions in binary
|
||||||
|
* form must reproduce the above copyright notice, this list of conditions and
|
||||||
|
* the following disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* The name of the author may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||||
|
*/
|
||||||
package net.java.games.input;
|
package net.java.games.input;
|
||||||
|
|
||||||
import net.java.games.input.Version;
|
|
||||||
|
|
||||||
public class VersionTest {
|
public class VersionTest {
|
||||||
|
|
||||||
/**
|
|
||||||
* @param args
|
|
||||||
*/
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("JInput version: " + Version.getVersion());
|
System.out.println("JInput version: " + Version.getVersion());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,12 @@
|
||||||
*/
|
*/
|
||||||
package net.java.games.input.applet;
|
package net.java.games.input.applet;
|
||||||
|
|
||||||
import java.applet.Applet;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import net.java.games.input.ControllerEventTest;
|
import net.java.games.input.ControllerEventTest;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class ControllerEventTestApplet extends Applet {
|
public class ControllerEventTestApplet extends java.applet.Applet {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4250817143444220400L;
|
private static final long serialVersionUID = 4250817143444220400L;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,12 @@
|
||||||
*/
|
*/
|
||||||
package net.java.games.input.applet;
|
package net.java.games.input.applet;
|
||||||
|
|
||||||
import java.applet.Applet;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import net.java.games.input.ControllerReadTest;
|
import net.java.games.input.ControllerReadTest;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class ControllerReadTestApplet extends Applet {
|
public class ControllerReadTestApplet extends java.applet.Applet {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2558493887683964119L;
|
private static final long serialVersionUID = -2558493887683964119L;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue