Skip to content

Commit

Permalink
cleaning up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Veenstra committed Aug 28, 2015
1 parent 8ffcb16 commit f0b7332
Show file tree
Hide file tree
Showing 16 changed files with 183 additions and 196 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

.idea/**
out/**

6 changes: 0 additions & 6 deletions .idea/artifacts/JoyMon.xml

This file was deleted.

349 changes: 176 additions & 173 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file added commons-cli-1.3.1.jar
Binary file not shown.
Binary file added jinput.jar
Binary file not shown.
Binary file removed jinput_nightly_20150718.zip
Binary file not shown.
Binary file added jxl.jar
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 3 additions & 17 deletions src/nl/utwente/aveenstra/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import javafx.application.Application;
import javafx.stage.Stage;
import jfx.messagebox.MessageBox;
import net.java.games.input.Component;
import org.apache.commons.cli.*;

import java.io.File;
import java.util.Arrays;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
Expand All @@ -17,7 +17,6 @@
*/
public class Main {

public static final String DEBUGGING = "blurp";
public static final String AUTHOR = "author";
public static final String CLI = "cli";
public static final String DIRECTORY = "dir";
Expand All @@ -39,7 +38,6 @@ public class Main {
static {
options.addOption(AUTHOR.charAt(0)+"", AUTHOR, true, "Set the name of the author of the results");
options.addOption(CLI.charAt(0)+"", CLI, false, "Do not open a UI, but instead start a CLI.");
options.addOption(DEBUGGING.charAt(0)+"", DEBUGGING, false, "Start the debugging mode.");
options.addOption(DIRECTORY.charAt(0)+"", DIRECTORY, true, "Set the root directory for the results.");
options.addOption("h", "help", false, "Prints this help message.");
}
Expand All @@ -55,20 +53,8 @@ public static void main(String[] args) {
CommandLine line = parser.parse(options, args);
if (line.hasOption('h')) {
printHelp();
} else if (line.hasOption(DEBUGGING)) {
JoystickWrapper joystick = JoystickWrapper.getInstance();
joystickThread = new Thread(joystick, "Joystick Thread");
joystick.addObserver((o, arg) -> {
int i = 0;
for (Component c : JoystickWrapper.getInstance().getController().getComponents()) {

System.out.printf("%d:%1.2f ", i++, c.getPollData());
}
System.out.print("\r");
});
joystickThread.run();
joystickThread.join();
}else {
} else {
System.setProperty("net.java.games.input.librarypath", System.getProperty("user.dir") + File.separator + "lib");
try {
System.out.println(Arrays.toString(Preferences.userRoot().node("JavaJoyMon").keys()));
} catch (BackingStoreException e) {
Expand Down

0 comments on commit f0b7332

Please sign in to comment.