Compare commits
No commits in common. "3b56a1fb5094f1912958542b9b7ca31400bd9932" and "5c2fde6c698f7ad351b8b0c866c400d7a32bed6f" have entirely different histories.
3b56a1fb50
...
5c2fde6c69
@ -6,11 +6,6 @@
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="snapshots" />
|
||||
<option name="name" value="Sonatype Snapshots" />
|
||||
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
|
35
pom.xml
35
pom.xml
@ -13,38 +13,5 @@
|
||||
<maven.compiler.target>19</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.fxmisc.richtext</groupId>
|
||||
<artifactId>richtextfx</artifactId>
|
||||
<version>0.11.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-controls</artifactId>
|
||||
<version>12.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-fxml</artifactId>
|
||||
<version>20.0.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-maven-plugin</artifactId>
|
||||
<version>0.0.8</version>
|
||||
<configuration>
|
||||
<mainClass>edu.jturn.cs3642.CS3642-Artificial_Intelligence/Assignments.A1.GUIDriver</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -14,8 +14,6 @@ import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.PriorityQueue;
|
||||
@ -124,17 +122,32 @@ public class Driver {
|
||||
}
|
||||
|
||||
private static void writeToFile(String name, StringBuffer values) {
|
||||
URL resourcePath = Driver.class.getResource("/A1/results/AStar.txt");
|
||||
URI resourceURI = URI.create(resourcePath.toString());
|
||||
File resource = new File(resourceURI.getPath());
|
||||
File directory = new File("src/Assignments/A1/results");
|
||||
if (!directory.exists()) {
|
||||
directory.mkdirs();
|
||||
System.out.println("Creating Directory: results");
|
||||
}
|
||||
|
||||
try (FileWriter out = new FileWriter(resource)) {
|
||||
File output = new File(directory, name + ".txt");
|
||||
|
||||
try {
|
||||
if (!output.createNewFile()) {
|
||||
System.out.println("File Already Exists: " + name + ".txt");
|
||||
} else {
|
||||
System.out.println("File Created: " + name + ".txt");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.err.println("Error creating file: " + e.getMessage());
|
||||
}
|
||||
|
||||
try (FileWriter out = new FileWriter(output)) {
|
||||
out.write(values.toString());
|
||||
System.out.println("Data written to file: " + name + ".txt");
|
||||
} catch (IOException e) {
|
||||
System.err.println("Error writing to file: " + e.getMessage());
|
||||
}
|
||||
openDirectoryFile(resource);
|
||||
|
||||
openDirectoryFile(output);
|
||||
}
|
||||
|
||||
private static void openDirectoryFile(File open) {
|
||||
|
@ -1,26 +0,0 @@
|
||||
package Assignments.A1;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class GUIDriver extends Application {
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) throws Exception {
|
||||
Parent root = FXMLLoader.load(getClass().getResource("/A1/view/BoardView.fxml"));
|
||||
|
||||
Scene scene = new Scene(root);
|
||||
scene.getStylesheets().add(getClass().getResource("A1/view/styles.css").toExternalForm());
|
||||
|
||||
stage.setTitle("JavaFX and Maven");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package Assignments.A1;
|
||||
|
||||
public class GUILauncher {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
GUIDriver.main(args);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user