2019-05-08 18:12:31 +02:00
package org.hso.texturesyncclient.view.mainView
2019-06-05 16:23:45 +02:00
import com.jfoenix.controls.JFXButton
2019-05-09 13:55:22 +02:00
import com.jfoenix.controls.JFXChipView
2019-05-08 18:12:31 +02:00
import javafx.geometry.Insets
import javafx.geometry.Orientation
2019-06-05 16:23:45 +02:00
import javafx.geometry.Pos
2019-05-09 13:55:22 +02:00
import javafx.scene.control.Label
2019-05-08 18:12:31 +02:00
import javafx.scene.image.Image
import javafx.scene.layout.Background
import javafx.scene.layout.BackgroundFill
import javafx.scene.layout.CornerRadii
import javafx.scene.paint.Paint
import tornadofx.*
class DetailView : View ( ) {
val preview = Preview3D ( )
2019-05-09 15:24:45 +02:00
val metaLabel = Label ( " Auflösung: 8MP \n Name: Texture.png \n Andere: was anderes " )
2019-05-09 13:55:22 +02:00
val cvTags = JFXChipView < String > ( )
2019-06-05 16:23:45 +02:00
val btnImport = JFXButton ( " + " )
2019-05-08 18:12:31 +02:00
init {
2019-05-09 12:03:49 +02:00
// set a default texture
2019-05-09 15:24:45 +02:00
preview . setTexture ( Image ( " textures/sample_texture_1.jpg " ) )
2019-05-08 18:12:31 +02:00
}
override val root = form {
minWidth = 250.0
background = Background ( BackgroundFill ( Paint . valueOf ( " #9f9f9f " ) , CornerRadii . EMPTY , Insets . EMPTY ) )
2019-06-04 20:49:07 +02:00
fieldset ( labelPosition = Orientation . VERTICAL ) {
2019-05-08 18:12:31 +02:00
2019-06-04 20:49:07 +02:00
field {
2019-05-08 18:12:31 +02:00
vbox ( 7 ) {
add ( preview )
}
}
2019-05-09 13:55:22 +02:00
field ( " Meta " ) {
add ( metaLabel )
2019-05-08 18:12:31 +02:00
}
2019-06-04 20:49:07 +02:00
field {
2019-06-05 16:23:45 +02:00
minHeight = 145.0
2019-05-09 13:55:22 +02:00
add ( cvTags )
2019-06-05 16:23:45 +02:00
}
field {
hbox ( alignment = Pos . CENTER _RIGHT ) {
add ( btnImport )
}
2019-05-08 18:12:31 +02:00
}
2019-05-09 13:55:22 +02:00
// TODO add "Import" Btn
}
style {
2019-06-05 16:23:45 +02:00
cvTags . minHeight = 135.0
cvTags . paddingAll = 3.0
2019-05-09 13:55:22 +02:00
cvTags . style = " -fx-background-color: #3c3f41; -fx-text-inner-color: #b15b2e; "
2019-06-05 16:23:45 +02:00
btnImport . buttonType = JFXButton . ButtonType . RAISED
// TODO move this to a css file
btnImport . style = " -fx-background-color: #F1F1F1; \n " +
" -fx-background-radius: 50px; \n " +
" -fx-pref-height: 50px; \n " +
" -fx-pref-width: 50px; \n " +
" -fx-min-width: -fx-pref-width; \n " +
" -fx-max-width: -fx-pref-width; \n " +
" -fx-min-height: -fx-pref-height; \n " +
" -fx-max-height: -fx-pref-height; \n " +
" -jfx-button-type: RAISED; "
}
btnImport . setOnAction {
2019-05-08 18:12:31 +02:00
}
}
}