You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
702 B

10 years ago
  1. package com.sothr.imagetools.ui.component
  2. import javafx.geometry.Insets
  3. import javafx.scene.layout.TilePane
  4. import com.sothr.imagetools.engine.util.PropertiesService
  5. import grizzled.slf4j.Logging
  6. /**
  7. * Created by drew on 8/6/14.
  8. *
  9. * Creates pre-generated image tiles that can be rendered to a scene
  10. */
  11. object ImageTileFactory extends Logging {
  12. def get(image: com.sothr.imagetools.engine.image.Image, pane: TilePane): ImageTile = {
  13. val thumbnailWidth = PropertiesService.get("app.thumbnail.size","128").toInt
  14. val imageTile = new ImageTile(thumbnailWidth, image, pane.asInstanceOf[ImageTilePane])
  15. //set padding
  16. imageTile.setPadding(new Insets(2, 2, 2, 2))
  17. imageTile
  18. }
  19. }