fix #28
This commit is contained in:
parent
cc03b32ade
commit
8dfbbae559
@ -20,9 +20,9 @@ class Main : App(StartupView::class) {
|
|||||||
super.start(stage)
|
super.start(stage)
|
||||||
|
|
||||||
stage.minWidth = 1008.00
|
stage.minWidth = 1008.00
|
||||||
stage.minHeight = 535.00
|
stage.minHeight = 700.00
|
||||||
stage.width = 1008.00
|
stage.width = 1008.00
|
||||||
stage.height = 535.00
|
stage.height = 700.00
|
||||||
stage.isResizable = true
|
stage.isResizable = true
|
||||||
stage.icons.add(Image("icons/TextureSync_Icon_256x256.png"))
|
stage.icons.add(Image("icons/TextureSync_Icon_256x256.png"))
|
||||||
stage.setOnCloseRequest { System.exit(0) }
|
stage.setOnCloseRequest { System.exit(0) }
|
||||||
|
@ -10,6 +10,7 @@ import javafx.scene.layout.BackgroundFill
|
|||||||
import javafx.scene.layout.CornerRadii
|
import javafx.scene.layout.CornerRadii
|
||||||
import javafx.scene.paint.Paint
|
import javafx.scene.paint.Paint
|
||||||
import javafx.scene.layout.Priority
|
import javafx.scene.layout.Priority
|
||||||
|
import org.hso.texturesyncclient.view.mainView.Preview3D
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
|
|
||||||
class ImportView : View("TextureSync") {
|
class ImportView : View("TextureSync") {
|
||||||
@ -18,12 +19,16 @@ class ImportView : View("TextureSync") {
|
|||||||
val tfName = JFXTextField()
|
val tfName = JFXTextField()
|
||||||
val cvTags = JFXChipView<String>()
|
val cvTags = JFXChipView<String>()
|
||||||
val btnImport = JFXButton("Importieren")
|
val btnImport = JFXButton("Importieren")
|
||||||
|
|
||||||
|
val preview = Preview3D()
|
||||||
|
|
||||||
private val btnBack = JFXButton("Zurück")
|
private val btnBack = JFXButton("Zurück")
|
||||||
|
|
||||||
private val ivc: ImportViewController by inject()
|
private val ivc: ImportViewController by inject()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
btnImport.isVisible = false
|
btnImport.isVisible = false
|
||||||
|
preview.root.isVisible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
override val root = borderpane {
|
override val root = borderpane {
|
||||||
@ -39,6 +44,8 @@ class ImportView : View("TextureSync") {
|
|||||||
style = "-fx-font: 20px Verdana; -fx-text-fill: #2b7bbb;"
|
style = "-fx-font: 20px Verdana; -fx-text-fill: #2b7bbb;"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add(preview)
|
||||||
|
|
||||||
vbox(20) {
|
vbox(20) {
|
||||||
hbox(10) {
|
hbox(10) {
|
||||||
add(tfFilePath)
|
add(tfFilePath)
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package org.hso.texturesyncclient.view.importView
|
package org.hso.texturesyncclient.view.importView
|
||||||
|
|
||||||
|
import javafx.scene.image.Image
|
||||||
|
import javafx.stage.FileChooser
|
||||||
import org.hso.texturesyncclient.controller.RootController
|
import org.hso.texturesyncclient.controller.RootController
|
||||||
import tornadofx.Controller
|
import tornadofx.Controller
|
||||||
import javafx.stage.FileChooser
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.io.FileInputStream
|
||||||
|
|
||||||
|
|
||||||
class ImportViewController : Controller() {
|
class ImportViewController : Controller() {
|
||||||
@ -29,6 +31,18 @@ class ImportViewController : Controller() {
|
|||||||
iv.tfFilePath.text = file.absolutePath
|
iv.tfFilePath.text = file.absolutePath
|
||||||
iv.tfName.text = file.nameWithoutExtension
|
iv.tfName.text = file.nameWithoutExtension
|
||||||
lastImportDir = file.parent.toString() //store last user chosen dir
|
lastImportDir = file.parent.toString() //store last user chosen dir
|
||||||
|
|
||||||
|
runAsync {
|
||||||
|
try {
|
||||||
|
val fileInput = FileInputStream(file.absolutePath)
|
||||||
|
val img = Image(fileInput)
|
||||||
|
iv.preview.setTexture(img)
|
||||||
|
iv.preview.root.isVisible = true
|
||||||
|
} catch (e: Exception) {
|
||||||
|
// Got a catch'em all
|
||||||
|
println(e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ class Preview3D : View("Preview3D") {
|
|||||||
pointLightFront.rotate = 90.0
|
pointLightFront.rotate = 90.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override val root = stackpane {
|
override val root = stackpane {
|
||||||
|
|
||||||
add(dBox).apply {
|
add(dBox).apply {
|
||||||
|
Loading…
Reference in New Issue
Block a user