Formatting code, removed TODO and imports.

This commit is contained in:
Maschell 2017-03-27 20:40:44 +02:00
parent e7fc629bec
commit 72fd042a3a
3 changed files with 13 additions and 20 deletions

View File

@ -52,7 +52,7 @@ public class GuiInputControls extends JPanel implements ActionListener {
private JTextField ipTextBox;
private JPanel ipTextBoxWrap;
private JLabel statusLabel;
private JPanel autoActivateWrap;
private JCheckBox cbautoActivateController;
@ -79,12 +79,11 @@ public class GuiInputControls extends JPanel implements ActionListener {
statusLabel = new JLabel("Ready.");
statusLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
cbautoActivateController = new JCheckBox();
cbautoActivateController = new JCheckBox();
cbautoActivateController.setSelected(Settings.AUTO_ACTIVATE_CONTROLLER);
cbautoActivateController.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
boolean selected = ((JCheckBox) e.getSource()).isSelected();
@ -92,12 +91,12 @@ public class GuiInputControls extends JPanel implements ActionListener {
cbautoActivateController.setSelected(selected);
}
});
autoActivateWrap = new JPanel(new FlowLayout());
autoActivateWrap.add(new JLabel("Auto Activate Controller: "));
autoActivateWrap.add(cbautoActivateController);
autoActivateWrap.setMaximumSize(new Dimension(1000, 20));
add(Box.createVerticalGlue());
add(ipTextBoxWrap);

View File

@ -98,7 +98,7 @@ public class ControllerManager {
} catch (ControllerInitializationFailedException e) {
// e.printStackTrace();
}
break;
break;
case XINPUT14:
try {
c = new XInput14Controller(deviceIdentifier);
@ -108,7 +108,7 @@ public class ControllerManager {
break;
case XINPUT13:
try {
c = new XInput13Controller(deviceIdentifier);
c = new XInput13Controller(deviceIdentifier);
} catch (ControllerInitializationFailedException e) {
// e.printStackTrace();
}
@ -117,7 +117,7 @@ public class ControllerManager {
break;
}
if (c != null) { // I don't like that starting the Thread happens here =/
if(Settings.AUTO_ACTIVATE_CONTROLLER){
if (Settings.AUTO_ACTIVATE_CONTROLLER) {
c.setActive(true);
}
new Thread(c).start();

View File

@ -26,17 +26,11 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.java.Log;
import net.ash.HIDToVPADNetworkClient.controller.Controller.ControllerType;
import net.ash.HIDToVPADNetworkClient.util.Settings.Platform;
//TODO autosave IP addr
@Log
public class Settings {
@ -91,11 +85,11 @@ public class Settings {
Settings.ipAddr = prop.getProperty("ipAddr");
String autoActivatingControllerString = prop.getProperty("autoActivatingController");
if(autoActivatingControllerString != null){ //We don't combine the if statements to keep the default value.
if(autoActivatingControllerString.equals("true")){
if (autoActivatingControllerString != null) { // We don't combine the if statements to keep the default value.
if (autoActivatingControllerString.equals("true")) {
Settings.AUTO_ACTIVATE_CONTROLLER = true;
}else{
} else {
Settings.AUTO_ACTIVATE_CONTROLLER = false;
}
}