|
@ -2,10 +2,10 @@ package com.sothr.imagetools.ui.controller |
|
|
|
|
|
|
|
|
import javafx.fxml.FXML |
|
|
import javafx.fxml.FXML |
|
|
import javafx.event.ActionEvent |
|
|
import javafx.event.ActionEvent |
|
|
import javafx.stage.{StageStyle, Stage} |
|
|
|
|
|
|
|
|
import javafx.stage.{DirectoryChooser, StageStyle, Stage} |
|
|
import javafx.scene.{Scene,Group} |
|
|
import javafx.scene.{Scene,Group} |
|
|
import javafx.scene.text.{TextAlignment, Text} |
|
|
import javafx.scene.text.{TextAlignment, Text} |
|
|
import java.io.IOException |
|
|
|
|
|
|
|
|
import java.io.{File, IOException} |
|
|
import java.util.Scanner |
|
|
import java.util.Scanner |
|
|
import com.sothr.imagetools.image.Image |
|
|
import com.sothr.imagetools.image.Image |
|
|
import com.sothr.imagetools.ui.component.ImageTileFactory |
|
|
import com.sothr.imagetools.ui.component.ImageTileFactory |
|
@ -20,13 +20,15 @@ import javafx.collections.{FXCollections} |
|
|
*/ |
|
|
*/ |
|
|
class AppController extends Logging { |
|
|
class AppController extends Logging { |
|
|
|
|
|
|
|
|
//val logger:Logger = LoggerFactory.getLogger(this.getClass) |
|
|
|
|
|
|
|
|
|
|
|
//Define controls |
|
|
//Define controls |
|
|
|
|
|
@FXML var rootPane : javafx.scene.layout.AnchorPane = null |
|
|
@FXML var rootMenuBar : javafx.scene.control.MenuBar = null |
|
|
@FXML var rootMenuBar : javafx.scene.control.MenuBar = null |
|
|
@FXML var imageTilePane : javafx.scene.layout.TilePane = null |
|
|
@FXML var imageTilePane : javafx.scene.layout.TilePane = null |
|
|
@FXML var tagListView : javafx.scene.control.ListView[String] = null |
|
|
@FXML var tagListView : javafx.scene.control.ListView[String] = null |
|
|
|
|
|
|
|
|
|
|
|
// Labels |
|
|
|
|
|
@FXML var selectedDirectoryLabel: javafx.scene.control.Label = null |
|
|
|
|
|
|
|
|
@FXML def initialize() = { |
|
|
@FXML def initialize() = { |
|
|
//test |
|
|
//test |
|
|
val testImage = new Image() |
|
|
val testImage = new Image() |
|
@ -79,6 +81,18 @@ class AppController extends Logging { |
|
|
stage.close() |
|
|
stage.close() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
|
|
def browseFolders(event:ActionEvent) = { |
|
|
|
|
|
val chooser = new DirectoryChooser() |
|
|
|
|
|
chooser.setTitle("ImageTools Browser") |
|
|
|
|
|
val defaultDirectory = new File(".") |
|
|
|
|
|
chooser.setInitialDirectory(defaultDirectory) |
|
|
|
|
|
val window = this.rootPane.getScene.getWindow |
|
|
|
|
|
val selectedDirectory = chooser.showDialog(window) |
|
|
|
|
|
info(s"Selected Directory: ${selectedDirectory.getAbsolutePath}") |
|
|
|
|
|
selectedDirectoryLabel.setText(selectedDirectory.getAbsolutePath) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//endregion |
|
|
//endregion |
|
|
|
|
|
|
|
|
//todo: include a templating engine for rendering information |
|
|
//todo: include a templating engine for rendering information |
|
|