Exemplo n.º 1
0
 private boolean importFile(File[] files, Tile tile) {
   for (File f : files) {
     if (f.isDirectory()) {
       StorableResource library = new LibraryResource(f.getName());
       manager.addResourceChild(library);
       importFile(f.listFiles(), tile);
       manager.setCurrentNode(library.getParentResource());
     } else {
       if (!imageFilter.accept(f)) {
         continue;
       }
       Tile newTile = TileFactory.createDefaultTile(tile);
       newTile.setImage(ImageUtils.readImage(f));
       StorableResource resource = new DefaultResource(newTile);
       resource.setName(getNameFromFile(f));
       manager.createResourceID(resource);
       manager.addResourceChild(resource);
     }
   }
   return true;
 }
Exemplo n.º 2
0
 private void cellValueChanged(DefaultCellEditor e) {
   TreePath path = managerTree.getSelectionPath();
   StorableResource r = (StorableResource) path.getLastPathComponent();
   r.setName(e.getCellEditorValue().toString());
 }