private void refresh() { tilePane.getChildren().clear(); map = LibraryLoader.getMappedItems(); for (String s : map.keySet()) { LibraryEntry e = new LibraryEntry(map.get(s), new File(s)); tilePane.getChildren().add(e); } }
@FXML private void handleButtonAction(ActionEvent event) throws IOException { // DirectoryChooser dc = new DirectoryChooser(); // File f = dc.showDialog(null); LibraryLoader.generateMissingThumbs(); try { Thread.sleep(500); } catch (InterruptedException ex) { Logger.getLogger(MediaLibrary.class.getName()).log(Level.SEVERE, null, ex); } refresh(); }
@Override public void initialize(URL url, ResourceBundle rb) { // TODO // tilePane.setPrefColumns(4); tilePane.setHgap(5); tilePane.setVgap(15); tilePane.setPrefTileHeight(85); tilePane.setPrefTileWidth(150); tilePane.setPadding(new Insets(5, 5, 15, 5)); map = LibraryLoader.getMappedItems(); for (String s : map.keySet()) { LibraryEntry e = new LibraryEntry(map.get(s), new File(s)); libEntries.add(e); } tilePane.getChildren().addAll(libEntries); }
static { LibraryLoader.loadLibrary(null); }