gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f17bcf)
raw | patch | inline | side by side (parent: 3f17bcf)
author | Ivan Pribela <ivanpribela@gmail.com> | |
Fri, 8 Dec 2017 20:16:08 +0000 (21:16 +0100) | ||
committer | Ivan Pribela <ivanpribela@gmail.com> | |
Fri, 8 Dec 2017 20:16:08 +0000 (21:16 +0100) |
PretrazivanjeSaVracanjem/Lavirint/SuperKomplikovanoResenje/Prikaz.java | patch | blob | history |
diff --git a/PretrazivanjeSaVracanjem/Lavirint/SuperKomplikovanoResenje/Prikaz.java b/PretrazivanjeSaVracanjem/Lavirint/SuperKomplikovanoResenje/Prikaz.java
index 4553a243bc0907d7ad52f9bb6cd457db975b5256..92e27555dc00242cef65b2a2c3e81683e8690a9b 100644 (file)
import java.util.LinkedHashMap;\r
import java.util.List;\r
import java.util.Map;\r
+import java.util.concurrent.CountDownLatch;\r
import java.util.function.Function;\r
\r
import javafx.application.Application;\r
import javafx.collections.ObservableList;\r
import javafx.geometry.Insets;\r
import javafx.geometry.VPos;\r
-import javafx.embed.swing.JFXPanel;\r
import javafx.scene.Scene;\r
import javafx.scene.canvas.Canvas;\r
import javafx.scene.canvas.GraphicsContext;\r
primaryStage.setScene(scene);\r
primaryStage.show();\r
\r
+ pokrenut.countDown();\r
+\r
}\r
\r
protected static void osveziPanelZaAnimaciju(Label labela, Button dugme, double vrednost) {\r
// Pokretanje //\r
////////////////\r
\r
+ protected static CountDownLatch pokrenut = new CountDownLatch(1);\r
+\r
protected static void pokreni() {\r
- new JFXPanel();\r
Runnable launcher = () -> {\r
launch(new String[] {});\r
};\r
new Thread(launcher).start();\r
+ boolean bioPrekid = Thread.interrupted();\r
+ boolean ok = false;\r
+ do {\r
+ try {\r
+ pokrenut.await();\r
+ ok = true;\r
+ } catch (InterruptedException e) {\r
+ bioPrekid = true;\r
+ }\r
+ } while (!ok);\r
+ if (bioPrekid) {\r
+ Thread.currentThread().interrupt();\r
+ }\r
}\r
\r
protected static void odradiKasnije(Runnable zadatak) {\r