Package se.llbit.chunky.renderer.scene

Examples of se.llbit.chunky.renderer.scene.SceneDescription


    List<File> fileList = getAvailableSceneFiles(context.getSceneDirectory());
    Collections.sort(fileList);
    for (File sceneFile : fileList) {
      String fileName = sceneFile.getName();
      try {
        SceneDescription desc = new SceneDescription();
        desc.loadDescription(context.getSceneFileInputStream(fileName));
        scenes.add(desc);
        int seconds = (int) ((desc.renderTime / 1000) % 60);
        int minutes = (int) ((desc.renderTime / 60000) % 60);
        int hours = (int) (desc.renderTime / 3600000);
        String renderTime = String.format("%d:%d:%d", hours, minutes, seconds);
View Full Code Here


   * Delete the selected scene
   * @param selected index of scene to be deleted
   */
  protected void deleteScene(int selected) {
    if (selected >= 0 && selected < scenes.size()) {
      SceneDescription scene = scenes.get(selected);
      Object[] options = {
          "Cancel",
          "Delete Scene \"" + scene.name + "\""
      };
      int n = JOptionPane.showOptionDialog(null,
          "<html>Are you sure you wish to delete the scene \"" + scene.name + "\"?<br>"
              + "All files for the scene, except snapshot images, will be irreversibly deleted!",
          "Delete Scene?",
          JOptionPane.YES_NO_OPTION,
          JOptionPane.WARNING_MESSAGE,
          null,
          options,
          options[0]);
      if (n == 1) {
        scene.delete();
        // remove scene from table
        tableModel.removeRow(selected);
        scenes.remove(selected);
        loadSelectedBtn.setEnabled(false);
        deleteSelectedBtn.setEnabled(false);
View Full Code Here

   * Export the selected scene to a Zip archive
   * @param selected index of scene to be deleted
   */
  protected void exportScene(int selected) {
    if (selected >= 0 && selected < scenes.size()) {
      SceneDescription scene = scenes.get(selected);
      CenteredFileDialog fileDialog =
          new CenteredFileDialog(null, "Export to ZIP", FileDialog.SAVE);
      fileDialog.setDirectory(System.getProperty("user.dir"));
      fileDialog.setFile(scene.name+".zip");
      fileDialog.setFilenameFilter(
        new FilenameFilter() {
          @Override
          public boolean accept(File dir, String name) {
            return name.toLowerCase().endsWith(".zip");
          }
        }
      );
      fileDialog.setVisible(true);
      File selectedFile = fileDialog.getSelectedFile(".zip");
      if (selectedFile != null) {
        scene.exportToZip(selectedFile);
      }
    }
  }
View Full Code Here

TOP

Related Classes of se.llbit.chunky.renderer.scene.SceneDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.