Re: JAVA: How to change the default furniture catalog?

by Sweeto » Thu Nov 26, 2015 1:34 pm

The function readDefaultFurnitureCatalogs in

Code: Select all

Path_To_Sweet_Home_3D\SweetHome3D-5.1-src\src\com\eteks\sweethome3d\io\DefaultFurnitureCatalog.java
reads the default furniture catalog, the contributed furniture catalog and the additional furniture catalog:

Code: Select all

 
  private void readDefaultFurnitureCatalogs(UserPreferences preferences,
                                            Map<FurnitureCategory, Map<CatalogPieceOfFurniture, 
Integer>> furnitureHomonymsCounter,
                                            List<String> identifiedFurniture) {
    // Try to load com.eteks.sweethome3d.io.DefaultFurnitureCatalog property file from classpath 
    String defaultFurnitureCatalogFamily = DefaultFurnitureCatalog.class.getName();
    readFurnitureCatalog(defaultFurnitureCatalogFamily, 
        preferences, furnitureHomonymsCounter, identifiedFurniture);
    
    // Try to load com.eteks.sweethome3d.io.ContributedFurnitureCatalog property file from classpath 
    String classPackage = defaultFurnitureCatalogFamily.substring(0, defaultFurnitureCatalogFamily.lastIndexOf("."));
    readFurnitureCatalog(classPackage + "." + CONTRIBUTED_FURNITURE_CATALOG_FAMILY, 
        preferences, furnitureHomonymsCounter, identifiedFurniture);
    
    // Try to load com.eteks.sweethome3d.io.AdditionalFurnitureCatalog property file from classpath
    readFurnitureCatalog(classPackage + "." + ADDITIONAL_FURNITURE_CATALOG_FAMILY, 
        preferences, furnitureHomonymsCounter, identifiedFurniture);
  }