private boolean running = false;
private int size = 20;
- int speed = 10;
+ int speed = 2;
public Map() {
this.setBackground(new Color(40, 40, 40));
// If they both exist check if same node else move che start node
else {
- if (PathfinderUtils.isSameNode(node, PathfinderUtils.endNode)) {
+ if (PathfinderUtils.endNode != null && PathfinderUtils.isSameNode(node, PathfinderUtils.endNode)) {
JOptionPane.showMessageDialog(null, "End node and start node can't be the same node",
"Same node error", JOptionPane.ERROR_MESSAGE);
return;
}
// If they both exist check if same node else move the end node
else {
- if (PathfinderUtils.startNode != null && PathfinderUtils.endNode == null) {
+ if (PathfinderUtils.startNode !=null && PathfinderUtils.isSameNode(node, PathfinderUtils.startNode)) {
JOptionPane.showMessageDialog(null, "End node and start node can't be the same node",
"Same node error", JOptionPane.ERROR_MESSAGE);
return;
-------------------------------------------------------------------------------
Test set: Main.AppTest
-------------------------------------------------------------------------------
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.03 s - in Main.AppTest
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 s - in Main.AppTest
<?xml version="1.0" encoding="UTF-8"?>
-<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="Main.AppTest" time="0.03" tests="1" errors="0" skipped="0" failures="0">
+<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="Main.AppTest" time="0.025" tests="1" errors="0" skipped="0" failures="0">
<properties>
<property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
<property name="java.specification.version" value="11"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="user.country" value="US"/>
<property name="sun.boot.library.path" value="/usr/lib/jvm/openjdk11-bin/lib"/>
- <property name="sun.java.command" value="/home/leo/Docs/Proj/Pathfinder/target/surefire/surefirebooter4082728071684051500.jar /home/leo/Docs/Proj/Pathfinder/target/surefire 2021-11-19T20-44-45_157-jvmRun1 surefire17835783201909300860tmp surefire_02185374437203797851tmp"/>
+ <property name="sun.java.command" value="/home/leo/Docs/Proj/Pathfinder/target/surefire/surefirebooter7497617524640717844.jar /home/leo/Docs/Proj/Pathfinder/target/surefire 2021-11-19T21-17-25_132-jvmRun1 surefire5030477053776971331tmp surefire_02397316267537071803tmp"/>
<property name="jdk.debug" value="release"/>
<property name="surefire.test.class.path" value="/home/leo/Docs/Proj/Pathfinder/target/test-classes:/home/leo/Docs/Proj/Pathfinder/target/classes:/home/leo/.m2/repository/junit/junit/4.11/junit-4.11.jar:/home/leo/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:"/>
<property name="sun.cpu.endian" value="little"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
- <property name="surefire.real.class.path" value="/home/leo/Docs/Proj/Pathfinder/target/surefire/surefirebooter4082728071684051500.jar"/>
+ <property name="surefire.real.class.path" value="/home/leo/Docs/Proj/Pathfinder/target/surefire/surefirebooter7497617524640717844.jar"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="java.runtime.version" value="11+28"/>
<property name="user.name" value="leo"/>