Package com.eteks.sweethome3d.model

Examples of com.eteks.sweethome3d.model.TexturesCatalog


        }
      }
    }
   
    // Delete default textures of current textures catalog         
    TexturesCatalog texturesCatalog = getTexturesCatalog();
    for (TexturesCategory category : texturesCatalog.getCategories()) {
      for (CatalogTexture texture : category.getTextures()) {
        if (!texture.isModifiable()) {
          texturesCatalog.delete(texture);
        }
      }
    }
    // Add default textures that don't have homonym among user catalog
    TexturesCatalog defaultTexturesCatalog =
        new DefaultTexturesCatalog(this.pluginTexturesCatalogURLs, this.texturesResourcesUrlBase);
    for (TexturesCategory category : defaultTexturesCatalog.getCategories()) {
      for (CatalogTexture texture : category.getTextures()) {
        try {
          texturesCatalog.add(category, texture);
        } catch (IllegalHomonymException ex) {
          // Ignore textures that have the same name as an existing piece
View Full Code Here


  @Override
  public void finish() {
    CatalogTexture newTexture = new CatalogTexture(getName(), getImage(),
        getWidth(), getHeight(), true);
    // Remove the edited texture from catalog
    TexturesCatalog catalog = this.preferences.getTexturesCatalog();
    if (this.texture != null) {
      catalog.delete(this.texture);
    }
    catalog.add(this.category, newTexture);
  }
View Full Code Here

  /**
   * Reloads textures default catalog.
   */
  private void updateTexturesDefaultCatalog() {
    // Delete default textures of current textures catalog         
    TexturesCatalog texturesCatalog = getTexturesCatalog();
    for (TexturesCategory category : texturesCatalog.getCategories()) {
      for (CatalogTexture texture : category.getTextures()) {
        if (!texture.isModifiable()) {
          texturesCatalog.delete(texture);
        }
      }
    }
    // Read again default textures catalog with new default locale
    // Add default textures that don't have homonym among user catalog
    TexturesCatalog defaultTexturesCatalog =
        new DefaultTexturesCatalog(this, getTexturesLibrariesPluginFolders());
    for (TexturesCategory category : defaultTexturesCatalog.getCategories()) {
      for (CatalogTexture texture : category.getTextures()) {
        try {
          texturesCatalog.add(category, texture);
        } catch (IllegalHomonymException ex) {
          // Ignore textures that have the same name as an existing piece
View Full Code Here

TOP

Related Classes of com.eteks.sweethome3d.model.TexturesCatalog

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.