show metadata in better format
This commit is contained in:
parent
ed558106e5
commit
4c2e1c2917
@ -8,7 +8,8 @@ import tornadofx.App
|
|||||||
class Main: App(StartupView::class){
|
class Main: App(StartupView::class){
|
||||||
|
|
||||||
//start first controller
|
//start first controller
|
||||||
private val svc = StartupViewController()
|
private val svc = StartupViewController()
|
||||||
|
|
||||||
|
|
||||||
override fun start(stage: Stage) {
|
override fun start(stage: Stage) {
|
||||||
super.start(stage)
|
super.start(stage)
|
||||||
|
@ -26,6 +26,10 @@ import javax.imageio.ImageIO
|
|||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.text.DateFormat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RootController : Controller() {
|
class RootController : Controller() {
|
||||||
|
|
||||||
@ -190,7 +194,13 @@ class RootController : Controller() {
|
|||||||
*/
|
*/
|
||||||
fun showDetail(data: Texture) {
|
fun showDetail(data: Texture) {
|
||||||
mvc.setPreview3DTexture(con.getTexturePreview(data.textureHash))
|
mvc.setPreview3DTexture(con.getTexturePreview(data.textureHash))
|
||||||
mvc.setMeta(data.name, data.resolution.toString(), "")
|
|
||||||
|
val sdf = SimpleDateFormat("dd.MM.yyyy")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mvc.setMeta(data.name, "${data.resolution.first.toString()}px x ${data.resolution.second.toString()}px", data.format.toString(), sdf.format(data.addedOn.time))
|
||||||
mvc.setTags(data.tags.toList().observable())
|
mvc.setTags(data.tags.toList().observable())
|
||||||
selectedTexture = data
|
selectedTexture = data
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ class DetailView: View() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
field("Meta") {
|
field {
|
||||||
add(metaLabel)
|
add(metaLabel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@ class MainViewController : Controller() {
|
|||||||
preview.setTexture(img)
|
preview.setTexture(img)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setMeta(name: String, res: String, etc: String) {
|
fun setMeta(name: String, res: String, format: String, date: String) {
|
||||||
metaLabel.text = "Name: $name\nAuflösung: $res\nAnderes: $etc"
|
metaLabel.text = "Name: $name\nAuflösung: $res\nFormat: $format\nEinfügedatum: $date"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTags(chips: ObservableList<String>) {
|
fun setTags(chips: ObservableList<String>) {
|
||||||
|
Loading…
Reference in New Issue
Block a user