Package com.eteks.sweethome3d.tools

Examples of com.eteks.sweethome3d.tools.TemporaryURLContent


                } else {
                  modelName = entryFileName;
                }
                URL entryUrl = new URL("jar:" + urlContent.getURL() + "!/"
                    + URLEncoder.encode(entryName, "UTF-8").replace("+", "%20").replace("%2F", "/"));
                modelContent = new TemporaryURLContent(entryUrl);
                model = ModelManager.getInstance().loadModel(modelContent);
                if (!entryFileName.toLowerCase().endsWith(".obj")
                    && (this.preferences.isModelContentAlwaysConvertedToOBJFormat()
                        || slashIndex > 0)) {
                  // Convert models in subdirectories at format different from OBJ
View Full Code Here


      objFile = "model.obj";
    }

    File tempZipFile = File.createTempFile("urlContent", "tmp");
    OBJWriter.writeNodeInZIPFile(model, tempZipFile, 0, objFile, "3D model " + objFile);
    return new TemporaryURLContent(new URL("jar:" + tempZipFile.toURI().toURL() + "!/"
        + URLEncoder.encode(objFile, "UTF-8").replace("+", "%20")));
  }
View Full Code Here

      if (modifiableUrl
          && (urlUpdate == null
              || urlUpdate.openConnection().getLastModified() < urlModificationDate)) {
        // Copy updated resource URL content to a temporary file to ensure textures used in home can safely
        // reference any file of the catalog file even if its content is changed afterwards
        TemporaryURLContent contentCopy = TemporaryURLContent.copyToTemporaryURLContent(new URLContent(pluginTexturesCatalogUrl));
        URL temporaryTexturesCatalogUrl = contentCopy.getURL();
        pluginTexturesCatalogUrlUpdates.put(pluginTexturesCatalogFile, temporaryTexturesCatalogUrl);
        pluginTexturesCatalogUrl = temporaryTexturesCatalogUrl;
      } else if (urlUpdate != null) {
        pluginTexturesCatalogUrl = urlUpdate;
      }
View Full Code Here

                    int slashIndex = entryName.lastIndexOf('/');
                    String entryFileName = entryName.substring(++slashIndex);
                    if (!entryFileName.startsWith(".")) {
                      URL entryUrl = new URL("jar:" + urlContent.getURL() + "!/"
                          + URLEncoder.encode(entryName, "UTF-8").replace("+", "%20").replace("%2F", "/"));
                      modelContent = new TemporaryURLContent(entryUrl);
                      model = readModel(modelContent);
                      modelSize = ModelManager.getInstance().getSize(model);
                      break;
                    }
                  }
View Full Code Here

      if (!objFile.toLowerCase().endsWith(".obj")) {
        objFile += ".obj";
      }
      File tempZipFile = OperatingSystem.createTemporaryFile("import", ".zip");
      OBJWriter.writeNodeInZIPFile(model, tempZipFile, 0, objFile, "3D model import " + modelName);
      return new TemporaryURLContent(new URL("jar:" + tempZipFile.toURI().toURL() + "!/"
          + URLEncoder.encode(objFile, "UTF-8").replace("+", "%20")));
    } finally {
      setDefaultState();
    }
  }
View Full Code Here

   * Returns the icon content matching the displayed view.
   */
  public Content getIcon(int maxWaitingDelay) throws IOException {
    File tempIconFile = OperatingSystem.createTemporaryFile("icon", ".png");
    ImageIO.write(getIconImage(maxWaitingDelay), "png", tempIconFile);
    return new TemporaryURLContent(tempIconFile.toURI().toURL());
  }
View Full Code Here

      if (pluginFurnitureCatalogFile.canWrite()
          && (urlUpdate == null
              || urlUpdate.openConnection().getLastModified() < urlModificationDate)) {
        // Copy updated resource URL content to a temporary file to ensure furniture added to home can safely
        // reference any file of the catalog file even if its content is changed afterwards
        TemporaryURLContent contentCopy = TemporaryURLContent.copyToTemporaryURLContent(new URLContent(pluginFurnitureCatalogUrl));
        URL temporaryFurnitureCatalogUrl = contentCopy.getURL();
        pluginFurnitureCatalogUrlUpdates.put(pluginFurnitureCatalogFile, temporaryFurnitureCatalogUrl);
        pluginFurnitureCatalogUrl = temporaryFurnitureCatalogUrl;
      } else if (urlUpdate != null) {
        pluginFurnitureCatalogUrl = urlUpdate;
      }
View Full Code Here

TOP

Related Classes of com.eteks.sweethome3d.tools.TemporaryURLContent

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.