Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
'QuadTree' to 'Quadtree'
Browse files Browse the repository at this point in the history
Closes #25
  • Loading branch information
agcom committed Mar 29, 2021
1 parent 1420943 commit e515f85
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Binary file modified pictures/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/kotlin/io/github/agcom/quadtree/Launcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Launcher : Application() {
primaryStage.apply {

scene = Scene(loadFXML("layouts/home.fxml"))
title = "QuadTree"
title = "Quadtree"
icons.add(Image("images/launcher.png".toStream()))
show()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import kotlin.time.ExperimentalTime
@ExperimentalTime
class HomeController : Initializable {

@FXML private lateinit var quadTreeController: QuadTreeController
@FXML private lateinit var quadtreeController: QuadtreeController
@FXML private lateinit var controlPane: VBox
@FXML private lateinit var logs: TextArea
@FXML private lateinit var queryShapeGroup: ToggleGroup
Expand Down Expand Up @@ -62,7 +62,7 @@ class HomeController : Initializable {

override fun initialize(location: URL?, resources: ResourceBundle?) {

quadTreeController.also {
quadtreeController.also {

it.queryStatistics.value = queryStatistics
it.erase.bindBidirectional(eraser.selectedProperty())
Expand Down Expand Up @@ -132,7 +132,7 @@ class HomeController : Initializable {

val count = randomize.text?.toIntOrNull() ?: 100

val qTree = quadTreeController.quadTree.value
val qTree = quadtreeController.quadTree.value

qTree.clear()

Expand All @@ -146,7 +146,7 @@ class HomeController : Initializable {

}

Platform.runLater { quadTreeController.quadTreeModified() }
Platform.runLater { quadtreeController.quadTreeModified() }

}

Expand All @@ -162,7 +162,7 @@ class HomeController : Initializable {

rebuildDisposable = Single.fromCallable {

val old = quadTreeController.quadTree.value
val old = quadtreeController.quadTree.value

val new = QuadTree(Rectangle(width.text?.toIntOrNull() ?: 600, height.text?.toIntOrNull() ?: 600), capacity.text?.toIntOrNull() ?: 4)

Expand All @@ -175,7 +175,7 @@ class HomeController : Initializable {
.subscribeOn(Schedulers.computation())
.subscribe({

quadTreeController.quadTree.value = it
quadtreeController.quadTree.value = it

}, Throwable::printStackTrace)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit
import kotlin.time.ExperimentalTime

@ExperimentalTime
class QuadTreeController : Initializable {
class QuadtreeController : Initializable {

val quadTree = SimpleObjectProperty<QuadTree>()
val query = SimpleObjectProperty<AreaShape>()
Expand All @@ -43,7 +43,7 @@ class QuadTreeController : Initializable {
@FXML
private lateinit var queryCanvas: Canvas
@FXML
private lateinit var quadTreeCanvas: Canvas
private lateinit var quadtreeCanvas: Canvas
@FXML
private lateinit var queryArea: BorderPane
@FXML
Expand Down Expand Up @@ -81,7 +81,7 @@ class QuadTreeController : Initializable {

}

quadTreeCanvas.also {
quadtreeCanvas.also {

it.widthProperty().bind(width)
it.heightProperty().bind(height)
Expand Down Expand Up @@ -118,7 +118,7 @@ class QuadTreeController : Initializable {

}

quadTree.value.draw(quadTreeCanvas)
quadTree.value.draw(quadtreeCanvas)

}

Expand Down Expand Up @@ -183,8 +183,8 @@ class QuadTreeController : Initializable {

drawDisposable = Completable.fromAction {

quadTreeCanvas.clear()
quadTree.value?.draw(quadTreeCanvas)
quadtreeCanvas.clear()
quadTree.value?.draw(quadtreeCanvas)
query()

}.subscribeOn(JavaFxScheduler.platform())
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/io/github/agcom/quadtree/layouts/home.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<VBox minWidth="300" fx:id="controlPane" spacing="32" SplitPane.resizableWithParent="true">

<LabeledSeparator text="Quad Tree Specs"/>
<LabeledSeparator text="Quadtree Specs"/>

<VBox spacing="24">

Expand Down Expand Up @@ -109,6 +109,6 @@

</VBox>

<fx:include source="quadtree.fxml" fx:id="quadTree" SplitPane.resizableWithParent="true"/>
<fx:include source="quadtree.fxml" fx:id="quadtree" SplitPane.resizableWithParent="true"/>

</SplitPane>
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<?import javafx.scene.shape.Shape?>
<BorderPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="io.github.agcom.quadtree.controllers.QuadTreeController"
fx:controller="io.github.agcom.quadtree.controllers.QuadtreeController"
stylesheets="@/io/github/agcom/quadtree/styles/quadtree.css">

<center>

<StackPane fx:id="sizePane" minHeight="600" maxHeight="600" minWidth="600" maxWidth="600" prefWidth="600" prefHeight="600">

<Canvas fx:id="quadTreeCanvas" height="600" width="600" onMouseClicked="#onMouseClicked"
<Canvas fx:id="quadtreeCanvas" height="600" width="600" onMouseClicked="#onMouseClicked"
onMouseMoved="#onMouseMoved" onMouseDragged="#onMouseDragged"/>

<Canvas fx:id="queryCanvas" height="600" width="600" mouseTransparent="true"/>
Expand Down

0 comments on commit e515f85

Please sign in to comment.