show metadata in better format
This commit is contained in:
		@ -8,7 +8,8 @@ import tornadofx.App
 | 
			
		||||
class Main: App(StartupView::class){
 | 
			
		||||
 | 
			
		||||
    //start first controller
 | 
			
		||||
    private val svc = StartupViewController()
 | 
			
		||||
   private val svc = StartupViewController()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    override fun start(stage: Stage) {
 | 
			
		||||
        super.start(stage)
 | 
			
		||||
 | 
			
		||||
@ -26,6 +26,10 @@ import javax.imageio.ImageIO
 | 
			
		||||
import java.util.UUID
 | 
			
		||||
import java.nio.file.Files
 | 
			
		||||
import java.io.FileOutputStream
 | 
			
		||||
import java.text.SimpleDateFormat
 | 
			
		||||
import java.text.DateFormat
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class RootController : Controller() {
 | 
			
		||||
 | 
			
		||||
@ -190,7 +194,13 @@ class RootController : Controller() {
 | 
			
		||||
     */
 | 
			
		||||
    fun showDetail(data: Texture) {
 | 
			
		||||
        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())
 | 
			
		||||
        selectedTexture = data
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -39,7 +39,7 @@ class DetailView: View() {
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            field("Meta") {
 | 
			
		||||
            field {
 | 
			
		||||
                add(metaLabel)
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -36,8 +36,8 @@ class MainViewController : Controller() {
 | 
			
		||||
        preview.setTexture(img)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fun setMeta(name: String, res: String, etc: String) {
 | 
			
		||||
        metaLabel.text = "Name: $name\nAuflösung: $res\nAnderes: $etc"
 | 
			
		||||
    fun setMeta(name: String, res: String, format: String, date: String) {
 | 
			
		||||
        metaLabel.text = "Name: $name\nAuflösung: $res\nFormat: $format\nEinfügedatum: $date"
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fun setTags(chips: ObservableList<String>) {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user