2019-04-30 16:49:02 +02:00
package org.hso.texturesyncclient.controller
2019-06-03 17:33:23 +02:00
import javafx.collections.ObservableList
2019-06-03 16:46:57 +02:00
import org.hso.texturesyncclient.controller.net.Connection
2019-06-03 15:29:01 +02:00
import org.hso.texturesyncclient.model.GUIModel
2019-06-03 16:46:57 +02:00
import org.hso.texturesyncclient.model.Texture
import org.hso.texturesyncclient.view.importView.ImportViewController
2019-06-03 15:29:01 +02:00
import org.hso.texturesyncclient.view.mainView.MainViewController
2019-06-03 16:46:57 +02:00
import org.hso.texturesyncclient.view.startupView.StartupViewController
2019-06-03 15:29:01 +02:00
import tornadofx.Controller
2019-06-03 16:46:57 +02:00
import java.net.InetAddress
2019-06-03 20:42:28 +02:00
import java.util.*
import java.util.Calendar
2019-04-30 16:49:02 +02:00
2019-06-03 17:33:23 +02:00
class RootController : Controller ( ) {
2019-04-30 16:49:02 +02:00
2019-06-03 15:29:01 +02:00
private val mvc : MainViewController by inject ( )
2019-06-03 16:46:57 +02:00
private val svc : StartupViewController by inject ( )
private val ivc : ImportViewController by inject ( )
2019-06-03 15:29:01 +02:00
2019-06-03 16:46:57 +02:00
private val con = Connection ( InetAddress . getByName ( " 127.0.0.1 " ) )
2019-06-03 17:33:23 +02:00
2019-06-03 15:29:01 +02:00
init {
2019-06-03 16:46:57 +02:00
/ * var data = Texture ( )
var img = con . getTexturePreview ( data . textureHash )
var test = GUIModel ( data , img )
2019-06-03 18:08:48 +02:00
test . exportItem . setOnAction {
}
2019-06-03 16:46:57 +02:00
mvc . addElement ( test )
data = Texture ( )
img = con . getTexturePreview ( data . textureHash )
test = GUIModel ( data , img )
2019-06-03 18:08:48 +02:00
test . exportItem . setOnAction {
}
2019-06-03 16:46:57 +02:00
mvc . addElement ( test ) * /
2019-06-03 15:29:01 +02:00
}
2019-06-03 17:33:23 +02:00
/ * *
* calculate the resolution , get today ' s date -> upload to server
* @param path the absolute path of the file on the client ' s system
* @param name the file name
* @param tags all tags for the file
* /
fun importTexture ( path : String , name : String , tags : ObservableList < String > ) {
2019-06-03 20:42:28 +02:00
val cal = Calendar . getInstance ( ) //calendar obj with current time
println ( cal . time )
2019-06-03 17:33:23 +02:00
}
2019-04-30 16:49:02 +02:00
}