From cf4e5b3e92d1b2f52c85dc47c7c006e2ed4b175f Mon Sep 17 00:00:00 2001 From: Seil0 Date: Mon, 3 Jun 2019 18:08:48 +0200 Subject: [PATCH] check if a chip has max 32 chars * finished ImportView --- .../hso/texturesyncclient/controller/Controller.kt | 6 ++++++ .../org/hso/texturesyncclient/model/GUIModel.kt | 14 +------------- .../view/importView/ImportView.kt | 2 +- .../view/importView/ImportViewController.kt | 2 +- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/controller/Controller.kt b/client/src/main/kotlin/org/hso/texturesyncclient/controller/Controller.kt index 8c5fd2a..69324de 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/controller/Controller.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/controller/Controller.kt @@ -22,11 +22,17 @@ class RootController : Controller() { /*var data = Texture() var img = con.getTexturePreview(data.textureHash) var test = GUIModel(data, img) + test.exportItem.setOnAction { + + } mvc.addElement(test) data = Texture() img = con.getTexturePreview(data.textureHash) test = GUIModel(data, img) + test.exportItem.setOnAction { + + } mvc.addElement(test)*/ } diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/model/GUIModel.kt b/client/src/main/kotlin/org/hso/texturesyncclient/model/GUIModel.kt index 8b8eff4..5f568bf 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/model/GUIModel.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/model/GUIModel.kt @@ -19,7 +19,7 @@ class GUIModel constructor(data: Texture, img: Image) : VBox(){ private var image = ImageView() private var label = Label() private var contextMenu = ContextMenu() - private var exportItem = MenuItem("exportiern") + var exportItem = MenuItem("exportiern") init { super.getChildren().addAll(image, label) @@ -36,18 +36,6 @@ class GUIModel constructor(data: Texture, img: Image) : VBox(){ image.image = img contextMenu.items.add(exportItem) - exportItem.setOnAction { - println("I bims 1 export: ${label.text}") - println(data.name) - } - } - - fun setText(text: String) { - label.text = text - } - - fun setImage(img: Image) { - image.image = img } } \ No newline at end of file diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt b/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt index bcf8e91..10ab930 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt @@ -84,7 +84,7 @@ class ImportView : View() { tfName.promptText = "Name eingeben" cvTags.style = "-fx-background-color: #3c3f41; -fx-text-inner-color: #b15b2e;" - //TODO change color of Chip´s + //TODO change color of Chip´s see: https://github.com/jfoenixadmin/JFoenix/blob/master/jfoenix/src/main/resources/com/jfoenix/assets/css/controls/jfx-chip-view.css#L52 btnImport.style = "-fx-button-type: RAISED; -fx-background-color: #3c3f41; -fx-text-fill: #2b7bbb;" } diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportViewController.kt b/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportViewController.kt index a1b77e7..41e6ad7 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportViewController.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportViewController.kt @@ -29,6 +29,6 @@ class ImportViewController : Controller() { } fun validateImport() { - iv.btnImport.isVisible = iv.tfFilePath.text.isNotEmpty() && iv.tfName.text.isNotEmpty() && iv.cvTags.chips.isNotEmpty() + iv.btnImport.isVisible = iv.tfFilePath.text.isNotEmpty() && iv.tfName.text.isNotEmpty() && iv.cvTags.chips.isNotEmpty() && iv.cvTags.chips.stream().allMatch { x -> x.length < 32 } } } \ No newline at end of file