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

Commit

Permalink
Changed project group name
Browse files Browse the repository at this point in the history
`com.github.agcom` to `io.github.agcom`.

This also affected the base package name.
  • Loading branch information
agcom committed Mar 29, 2021
1 parent 70d4aaa commit 1420943
Show file tree
Hide file tree
Showing 26 changed files with 82 additions and 74 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'org.openjfx.javafxplugin' version "$javafx_plugin_version"
}

group = 'com.github.agcom'
group = 'io.github.agcom'
version = '1.0.0'

application {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.nodes;
package io.github.agcom.quadtree.nodes;

import javafx.scene.control.TextField;
import javafx.scene.control.TextFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.nodes;
package io.github.agcom.quadtree.nodes;

import javafx.beans.NamedArg;
import javafx.beans.property.SimpleStringProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.nodes;
package io.github.agcom.quadtree.nodes;

import javafx.beans.NamedArg;
import javafx.beans.binding.Bindings;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.github.agcom.quadtree
package io.github.agcom.quadtree

import io.reactivex.plugins.RxJavaPlugins
import javafx.application.Application
import javafx.scene.Scene
import javafx.scene.image.Image
import javafx.stage.Stage
import com.github.agcom.quadtree.utils.loadFXML
import com.github.agcom.quadtree.utils.toStream
import io.github.agcom.quadtree.utils.loadFXML
import io.github.agcom.quadtree.utils.toStream

@JvmName("Launcher")
fun main(args: Array<String>) = Application.launch(*args) //for compatibility
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.controllers
package io.github.agcom.quadtree.controllers

import com.jfoenix.controls.JFXCheckBox
import com.jfoenix.controls.JFXRadioButton
Expand All @@ -13,14 +13,14 @@ import javafx.fxml.Initializable
import javafx.scene.control.TextArea
import javafx.scene.control.ToggleGroup
import javafx.scene.layout.VBox
import com.github.agcom.quadtree.nodes.IntField
import com.github.agcom.quadtree.nodes.NodeSwitcher
import com.github.agcom.quadtree.nodes.getAreaShape
import com.github.agcom.quadtree.quadtree.QuadTree
import com.github.agcom.quadtree.quadtree.SimpleQueryStatistics
import com.github.agcom.quadtree.quadtree.geometry.Circle
import com.github.agcom.quadtree.quadtree.geometry.Point
import com.github.agcom.quadtree.quadtree.geometry.Rectangle
import io.github.agcom.quadtree.nodes.IntField
import io.github.agcom.quadtree.nodes.NodeSwitcher
import io.github.agcom.quadtree.nodes.getAreaShape
import io.github.agcom.quadtree.quadtree.QuadTree
import io.github.agcom.quadtree.quadtree.SimpleQueryStatistics
import io.github.agcom.quadtree.quadtree.geometry.Circle
import io.github.agcom.quadtree.quadtree.geometry.Point
import io.github.agcom.quadtree.quadtree.geometry.Rectangle
import java.net.URL
import java.util.*
import java.util.concurrent.Callable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package com.github.agcom.quadtree.controllers

package io.github.agcom.quadtree.controllers

import io.github.agcom.quadtree.nodes.AreaShape
import io.github.agcom.quadtree.nodes.clear
import io.github.agcom.quadtree.nodes.draw
import io.github.agcom.quadtree.quadtree.QuadTree
import io.github.agcom.quadtree.quadtree.QueryStatistics
import io.github.agcom.quadtree.quadtree.geometry.Point
import io.github.agcom.quadtree.quadtree.geometry.Rectangle
import io.github.agcom.quadtree.utils.executor
import io.github.agcom.quadtree.utils.quadTreeModif
import io.reactivex.Completable
import io.reactivex.disposables.Disposable
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler
Expand All @@ -13,21 +22,13 @@ import javafx.scene.input.MouseEvent
import javafx.scene.layout.BorderPane
import javafx.scene.layout.StackPane
import javafx.scene.paint.Color
import com.github.agcom.quadtree.nodes.*
import com.github.agcom.quadtree.quadtree.QuadTree
import com.github.agcom.quadtree.quadtree.QueryStatistics
import com.github.agcom.quadtree.quadtree.geometry.Point
import com.github.agcom.quadtree.quadtree.geometry.Rectangle
import com.github.agcom.quadtree.utils.executor
import com.github.agcom.quadtree.utils.quadTreeModif
import java.net.URL
import java.util.*
import java.util.concurrent.TimeUnit
import kotlin.ConcurrentModificationException
import kotlin.time.ExperimentalTime

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

val quadTree = SimpleObjectProperty<QuadTree>()
val query = SimpleObjectProperty<AreaShape>()
Expand All @@ -39,10 +40,14 @@ class QuadTreeController: Initializable {
private val width = SimpleIntegerProperty()
private val height = SimpleIntegerProperty()

@FXML private lateinit var queryCanvas: Canvas
@FXML private lateinit var quadTreeCanvas: Canvas
@FXML private lateinit var queryArea: BorderPane
@FXML private lateinit var sizePane: StackPane
@FXML
private lateinit var queryCanvas: Canvas
@FXML
private lateinit var quadTreeCanvas: Canvas
@FXML
private lateinit var queryArea: BorderPane
@FXML
private lateinit var sizePane: StackPane

constructor(quadTree: QuadTree) {

Expand Down Expand Up @@ -130,7 +135,7 @@ class QuadTreeController: Initializable {
var queryStatistics = SimpleObjectProperty<QueryStatistics>(null)
private fun query() {

if(queryDisposable != null) {
if (queryDisposable != null) {

queryDisposable?.dispose()
queryDisposable = null
Expand All @@ -139,13 +144,13 @@ class QuadTreeController: Initializable {

}

if(query.value == null) return
if (query.value == null) return

queryDisposable = quadTree.value.query(query.value!!.area, queryStatistics.value)
.delaySubscription(queryDelay.value ?: 10, TimeUnit.MILLISECONDS)
.subscribe({ it.draw(queryCanvas, paint = Color.RED) }, {

if(it is ConcurrentModificationException) {
if (it is ConcurrentModificationException) {

println("Expected exception")
query()
Expand All @@ -169,7 +174,7 @@ class QuadTreeController: Initializable {
private var drawDisposable: Disposable? = null
fun quadTreeModified() {

if(drawDisposable != null) {
if (drawDisposable != null) {

drawDisposable?.dispose()
drawDisposable = null
Expand All @@ -187,9 +192,10 @@ class QuadTreeController: Initializable {

}

@FXML private fun onMouseClicked(event: MouseEvent) {
@FXML
private fun onMouseClicked(event: MouseEvent) {

if(erase.value) {
if (erase.value) {

erase()

Expand All @@ -203,18 +209,20 @@ class QuadTreeController: Initializable {

}

@FXML private fun onMouseMoved(event: MouseEvent) {
@FXML
private fun onMouseMoved(event: MouseEvent) {

mouseX.value = event.x
mouseY.value = event.y

}

@FXML private fun onMouseDragged(event: MouseEvent) {
@FXML
private fun onMouseDragged(event: MouseEvent) {

onMouseMoved(event)

if(erase.value) erase()
if (erase.value) erase()
else onMouseClicked(event)

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.agcom.quadtree.nodes
package io.github.agcom.quadtree.nodes

import javafx.scene.Node
import com.github.agcom.quadtree.quadtree.geometry.Area
import io.github.agcom.quadtree.quadtree.geometry.Area

abstract class AreaShape(val area: Area, val node: Node) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.github.agcom.quadtree.nodes
package io.github.agcom.quadtree.nodes

import javafx.scene.canvas.Canvas
import javafx.scene.paint.Color
import javafx.scene.paint.Paint
import com.github.agcom.quadtree.quadtree.QuadTree
import com.github.agcom.quadtree.quadtree.geometry.Circle
import com.github.agcom.quadtree.quadtree.geometry.Point
import com.github.agcom.quadtree.quadtree.geometry.Rectangle
import io.github.agcom.quadtree.quadtree.QuadTree
import io.github.agcom.quadtree.quadtree.geometry.Circle
import io.github.agcom.quadtree.quadtree.geometry.Point
import io.github.agcom.quadtree.quadtree.geometry.Rectangle
import kotlin.time.ExperimentalTime

fun Point.draw(canvas: Canvas, radius: Double = 4.0, paint: Paint = Color.BLACK) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.nodes
package io.github.agcom.quadtree.nodes

import com.jfoenix.controls.JFXTextField
import javafx.scene.control.TextFormatter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.github.agcom.quadtree.quadtree
package io.github.agcom.quadtree.quadtree

import io.reactivex.*
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler
import io.reactivex.schedulers.Schedulers
import com.github.agcom.quadtree.quadtree.geometry.Area
import com.github.agcom.quadtree.quadtree.geometry.Point
import com.github.agcom.quadtree.quadtree.geometry.Rectangle
import com.github.agcom.quadtree.utils.lazyPlus
import io.github.agcom.quadtree.quadtree.geometry.Area
import io.github.agcom.quadtree.quadtree.geometry.Point
import io.github.agcom.quadtree.quadtree.geometry.Rectangle
import io.github.agcom.quadtree.utils.lazyPlus
import java.lang.RuntimeException
import kotlin.time.ExperimentalTime
import kotlin.time.measureTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.quadtree
package io.github.agcom.quadtree.quadtree

import kotlin.time.Duration
import kotlin.time.ExperimentalTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.quadtree
package io.github.agcom.quadtree.quadtree

import kotlin.time.Duration
import kotlin.time.ExperimentalTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.quadtree.geometry
package io.github.agcom.quadtree.quadtree.geometry

interface Area {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.agcom.quadtree.quadtree.geometry
package io.github.agcom.quadtree.quadtree.geometry

import com.github.agcom.quadtree.utils.pow
import io.github.agcom.quadtree.utils.pow
import kotlin.math.abs
import kotlin.math.sqrt

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.github.agcom.quadtree.quadtree.geometry

data class Point(val x: Int, val y: Int)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.quadtree.geometry
package io.github.agcom.quadtree.quadtree.geometry

data class Rectangle(var x: Int, var y: Int, val width: Int, val height: Int) : Area {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.agcom.quadtree.utils
package io.github.agcom.quadtree.utils

import java.util.concurrent.Executors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.agcom.quadtree.utils
package io.github.agcom.quadtree.utils

import com.github.agcom.quadtree.Launcher
import io.github.agcom.quadtree.Launcher
import javafx.fxml.FXMLLoader
import java.io.InputStream
import java.net.URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
<?import javafx.scene.layout.*?>

<?import com.jfoenix.controls.JFXTextField?>
<?import com.github.agcom.quadtree.nodes.IntField?>
<?import io.github.agcom.quadtree.nodes.IntField?>
<?import java.net.URL?>
<?import com.jfoenix.controls.JFXTextArea?>
<?import com.jfoenix.controls.JFXRadioButton?>
<?import com.github.agcom.quadtree.nodes.NodeSwitcher?>
<?import io.github.agcom.quadtree.nodes.NodeSwitcher?>
<?import com.jfoenix.controls.JFXCheckBox?>
<?import com.github.agcom.quadtree.nodes.LabeledSeparator?>
<?import com.github.agcom.quadtree.nodes.FakeFocus?>
<?import io.github.agcom.quadtree.nodes.LabeledSeparator?>
<?import io.github.agcom.quadtree.nodes.FakeFocus?>
<SplitPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="com.github.agcom.quadtree.controllers.HomeController"
fx:controller="io.github.agcom.quadtree.controllers.HomeController"
prefHeight="800" prefWidth="1200"
dividerPositions="0.3">

<stylesheets>

<URL value="@/com/github/agcom/quadtree/styles/global.css"/>
<URL value="@/com/github/agcom/quadtree/styles/home.css"/>
<URL value="@/io/github/agcom/quadtree/styles/global.css"/>
<URL value="@/io/github/agcom/quadtree/styles/home.css"/>

</stylesheets>

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

<center>

Expand Down

0 comments on commit 1420943

Please sign in to comment.