more gamepad stuff

- now have settings files
- now read/write gamepad settings to file
- now map button/axis for gamepads
This commit is contained in:
Diego Waxemberg
2013-12-19 20:31:33 -05:00
parent 0885b876d5
commit c414fca5af
9 changed files with 223 additions and 32 deletions

View File

@@ -1,9 +1,11 @@
package com.limelight.input;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.io.Serializable;
public enum ControllerComponent {
import javax.swing.JButton;
import javax.swing.JLabel;
public enum ControllerComponent implements Serializable {
BTN_A("Button 1 (A)", false), BTN_X("Button 2 (X)", false), BTN_Y("Button 3 (Y)", false), BTN_B("Button 4 (B)", false),
DPAD_UP("D-pad Up", false), DPAD_DOWN("D-pad Down", false), DPAD_LEFT("D-pad Left", false), DPAD_RIGHT("D-pad Right", false),
LS_X("Left Stick X", true), LS_Y("Left Stick X", true), RS_X("Right Stick X", true), RS_Y("Left Stick Y", true),
@@ -12,14 +14,13 @@ public enum ControllerComponent {
BTN_START("Start Button", false), BTN_BACK("Back Button", false), BTN_SPECIAL("Special Button", false);
private JLabel label;
private JTextField textBox;
private JButton mapButton;
private boolean analog;
private ControllerComponent(String name, boolean analog) {
this.label = new JLabel(name);
this.textBox = new JTextField();
this.textBox.setEditable(false);
this.textBox.setName(this.name());
this.mapButton = new JButton();
this.mapButton.setName(this.name());
this.analog = analog;
}
@@ -27,8 +28,8 @@ public enum ControllerComponent {
return label;
}
public JTextField getTextField() {
return textBox;
public JButton getMapButton() {
return mapButton;
}
public boolean isAnalog() {