Skip to content

Commit

Permalink
Remove unused imports and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
BilledTrain380 committed Nov 9, 2018
1 parent 46023b5 commit 4c3aac6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .idea/modules/sporttag-psa_main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules/sporttag-psa_test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ buildscript {
ext {
kotlinVersion = '1.2.50'
springBootVersion = '2.0.2.RELEASE'
sporttagPSAVersion = '1.0.1'

sporttagPSAVersion = '2.0.0'

/*
* Returns the main class depending on the mode command line parameter.
*
* -Pmode=gui uses the JavaFX Application
* -Pmode=tui uses the Spring Application
*
* If the mode is not defined at all, 'tui' mode will be used.
*/
getMainClass = {

def mode = project.hasProperty('mode') ? project.property('mode') : 'tui'

if (mode == 'gui') {
return 'ch.schulealtendorf.sporttagpsa.GUIApplicationKt'
return 'ch.schulealtendorf.sporttagpsa.FXApplicationKt'
} else if (mode == 'tui') {
return 'ch.schulealtendorf.sporttagpsa.SporttagPsaApplicationKt'
}
Expand Down
2 changes: 1 addition & 1 deletion sporttag-psa.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="sporttag-psa" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="1.0.1" type="JAVA_MODULE" version="4">
<module external.linked.project.id="sporttag-psa" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="2.0.0" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,18 @@ package ch.schulealtendorf.sporttagpsa
import ch.schulealtendorf.sporttagpsa.controlpanel.FXMLControlPanelController
import javafx.application.Application
import javafx.fxml.FXMLLoader
import javafx.geometry.Insets
import javafx.scene.Parent
import javafx.scene.Scene
import javafx.scene.control.Button
import javafx.scene.control.Label
import javafx.scene.layout.GridPane
import javafx.stage.Stage
import java.net.InetAddress
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.context.ConfigurableApplicationContext





/**
* JavaFX Application to enable the control panel.
*
* @author nmaerchy <billedtrain380@gmail.com>
* @since 0.0.1
* @since 2.0.0
*/
class GUIApplication: Application() {
class FXApplication: Application() {

override fun start(primaryStage: Stage?) {

Expand All @@ -80,5 +72,5 @@ class GUIApplication: Application() {
}

fun main(args: Array<String>) {
Application.launch(GUIApplication::class.java, *args)
Application.launch(FXApplication::class.java, *args)
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,15 @@ package ch.schulealtendorf.sporttagpsa.controlpanel
import ch.schulealtendorf.sporttagpsa.SporttagPsaApplication
import javafx.application.HostServices
import javafx.application.Platform
import javafx.collections.ObservableList
import javafx.event.ActionEvent
import javafx.fxml.FXML
import javafx.fxml.Initializable
import javafx.scene.control.Button
import javafx.scene.control.Label
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.context.ConfigurableApplicationContext
import java.net.URI
import java.net.URL
import java.util.*

/**
* @author nmaerchy <billedtrain380@gmail.com>
* @since 0.0.1
*/
class FXMLControlPanelController: Initializable {

private var hostServices: Optional<HostServices> = Optional.empty()
Expand Down Expand Up @@ -130,10 +123,6 @@ class FXMLControlPanelController: Initializable {
System.exit(0)
}

private fun <T> Optional<T>.ifNotPresent(block: () -> Unit) {
if (isPresent.not()) block()
}

private fun starting() {

Platform.runLater {
Expand Down

0 comments on commit 4c3aac6

Please sign in to comment.