Skip to content

Commit 087b249

Browse files
committed
fix whitespace and line endings
1 parent 5fda794 commit 087b249

33 files changed

Lines changed: 1270 additions & 1270 deletions

src/controller/AbstractCompiler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
import view.View;
55

66
public abstract class AbstractCompiler implements ExecutableTask {
7-
7+
88
final Runnable runBefore;
99
final Runnable runAfter;
1010
final View view;
1111
final CompileMode mode;
12-
12+
1313
public AbstractCompiler(CompileMode mode, View view) {
1414
this.mode = mode;
1515
this.view = view;
@@ -59,7 +59,7 @@ public void run() {
5959
public abstract boolean checkOutputFilesExist();
6060
public abstract boolean writeSettings();
6161
public abstract void writeControllerFile();
62-
62+
6363
@Override
6464
public abstract void execute();
6565
}

src/controller/CommandLineArguments.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,51 @@
77
class CommandLineArguments implements Iterable<String> {
88

99
private final List<String> argsList;
10-
10+
1111
private CommandLineArguments(String[] args) {
1212
this.argsList = Arrays.asList(args);
1313
}
14-
14+
1515
@Override
1616
public Iterator<String> iterator() {
1717
return argsList.iterator();
1818
}
19-
19+
2020
public String getArgument(ArgumentID argumentID) {
2121
return argsList.get(argumentID.index);
2222
}
23-
23+
2424
public void setArgument(ArgumentID argumentID, String argumentValue) {
2525
this.argsList.set(argumentID.index, argumentValue);
2626
}
2727

2828
public void setArgument(int index, String argumentValue) {
2929
this.argsList.set(index, argumentValue);
3030
}
31-
31+
3232
public static CommandLineArguments getInstance(String[] args) {
3333
if (args.length != getExpectedArgumentCount()) {
3434
return null;
3535
} else {
3636
return new CommandLineArguments(args);
3737
}
3838
}
39-
39+
4040
public static CommandLineArguments getInstance() {
4141
String[] args = new String[getExpectedArgumentCount()];
4242
for (int i = 0; i < args.length; i++) {
4343
args[i] = ArgumentID.values()[i].defaultValue;
4444
}
4545
return getInstance(args);
4646
}
47-
47+
4848
public static int getExpectedArgumentCount() {
4949
return ArgumentID.values().length;
5050
}
5151

5252
private static final String defaultWord = "0xFFFF";
5353
public enum ArgumentID {
54-
54+
5555
INPUT_DIR(0, ""),
5656
OUTPUT_DIR(1, ""),
5757
RHD_FLAG(2, "1"),
@@ -68,7 +68,7 @@ public enum ArgumentID {
6868

6969
private final int index;
7070
private final String defaultValue;
71-
71+
7272
ArgumentID(int index, String defaultValue) {
7373
this.index = index;
7474
this.defaultValue = defaultValue;

src/controller/CompileMode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ public enum CompileMode {
66
DEFAULT_STRICT,
77
DEFAULT,
88
COMMAND_LINE;
9-
9+
1010
public boolean isInteractive() {
1111
return this != CompileMode.COMMAND_LINE;
1212
}
13-
13+
1414
public boolean isDetailed() {
1515
return this == DEVELOPER || this == DEBUG;
1616
}

src/controller/Compiler.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
public abstract class Compiler extends AbstractCompiler {
3939

40-
// static final String RESOURCE_DIR = "resources";
40+
// static final String RESOURCE_DIR = "resources";
4141

4242
private final File RESOURCE_DIR, XML_DIR, XML_FILE, XML_FILE_TEMP;
4343
private final File[] DATA_FILES;
@@ -46,21 +46,21 @@ public abstract class Compiler extends AbstractCompiler {
4646
private File inputDir, outputDir;
4747
private File[] rulDirs;
4848
private boolean isLHD;
49-
49+
5050
private boolean firstXMLisActive;
5151

5252
private PatternNode rootNode;
5353
private JTree tree;
5454
// private MyCheckTreeManager checkTreeManager;
5555
private Queue<Pattern> patterns;
5656
private CollectRULsTask collectRULsTask;
57-
57+
5858
private File outputFile;
59-
59+
6060
public static Compiler getCommandLineCompiler(File resourceDir, CommandLineArguments args) {
6161
return new CommandLineCompiler(resourceDir, args);
6262
}
63-
63+
6464
public static Compiler getInteractiveCompiler(File resourceDir, CompileMode mode) {
6565
if (!mode.isInteractive()) {
6666
throw new IllegalArgumentException("GUICompiler must be executed in interactive mode.");
@@ -79,7 +79,7 @@ public static Compiler getInteractiveCompiler(File resourceDir, CompileMode mode
7979
}
8080
return new GUICompiler(resourceDir, mode);
8181
}
82-
82+
8383
private Compiler(File resourceDir, CompileMode mode, View view, CommandLineArguments args) {
8484
super(mode, view);
8585
this.RESOURCE_DIR = resourceDir;
@@ -205,7 +205,7 @@ public boolean collectPatterns() {
205205
return false;
206206
}
207207
}
208-
208+
209209
@Override
210210
public boolean collectRULInputFiles() {
211211
collectRULsTask = CollectRULsTask.getInstance(mode, rulDirs, isLHD);
@@ -224,7 +224,7 @@ public boolean checkOutputFilesExist() {
224224
LOGGER.info("Created output directory: " + outputDir);
225225
}
226226
}
227-
227+
228228
// outputFile = new File(outputDir, String.format(
229229
// "NetworkAddonMod_Controller_%s_HAND_VERSION.dat", isLHD ? "LEFT" : "RIGHT"));
230230
outputFile = new File(outputDir, "NetworkAddonMod_Controller.dat");
@@ -274,27 +274,27 @@ public boolean writeSettings() {
274274
}
275275
return false;
276276
}
277-
277+
278278
@Override
279279
public void writeControllerFile() {
280280
ExecutableTask writeTask = WriteControllerTask.getInstance(mode, collectRULsTask, isLHD, patterns, inputDir.toURI(), outputFile, view);
281281
writeTask.execute();
282282
// result will be handled by determineResult in writeTask
283283
}
284-
284+
285285
private static class GUICompiler extends Compiler {
286-
286+
287287
private GUICompiler(File resourceDir, CompileMode mode) {
288288
super(resourceDir, mode, new GUIView(), CommandLineArguments.getInstance());
289289
assert mode.isInteractive() : mode;
290290
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
291-
@Override
292-
public void uncaughtException(Thread t, Throwable e) {
293-
GUICompiler.super.view.publishException(e.getLocalizedMessage(), e);
294-
}
295-
});
291+
@Override
292+
public void uncaughtException(Thread t, Throwable e) {
293+
GUICompiler.super.view.publishException(e.getLocalizedMessage(), e);
294+
}
295+
});
296296
}
297-
297+
298298
@Override
299299
public boolean readSettings() {
300300
// TODO
@@ -317,13 +317,13 @@ public boolean readSettings() {
317317
return true;
318318
}
319319
}
320-
320+
321321
@Override
322322
public void execute() {
323323
runBefore.run();
324324
showGUI();
325325
}
326-
326+
327327
private void showGUI() {
328328
SwingUtilities.invokeLater(new Runnable() {
329329
@Override
@@ -351,7 +351,7 @@ public void actionPerformed(ActionEvent ae) {
351351
}
352352
});
353353
}
354-
354+
355355
@Override
356356
public boolean readXML() {
357357
boolean success = super.readXML();
@@ -363,27 +363,27 @@ public boolean readXML() {
363363
return success;
364364
}
365365
}
366-
366+
367367
private static class CommandLineCompiler extends Compiler {
368-
368+
369369
private CommandLineCompiler(File resourceDir, CommandLineArguments args) {
370370
super(resourceDir, CompileMode.COMMAND_LINE, new ConsoleView(), args);
371371
super.inputDir = new File(super.settingsManager.getInput());
372372
super.outputDir = new File(super.settingsManager.getOutput());
373373
super.isLHD = super.settingsManager.getLhdFlag();
374374
}
375-
375+
376376
@Override
377377
public boolean readSettings() {
378378
return true;
379379
}
380-
380+
381381
@Override
382382
public void execute() {
383383
runBefore.run();
384384
runAfter.run();
385385
}
386-
386+
387387
@Override
388388
public boolean writeSettings() {
389389
// this method does not write the XML file, in contrast to the super method

src/controller/CompilerSettingsManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
import controller.CommandLineArguments.ArgumentID;
1212

1313
public class CompilerSettingsManager {
14-
14+
1515
// private String input = "", output = "";
1616
// private boolean lhdFlag = false;
1717
private final File dataFile, tempFile1, tempFile2;
1818
private final CommandLineArguments arguments;
19-
19+
2020
public CompilerSettingsManager(File[] dataFiles, CommandLineArguments arguments) {
2121
this.dataFile = dataFiles[0];
2222
this.tempFile1 = dataFiles[1];
2323
this.tempFile2 = dataFiles[2];
2424
this.arguments = arguments;
2525
}
26-
26+
2727
public void readSettings() throws FileNotFoundException {
2828
File fileToRead = dataFile.exists() ? dataFile : (tempFile1.exists() ? tempFile1 : tempFile2);
2929
Scanner scanner = new Scanner(fileToRead);
@@ -37,21 +37,21 @@ public void readSettings() throws FileNotFoundException {
3737
}
3838
scanner.close();
3939
}
40-
40+
4141
/**
4242
* Writes the settings into the dataFile.
4343
*/
4444
public void writeSettings(File inputDir, File outputDir, boolean isLHD) throws FileNotFoundException {
4545
arguments.setArgument(ArgumentID.INPUT_DIR, inputDir.getAbsolutePath());
4646
arguments.setArgument(ArgumentID.OUTPUT_DIR, outputDir.getAbsolutePath());
4747
arguments.setArgument(ArgumentID.RHD_FLAG, isLHD ? "0" : "1");
48-
48+
4949
PrintWriter printer = new PrintWriter(tempFile1);
5050
for (String arg : arguments) {
5151
printer.println(arg);
5252
}
5353
printer.close();
54-
54+
5555
if (dataFile.exists()) {
5656
if (tempFile2.exists()) {
5757
tempFile2.delete();

0 commit comments

Comments
 (0)