Sweet Home 3D 4.1

com.eteks.sweethome3d.model
Class FurnitureCatalog

java.lang.Object
  extended by com.eteks.sweethome3d.model.FurnitureCatalog
Direct Known Subclasses:
DefaultFurnitureCatalog

public class FurnitureCatalog
extends Object

Furniture catalog.

Author:
Emmanuel Puybaret

Constructor Summary
FurnitureCatalog()
           
 
Method Summary
 void add(FurnitureCategory category, CatalogPieceOfFurniture piece)
          Adds piece of a given category to this catalog.
 void addFurnitureListener(CollectionListener<CatalogPieceOfFurniture> listener)
          Adds the furniture listener in parameter to this catalog.
 void delete(CatalogPieceOfFurniture piece)
          Deletes the piece from this catalog.
 List<FurnitureCategory> getCategories()
          Returns the categories list sorted by name.
 int getCategoriesCount()
          Returns the count of categories in this catalog.
 FurnitureCategory getCategory(int index)
          Returns the category at a given index.
 void removeFurnitureListener(CollectionListener<CatalogPieceOfFurniture> listener)
          Removes the furniture listener in parameter from this catalog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FurnitureCatalog

public FurnitureCatalog()
Method Detail

getCategories

public List<FurnitureCategory> getCategories()
Returns the categories list sorted by name.

Returns:
an unmodifiable list of categories.

getCategoriesCount

public int getCategoriesCount()
Returns the count of categories in this catalog.


getCategory

public FurnitureCategory getCategory(int index)
Returns the category at a given index.


addFurnitureListener

public void addFurnitureListener(CollectionListener<CatalogPieceOfFurniture> listener)
Adds the furniture listener in parameter to this catalog.


removeFurnitureListener

public void removeFurnitureListener(CollectionListener<CatalogPieceOfFurniture> listener)
Removes the furniture listener in parameter from this catalog.


add

public void add(FurnitureCategory category,
                CatalogPieceOfFurniture piece)
Adds piece of a given category to this catalog. Once the piece is added, furniture listeners added to this catalog will receive a collectionChanged notification.

Parameters:
category - the category of the piece.
piece - a piece of furniture.

delete

public void delete(CatalogPieceOfFurniture piece)
Deletes the piece from this catalog. If then piece category is empty, it will be removed from the categories of this catalog. Once the piece is deleted, furniture listeners added to this catalog will receive a collectionChanged notification.

Parameters:
piece - a piece of furniture in that category.

Sweet Home 3D 4.1

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License