public class Home
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
Home.Property
The properties of a home that may change.
|
Modifier and Type | Field and Description |
---|---|
static long |
CURRENT_VERSION
The current version of this home.
|
Modifier | Constructor and Description |
---|---|
|
Home()
Creates a home with no furniture, no walls,
and a height equal to 250 cm.
|
|
Home(float wallHeight)
Creates a home with no furniture and no walls.
|
protected |
Home(Home home)
Creates a home from an other one.
|
|
Home(java.util.List<HomePieceOfFurniture> furniture)
Creates a home with the given
furniture ,
no walls and a height equal to 250 cm. |
Modifier and Type | Method and Description |
---|---|
void |
addDimensionLine(DimensionLine dimensionLine)
Adds the given dimension line to the set of dimension lines of this home.
|
void |
addDimensionLinesListener(CollectionListener<DimensionLine> listener)
Adds the dimension line
listener in parameter to this home. |
void |
addFurnitureListener(CollectionListener<HomePieceOfFurniture> listener)
Adds the furniture
listener in parameter to this home. |
void |
addLabel(Label label)
Adds the given label to the set of labels of this home.
|
void |
addLabelsListener(CollectionListener<Label> listener)
Adds the label
listener in parameter to this home. |
void |
addLevel(Level level)
Adds the given
level to the list of levels of this home. |
void |
addLevelsListener(CollectionListener<Level> listener)
Adds the level
listener in parameter to this home. |
void |
addPieceOfFurniture(HomePieceOfFurniture piece)
Adds the
piece in parameter to this home at the end of the furniture list. |
void |
addPieceOfFurniture(HomePieceOfFurniture piece,
int index)
Adds the
piece in parameter at a given index . |
void |
addPieceOfFurnitureToGroup(HomePieceOfFurniture piece,
HomeFurnitureGroup group,
int index)
Adds the
piece in parameter at the index in the given group . |
void |
addPolyline(Polyline polyline)
Adds a given
polyline at the end of the polylines list of this home. |
void |
addPolyline(Polyline polyline,
int index)
Adds a
polyline at a given index of the set of polylines of this home. |
void |
addPolylinesListener(CollectionListener<Polyline> listener)
Adds the polyline
listener in parameter to this home. |
void |
addPropertyChangeListener(Home.Property property,
java.beans.PropertyChangeListener listener)
Adds the property change
listener in parameter to this home. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds the property change
listener in parameter to this home for a specific property name. |
void |
addRoom(Room room)
Adds the given
room at the end of the rooms list of this home. |
void |
addRoom(Room room,
int index)
Adds the
room in parameter at a given index . |
void |
addRoomsListener(CollectionListener<Room> listener)
Adds the room
listener in parameter to this home. |
void |
addSelectionListener(SelectionListener listener)
Adds the selection
listener in parameter to this home. |
void |
addWall(Wall wall)
Adds the given
wall to the set of walls of this home. |
void |
addWallsListener(CollectionListener<Wall> listener)
Adds the wall
listener in parameter to this home. |
Home |
clone()
Returns a clone of this home and the objects it contains.
|
void |
deleteDimensionLine(DimensionLine dimensionLine)
Removes the given dimension line from the set of dimension lines of this home.
|
void |
deleteLabel(Label label)
Removes the given label from the set of labels of this home.
|
void |
deleteLevel(Level level)
Removes the given
level from the set of levels of this home
and all the furniture, walls, rooms, dimension lines and labels that belong to this level. |
void |
deletePieceOfFurniture(HomePieceOfFurniture piece)
Deletes the
piece in parameter from this home. |
void |
deletePolyline(Polyline polyline)
Removes a given
polyline from the set of polylines of this home. |
void |
deleteRoom(Room room)
Removes the given
room from the set of rooms of this home. |
void |
deleteWall(Wall wall)
Removes the given
wall from the set of walls of this home. |
void |
deselectItem(Selectable item)
Deselects
item if it's selected and notifies listeners selection change. |
static java.util.List<Selectable> |
duplicate(java.util.List<? extends Selectable> items)
Returns a deep copy of home selectable
items . |
BackgroundImage |
getBackgroundImage()
Returns the plan background image of this home.
|
Camera |
getCamera()
Returns the camera used to display this home.
|
Compass |
getCompass()
Returns the compass associated to this home.
|
java.util.Collection<DimensionLine> |
getDimensionLines()
Returns an unmodifiable collection of the dimension lines of this home.
|
static java.util.List<DimensionLine> |
getDimensionLinesSubList(java.util.List<? extends Selectable> items)
Returns a sub list of
items that contains only dimension lines. |
HomeEnvironment |
getEnvironment()
Returns the environment attributes of this home.
|
java.util.List<HomePieceOfFurniture> |
getFurniture()
Returns an unmodifiable list of the furniture managed by this home.
|
java.util.List<ObjectProperty> |
getFurnitureAdditionalProperties()
Returns the list of furniture additional properties which should be handled in the user interface.
|
HomePieceOfFurniture.SortableProperty |
getFurnitureSortedProperty()
Deprecated.
getFurnitureSortedProperty() and setFurnitureSortedProperty(HomePieceOfFurniture.SortableProperty)
should be replaced by calls to getFurnitureSortedPropertyName() and setFurnitureSortedPropertyName(String)
to allow sorting on additional properties. |
java.lang.String |
getFurnitureSortedPropertyName()
Returns the furniture property name on which home is sorted or
null if
home furniture isn't sorted. |
static java.util.List<HomePieceOfFurniture> |
getFurnitureSubList(java.util.List<? extends Selectable> items)
Returns a sub list of
items that contains only home furniture. |
java.util.List<HomePieceOfFurniture.SortableProperty> |
getFurnitureVisibleProperties()
Deprecated.
getFurnitureVisibleProperties() and #setFurnitureVisibleProperties(List
should be replaced by calls to getFurnitureVisiblePropertyNames() and #setFurnitureSortedPropertyName(List
to allow displaying additional properties. |
java.util.List<java.lang.String> |
getFurnitureVisiblePropertyNames()
Returns an unmodifiable list of the furniture property names that are visible.
|
java.util.List<HomeObject> |
getHomeObjects()
Returns all the mutable objects handled by this home.
|
java.util.Collection<Label> |
getLabels()
Returns an unmodifiable collection of the labels of this home.
|
static java.util.List<Label> |
getLabelsSubList(java.util.List<? extends Selectable> items)
Returns a sub list of
items that contains only labels. |
java.util.List<Level> |
getLevels()
Returns an unmodifiable collection of the levels of this home.
|
java.lang.String |
getName()
Returns the name of this home.
|
java.lang.Number |
getNumericProperty(java.lang.String name)
Returns the numeric value of the property
name associated with this home. |
ObserverCamera |
getObserverCamera()
Returns the camera used to display this home from an observer point of view.
|
java.util.List<Polyline> |
getPolylines()
Returns an unmodifiable collection of the polylines of this home.
|
static java.util.List<Polyline> |
getPolylinesSubList(java.util.List<? extends Selectable> items)
Returns a sub list of
items that contains only labels. |
HomePrint |
getPrint()
Returns the print attributes of this home.
|
java.lang.String |
getProperty(java.lang.String name)
Returns the value of the property
name associated with this home. |
java.util.Collection<java.lang.String> |
getPropertyNames()
Returns the property names.
|
java.util.List<Room> |
getRooms()
Returns an unmodifiable collection of the rooms of this home.
|
static java.util.List<Room> |
getRoomsSubList(java.util.List<? extends Selectable> items)
Returns a sub list of
items that contains only rooms. |
java.util.List<Selectable> |
getSelectableViewableItems()
Returns all the selectable and viewable items in this home, except the observer camera.
|
java.util.List<Selectable> |
getSelectedItems()
Returns an unmodifiable list of the selected items in home.
|
Level |
getSelectedLevel()
Returns the selected level in home or
null if home has no level. |
java.util.List<Camera> |
getStoredCameras()
Returns an unmodifiable list of the cameras stored by this home.
|
static <T> java.util.List<T> |
getSubList(java.util.List<? extends Selectable> items,
java.lang.Class<T> subListClass)
Returns a sub list of
items that contains only instances of subListClass . |
Camera |
getTopCamera()
Returns the camera used to display this home from a top point of view.
|
long |
getVersion()
Returns the version of this home, the last time it was serialized or
or
CURRENT_VERSION if it is not serialized yet or
was serialized with Sweet Home 3D 0.x. |
java.lang.Object |
getVisualProperty(java.lang.String name)
Deprecated.
getVisualProperty(String) and setVisualProperty(String, Object)
should be replaced by calls to getProperty(String) and setProperty(String, String)
to ensure they can be easily saved and read. Future file format might not save visual properties anymore. |
float |
getWallHeight()
Returns the wall height of this home.
|
java.util.Collection<Wall> |
getWalls()
Returns an unmodifiable collection of the walls of this home.
|
static java.util.List<Wall> |
getWallsSubList(java.util.List<? extends Selectable> items)
Returns a sub list of
items that contains only walls. |
boolean |
isAllLevelsSelection()
Returns
true if the selected items in this home are from all levels. |
boolean |
isBasePlanLocked()
Returns
true if the home objects belonging to the base plan
(generally walls, rooms, dimension lines and texts) are locked. |
boolean |
isEmpty()
Returns
true if this home doesn't contain any item i.e. |
boolean |
isFurnitureDescendingSorted()
Returns whether furniture is sorted in ascending or descending order.
|
boolean |
isItemSelected(Selectable item)
Returns
true if the given item is selected in this home |
boolean |
isModified()
Returns whether the state of this home is modified or not.
|
boolean |
isRecovered()
Returns whether this home was recovered or not.
|
boolean |
isRepaired()
Returns whether this home was repaired or not.
|
void |
removeDimensionLinesListener(CollectionListener<DimensionLine> listener)
Removes the dimension line
listener in parameter from this home. |
void |
removeFurnitureListener(CollectionListener<HomePieceOfFurniture> listener)
Removes the furniture
listener in parameter from this home. |
void |
removeLabelsListener(CollectionListener<Label> listener)
Removes the label
listener in parameter from this home. |
void |
removeLevelsListener(CollectionListener<Level> listener)
Removes the level
listener in parameter from this home. |
void |
removePolylinesListener(CollectionListener<Polyline> listener)
Removes the polyline
listener in parameter from this home. |
void |
removePropertyChangeListener(Home.Property property,
java.beans.PropertyChangeListener listener)
Removes the property change
listener in parameter from this home. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes the property change
listener in parameter from this object. |
void |
removeRoomsListener(CollectionListener<Room> listener)
Removes the room
listener in parameter from this home. |
void |
removeSelectionListener(SelectionListener listener)
Removes the selection
listener in parameter from this home. |
void |
removeWallsListener(CollectionListener<Wall> listener)
Removes the wall
listener in parameter from this home. |
void |
setAllLevelsSelection(boolean selectionAtAllLevels)
Sets whether the selected items in this home are from all levels, and notifies listeners of the change.
|
void |
setBackgroundImage(BackgroundImage backgroundImage)
Sets the plan background image of this home and fires a
PropertyChangeEvent . |
void |
setBasePlanLocked(boolean basePlanLocked)
Sets whether home objects belonging to the base plan (generally walls, rooms,
dimension lines and texts) are locked and fires a
PropertyChangeEvent . |
void |
setCamera(Camera camera)
Sets the camera used to display this home and fires a
PropertyChangeEvent . |
void |
setFurnitureAdditionalProperties(java.util.List<ObjectProperty> furnitureAdditionalProperties)
Sets the list of furniture additional properties which should be handled in the user interface.
|
void |
setFurnitureDescendingSorted(boolean furnitureDescendingSorted)
Sets the furniture sort order on which home should be sorted
and fires a
PropertyChangeEvent . |
void |
setFurnitureSortedProperty(HomePieceOfFurniture.SortableProperty furnitureSortedProperty)
Deprecated.
getFurnitureSortedProperty() and setFurnitureSortedProperty(HomePieceOfFurniture.SortableProperty)
should be replaced by calls to getFurnitureSortedPropertyName() and setFurnitureSortedPropertyName(String)
to allow sorting on additional properties. |
void |
setFurnitureSortedPropertyName(java.lang.String furnitureSortedPropertyName)
Sets the furniture property name on which this home should be sorted
and fires a
PropertyChangeEvent . |
void |
setFurnitureVisibleProperties(java.util.List<HomePieceOfFurniture.SortableProperty> furnitureVisibleProperties)
Deprecated.
getFurnitureVisibleProperties() and #setFurnitureVisibleProperties(List
should be replaced by calls to getFurnitureVisiblePropertyNames() and #setFurnitureSortedPropertyName(List
to allow displaying additional properties. |
void |
setFurnitureVisiblePropertyNames(java.util.List<java.lang.String> furnitureVisiblePropertyNames)
Sets the furniture property names that are visible and the order in which they are visible,
then fires a
PropertyChangeEvent . |
void |
setModified(boolean modified)
Sets the modified state of this home and fires a
PropertyChangeEvent . |
void |
setName(java.lang.String name)
Sets the name of this home and fires a
PropertyChangeEvent . |
void |
setPrint(HomePrint print)
Sets the print attributes of this home and fires a
PropertyChangeEvent . |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property associated with this home.
|
void |
setRecovered(boolean recovered)
Sets whether this home was recovered or not and fires a
PropertyChangeEvent . |
void |
setRepaired(boolean repaired)
Sets whether this home is repaired or not and fires a
PropertyChangeEvent . |
void |
setSelectedItems(java.util.List<? extends Selectable> selectedItems)
Sets the selected items in home and notifies listeners selection change.
|
void |
setSelectedLevel(Level selectedLevel)
Sets the selected level in home and notifies listeners of the change.
|
void |
setStoredCameras(java.util.List<Camera> storedCameras)
Sets the cameras stored by this home and fires a
PropertyChangeEvent . |
void |
setVersion(long version)
Sets the version of this home.
|
void |
setVisualProperty(java.lang.String name,
java.lang.Object value)
Deprecated.
getVisualProperty(String) and setVisualProperty(String, Object)
should be replaced by calls to getProperty(String) and setProperty(String, String)
to ensure they can be easily saved and read. Future file format might not save visual properties anymore. |
public static final long CURRENT_VERSION
Home
class or in one of the classes that it uses,
this number is increased.public Home()
public Home(float wallHeight)
wallHeight
- default height for home wallspublic Home(java.util.List<HomePieceOfFurniture> furniture)
furniture
,
no walls and a height equal to 250 cm.protected Home(Home home)
home
is cloned to this home and listeners support is reset.public void addLevelsListener(CollectionListener<Level> listener)
listener
in parameter to this home.listener
- the listener to addpublic void removeLevelsListener(CollectionListener<Level> listener)
listener
in parameter from this home.listener
- the listener to removepublic java.util.List<Level> getLevels()
public void addLevel(Level level)
level
to the list of levels of this home.
Once the level
is added, level listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to ADD
.level
- the level to addpublic void deleteLevel(Level level)
level
from the set of levels of this home
and all the furniture, walls, rooms, dimension lines and labels that belong to this level.
Once the level
is removed, level listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to DELETE
.level
- the level to removepublic Level getSelectedLevel()
null
if home has no level.public void setSelectedLevel(Level selectedLevel)
selectedLevel
- the level to selectpublic boolean isAllLevelsSelection()
true
if the selected items in this home are from all levels.public void setAllLevelsSelection(boolean selectionAtAllLevels)
public void addFurnitureListener(CollectionListener<HomePieceOfFurniture> listener)
listener
in parameter to this home.listener
- the listener to addpublic void removeFurnitureListener(CollectionListener<HomePieceOfFurniture> listener)
listener
in parameter from this home.listener
- the listener to removepublic java.util.List<HomePieceOfFurniture> getFurniture()
public void addPieceOfFurniture(HomePieceOfFurniture piece)
piece
in parameter to this home at the end of the furniture list.
Once the piece
is added, furniture listeners added to this home will receive a
collectionChanged
notification.piece
- the piece to addpublic void addPieceOfFurniture(HomePieceOfFurniture piece, int index)
piece
in parameter at a given index
.
Once the piece
is added, furniture listeners added to this home will receive a
collectionChanged
notification.piece
- the piece to addindex
- the index at which the piece will be addedpublic void addPieceOfFurnitureToGroup(HomePieceOfFurniture piece, HomeFurnitureGroup group, int index)
piece
in parameter at the index
in the given group
.
Once the piece
is added, furniture listeners added to this home will receive a
collectionChanged
notification with an event index
equal to -1.piece
- the piece to addgroup
- the group to which the piece will be addedindex
- the index at which the piece will be addedpublic void deletePieceOfFurniture(HomePieceOfFurniture piece)
piece
in parameter from this home.
Once the piece
is deleted, furniture listeners added to this home will receive a
collectionChanged
notification. If the removed piece
belongs to a group, the
index
of the event will be -1.piece
- the piece to removepublic void addSelectionListener(SelectionListener listener)
listener
in parameter to this home.listener
- the listener to addpublic void removeSelectionListener(SelectionListener listener)
listener
in parameter from this home.listener
- the listener to removepublic java.util.List<Selectable> getSelectedItems()
public boolean isItemSelected(Selectable item)
true
if the given item
is selected in this homeitem
- a selectable item.public void setSelectedItems(java.util.List<? extends Selectable> selectedItems)
selectedItems
- the list of selected itemspublic void deselectItem(Selectable item)
item
if it's selected and notifies listeners selection change.item
- the item to remove from selected itemspublic void addRoomsListener(CollectionListener<Room> listener)
listener
in parameter to this home.listener
- the listener to addpublic void removeRoomsListener(CollectionListener<Room> listener)
listener
in parameter from this home.listener
- the listener to removepublic java.util.List<Room> getRooms()
public void addRoom(Room room)
room
at the end of the rooms list of this home.
Once the room
is added, room listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to ADD
.room
- the room to addpublic void addRoom(Room room, int index)
room
in parameter at a given index
.
Once the room
is added, room listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to ADD
.room
- the room to addindex
- the index at which the room will be addedpublic void deleteRoom(Room room)
room
from the set of rooms of this home.
Once the room
is removed, room listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to DELETE
.room
- the room to removepublic void addWallsListener(CollectionListener<Wall> listener)
listener
in parameter to this home.listener
- the listener to addpublic void removeWallsListener(CollectionListener<Wall> listener)
listener
in parameter from this home.listener
- the listener to removepublic java.util.Collection<Wall> getWalls()
public void addWall(Wall wall)
wall
to the set of walls of this home.
Once the wall
is added, wall listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to ADD
.wall
- the wall to addpublic void deleteWall(Wall wall)
wall
from the set of walls of this home.
Once the wall
is removed, wall listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to DELETE
.
If any wall is attached to wall
they will be detached from it.wall
- the wall to removepublic void addPolylinesListener(CollectionListener<Polyline> listener)
listener
in parameter to this home.listener
- the listener to addpublic void removePolylinesListener(CollectionListener<Polyline> listener)
listener
in parameter from this home.listener
- the listener to removepublic java.util.List<Polyline> getPolylines()
public void addPolyline(Polyline polyline)
polyline
at the end of the polylines list of this home.
Once the polyline
is added, polyline listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to ADD
.polyline
- the polyline to addpublic void addPolyline(Polyline polyline, int index)
polyline
at a given index
of the set of polylines of this home.
Once the polyline
is added, polyline listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to ADD
.polyline
- the polyline to addindex
- the index at which the polyline will be addedpublic void deletePolyline(Polyline polyline)
polyline
from the set of polylines of this home.
Once the polyline
is removed, polyline listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to DELETE
.polyline
- the polyline to removepublic void addDimensionLinesListener(CollectionListener<DimensionLine> listener)
listener
in parameter to this home.listener
- the listener to addpublic void removeDimensionLinesListener(CollectionListener<DimensionLine> listener)
listener
in parameter from this home.listener
- the listener to removepublic java.util.Collection<DimensionLine> getDimensionLines()
public void addDimensionLine(DimensionLine dimensionLine)
dimensionLine
is added, dimension line listeners added
to this home will receive a
collectionChanged
notification, with an event type
equal to ADD
.dimensionLine
- the dimension line to addpublic void deleteDimensionLine(DimensionLine dimensionLine)
dimensionLine
is removed, dimension line listeners added
to this home will receive a
collectionChanged
notification, with an event type
equal to DELETE
.dimensionLine
- the dimension line to removepublic void addLabelsListener(CollectionListener<Label> listener)
listener
in parameter to this home.listener
- the listener to addpublic void removeLabelsListener(CollectionListener<Label> listener)
listener
in parameter from this home.listener
- the listener to removepublic java.util.Collection<Label> getLabels()
public void addLabel(Label label)
label
is added, label listeners added
to this home will receive a
collectionChanged
notification, with an event type
equal to ADD
.label
- the label to addpublic void deleteLabel(Label label)
label
is removed, label listeners added to this home will receive a
collectionChanged
notification, with an event type
equal to DELETE
.label
- the label to removepublic java.util.List<Selectable> getSelectableViewableItems()
public java.util.List<HomeObject> getHomeObjects()
public boolean isEmpty()
true
if this home doesn't contain any item i.e.
no piece of furniture, no wall, no room, no dimension line and no label.public void addPropertyChangeListener(Home.Property property, java.beans.PropertyChangeListener listener)
listener
in parameter to this home.
Properties change will be notified with an event of PropertyChangeEvent
class which property name
will be equal to the value returned by Enum.name()
call.property
- the property to followlistener
- the listener to addpublic void removePropertyChangeListener(Home.Property property, java.beans.PropertyChangeListener listener)
listener
in parameter from this home.property
- the followed propertylistener
- the listener to removepublic float getWallHeight()
public java.lang.String getName()
public void setName(java.lang.String name)
PropertyChangeEvent
.name
- the new name of this homepublic boolean isModified()
public void setModified(boolean modified)
PropertyChangeEvent
.public boolean isRecovered()
public void setRecovered(boolean recovered)
PropertyChangeEvent
.public boolean isRepaired()
public void setRepaired(boolean repaired)
PropertyChangeEvent
.public java.lang.String getFurnitureSortedPropertyName()
null
if
home furniture isn't sorted.public void setFurnitureSortedPropertyName(java.lang.String furnitureSortedPropertyName)
PropertyChangeEvent
.furnitureSortedPropertyName
- the name of the propertypublic HomePieceOfFurniture.SortableProperty getFurnitureSortedProperty()
getFurnitureSortedProperty()
and setFurnitureSortedProperty(HomePieceOfFurniture.SortableProperty)
should be replaced by calls to getFurnitureSortedPropertyName()
and setFurnitureSortedPropertyName(String)
to allow sorting on additional properties.null
if
home furniture isn't sorted.public void setFurnitureSortedProperty(HomePieceOfFurniture.SortableProperty furnitureSortedProperty)
getFurnitureSortedProperty()
and setFurnitureSortedProperty(HomePieceOfFurniture.SortableProperty)
should be replaced by calls to getFurnitureSortedPropertyName()
and setFurnitureSortedPropertyName(String)
to allow sorting on additional properties.PropertyChangeEvent
.furnitureSortedProperty
- the new propertypublic boolean isFurnitureDescendingSorted()
public void setFurnitureDescendingSorted(boolean furnitureDescendingSorted)
PropertyChangeEvent
.public java.util.List<java.lang.String> getFurnitureVisiblePropertyNames()
public void setFurnitureVisiblePropertyNames(java.util.List<java.lang.String> furnitureVisiblePropertyNames)
PropertyChangeEvent
.furnitureVisiblePropertyNames
- the property names to displaypublic java.util.List<HomePieceOfFurniture.SortableProperty> getFurnitureVisibleProperties()
getFurnitureVisibleProperties()
and #setFurnitureVisibleProperties(List)
should be replaced by calls to getFurnitureVisiblePropertyNames()
and #setFurnitureSortedPropertyName(List)
to allow displaying additional properties.public void setFurnitureVisibleProperties(java.util.List<HomePieceOfFurniture.SortableProperty> furnitureVisibleProperties)
getFurnitureVisibleProperties()
and #setFurnitureVisibleProperties(List)
should be replaced by calls to getFurnitureVisiblePropertyNames()
and #setFurnitureSortedPropertyName(List)
to allow displaying additional properties.PropertyChangeEvent
.furnitureVisibleProperties
- the properties to displaypublic java.util.List<ObjectProperty> getFurnitureAdditionalProperties()
public void setFurnitureAdditionalProperties(java.util.List<ObjectProperty> furnitureAdditionalProperties)
public BackgroundImage getBackgroundImage()
public void setBackgroundImage(BackgroundImage backgroundImage)
PropertyChangeEvent
.backgroundImage
- the new background imagepublic Camera getTopCamera()
public ObserverCamera getObserverCamera()
public void setCamera(Camera camera)
PropertyChangeEvent
.camera
- the camera to usepublic Camera getCamera()
public void setStoredCameras(java.util.List<Camera> storedCameras)
PropertyChangeEvent
.
The list given as parameter is cloned but not the camera instances it contains.storedCameras
- the new list of cameraspublic java.util.List<Camera> getStoredCameras()
public HomeEnvironment getEnvironment()
public Compass getCompass()
public HomePrint getPrint()
public void setPrint(HomePrint print)
PropertyChangeEvent
.print
- the new print attributespublic java.lang.Object getVisualProperty(java.lang.String name)
getVisualProperty(String)
and setVisualProperty(String, Object)
should be replaced by calls to getProperty(String)
and setProperty(String, String)
to ensure they can be easily saved and read. Future file format might not save visual properties anymore.name
associated with this home.public void setVisualProperty(java.lang.String name, java.lang.Object value)
getVisualProperty(String)
and setVisualProperty(String, Object)
should be replaced by calls to getProperty(String)
and setProperty(String, String)
to ensure they can be easily saved and read. Future file format might not save visual properties anymore.public java.lang.String getProperty(java.lang.String name)
name
associated with this home.null
if it doesn't exist.public java.lang.Number getNumericProperty(java.lang.String name)
name
associated with this home.Long
, Double
or null
if the property
doesn't exist or can't be parsed.public void setProperty(java.lang.String name, java.lang.String value)
PropertyChangeEvent
class.name
- the name of the property to setvalue
- the new value of the propertypublic java.util.Collection<java.lang.String> getPropertyNames()
setProperty
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
listener
in parameter to this home for a specific property name.
Properties set with setProperty
will be notified with
an event of PropertyChangeEvent
class which property name will be equal to the property,
whereas changes on properties of Home.Property
enum will be notified with an event where
the property name will be equal to the value returned by Enum.name()
call.public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
listener
in parameter from this object.public boolean isBasePlanLocked()
true
if the home objects belonging to the base plan
(generally walls, rooms, dimension lines and texts) are locked.public void setBasePlanLocked(boolean basePlanLocked)
PropertyChangeEvent
.public long getVersion()
CURRENT_VERSION
if it is not serialized yet or
was serialized with Sweet Home 3D 0.x.
Version is useful to know with which Sweet Home 3D version this home was saved
and warn user that he may lose information if he saves with
current application a home created by a more recent version.public void setVersion(long version)
public Home clone()
clone
in class java.lang.Object
public static java.util.List<Selectable> duplicate(java.util.List<? extends Selectable> items)
items
.
Duplicated items are at the same index as their original and use different ids.items
- the items to duplicatepublic static java.util.List<HomePieceOfFurniture> getFurnitureSubList(java.util.List<? extends Selectable> items)
items
that contains only home furniture.items
- the items among which the search is donepublic static java.util.List<Wall> getWallsSubList(java.util.List<? extends Selectable> items)
items
that contains only walls.items
- the items among which the search is donepublic static java.util.List<Room> getRoomsSubList(java.util.List<? extends Selectable> items)
items
that contains only rooms.items
- the items among which the search is donepublic static java.util.List<Polyline> getPolylinesSubList(java.util.List<? extends Selectable> items)
items
that contains only labels.items
- the items among which the search is donepublic static java.util.List<DimensionLine> getDimensionLinesSubList(java.util.List<? extends Selectable> items)
items
that contains only dimension lines.items
- the items among which the search is donepublic static java.util.List<Label> getLabelsSubList(java.util.List<? extends Selectable> items)
items
that contains only labels.items
- the items among which the search is donepublic static <T> java.util.List<T> getSubList(java.util.List<? extends Selectable> items, java.lang.Class<T> subListClass)
items
that contains only instances of subListClass
.items
- the items among which the search is donesubListClass
- the class of the searched items
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License