Merge branch 'master' of git.mosad.xyz:localhorst/TextureSync

This commit is contained in:
Hendrik Schutter 2019-06-05 16:06:06 +02:00
commit 8d387250e7
4 changed files with 24 additions and 34 deletions

View File

@ -123,6 +123,10 @@ class RootController : Controller() {
}
}
/**
* save the texture file to a local directory
* @param data the texture as meta element
*/
fun exportTexture(data: Texture) {
val directoryChooser = DirectoryChooser()
directoryChooser.title = "Export Verzeichnis wählen"

View File

@ -10,11 +10,11 @@ import tornadofx.*
class FolderView : View("FolderView"){
override val root = flowpane {
hgap = 10.0
vgap = 10.0
paddingAll = 5.0
hgap = 15.0
vgap = 15.0
paddingAll = 12.0
prefWidth = 732.0
prefHeight = 1000.0
prefHeight = 401.0
background = Background(BackgroundFill(Paint.valueOf("#cfcfcf"), CornerRadii.EMPTY, Insets.EMPTY))
//background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY))

View File

@ -3,6 +3,7 @@ package org.hso.texturesyncclient.view.mainView
import com.jfoenix.controls.JFXChipView
import com.jfoenix.controls.JFXSpinner
import javafx.geometry.Insets
import javafx.scene.control.ScrollPane
import javafx.scene.layout.Background
import javafx.scene.layout.BackgroundFill
@ -26,17 +27,29 @@ class MainView : View() {
maxHeight = 500.0
left = vbox {
prefWidth = 750.0
background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY))
add(cvSearch)
scrollpane {
add(folderView.root)
anchorpane {
scrollpane {
this.fitToParentSize()
this.vbarPolicy = ScrollPane.ScrollBarPolicy.ALWAYS
add(folderView.root)
}
add(spinnerSearch)
}
}
right = detailView.root
style {
spinnerSearch.isVisible = false
spinnerSearch.anchorpaneConstraints {
topAnchor = 150
bottomAnchor = 150
leftAnchor = 150
rightAnchor = 150
}
cvSearch.paddingAll = 7.0
cvSearch.minHeight = 70.0

View File

@ -55,37 +55,11 @@ class MainViewController : Controller() {
println(cvTags.chips)
}
/**
* save the texture file to r
* @param data the file as a byte array
* @param name name for the file
* @param format specific file format. jpeg or png
*/
fun exportTexture(data: ByteArray, name: String, format : TextureFormat){
val directoryChooser = DirectoryChooser()
directoryChooser.title = "Export Verzeichnis wählen"
// TODO directoryChooser.setInitialDirectory(new File(System.getProperty("user.home")))
val dir = directoryChooser.showDialog(primaryStage)
if (dir != null) {
//copy data (bytesarray) with name and extension to dir
}
}
fun cvSearchAction(tags: ObservableList<String>) {
var previewList = arrayListOf<GUIModel>()
// show spinner, block ui
folderView.children.clear()
folderView.children.add(mv.spinnerSearch)
mv.spinnerSearch.isVisible = true
mv.cvSearch.isDisable = true
@ -93,7 +67,6 @@ class MainViewController : Controller() {
previewList = rootc.search(tags)
} ui {
// when search finished
folderView.children.clear()
addAllElements(previewList)
mv.spinnerSearch.isVisible = false
mv.cvSearch.isDisable = false