Class FurnitureCatalog
Defined in: SweetHome3D.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Furniture catalog.
|
Method Attributes | Method Name and Description |
---|---|
add(category, piece)
Adds
piece of a given category to this catalog. |
|
addFurnitureListener(listener)
Adds the furniture
listener in parameter to this catalog. |
|
Returns the categories list sorted by name.
|
|
Returns the count of categories in this catalog.
|
|
getCategory(index)
Returns the category at a given
index . |
|
Returns the piece of furniture with the given
id if it exists. |
|
removeFurnitureListener(listener)
Removes the furniture
listener in parameter from this catalog. |
Method Detail
add(category, piece)
Adds
piece
of a given category
to this catalog.
Once the piece
is added, furniture listeners added to this catalog will receive a
{@link CollectionListener#collectionChanged(CollectionEvent) collectionChanged}
notification.
- Parameters:
- {FurnitureCategory} category
- the category of the piece.
- {CatalogPieceOfFurniture} piece
- a piece of furniture.
addFurnitureListener(listener)
Adds the furniture
listener
in parameter to this catalog.
- Parameters:
- {Object} listener
{FurnitureCategory[]}
getCategories()
Returns the categories list sorted by name.
- Returns:
- {FurnitureCategory[]} a list of categories.
{number}
getCategoriesCount()
Returns the count of categories in this catalog.
- Returns:
- {number}
{FurnitureCategory}
getCategory(index)
Returns the category at a given
index
.
- Parameters:
- {number} index
- Returns:
- {FurnitureCategory}
{CatalogPieceOfFurniture}
getPieceOfFurnitureWithId(id)
Returns the piece of furniture with the given
id
if it exists.
- Parameters:
- {string} id
- Returns:
- {CatalogPieceOfFurniture}
removeFurnitureListener(listener)
Removes the furniture
listener
in parameter from this catalog.
- Parameters:
- {Object} listener