public class HomePieceOfFurniture extends HomeObject implements PieceOfFurniture, Selectable, Elevatable
| Modifier and Type | Class and Description |
|---|---|
static class |
HomePieceOfFurniture.Property
The properties of a piece of furniture that may change.
|
static class |
HomePieceOfFurniture.SortableProperty
The properties on which home furniture may be sorted.
|
| Constructor and Description |
|---|
HomePieceOfFurniture(PieceOfFurniture piece)
Creates a home piece of furniture from an existing piece.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds the property change
listener in parameter to this piece. |
HomePieceOfFurniture |
clone()
Returns a clone of this piece.
|
boolean |
containsPoint(float x,
float y,
float margin)
Returns
true if this piece contains
the point at (x, y)
with a given margin. |
float |
getAngle()
Returns the angle in radians of this piece around vertical axis.
|
String |
getCatalogId()
Returns the catalog ID of this piece of furniture or
null if it doesn't exist. |
Integer |
getColor()
Returns the color of this piece of furniture.
|
String |
getCreator()
Returns the creator of this piece.
|
String |
getCurrency()
Returns the price currency, noted with ISO 4217 code, or
null
if it has no price or default currency should be used. |
float |
getDepth()
Returns the depth of this piece of furniture.
|
float |
getDepthInPlan()
Returns the depth of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
|
String |
getDescription()
Returns the description of this piece of furniture.
|
float |
getDropOnTopElevation()
Returns the elevation at which should be placed an object dropped on this piece.
|
float |
getElevation()
Returns the elevation of the bottom of this piece of furniture on its level.
|
static Comparator<HomePieceOfFurniture> |
getFurnitureComparator(HomePieceOfFurniture.SortableProperty property)
Returns a comparator that compares furniture on a given
property in ascending order. |
float |
getGroundElevation()
Returns the elevation of the bottom of this piece of furniture
from the ground according to the elevation of its level.
|
float |
getHeight()
Returns the height of this piece of furniture.
|
float |
getHeightInPlan()
Returns the height of this piece of furniture from the horizontal plan (after pitch or roll is applied to it).
|
Content |
getIcon()
Returns the icon of this piece of furniture.
|
String |
getInformation()
Returns the additional information associated to this piece, or
null. |
Level |
getLevel()
Returns the level which this piece belongs to.
|
Content |
getModel()
Returns the 3D model of this piece of furniture.
|
HomeMaterial[] |
getModelMaterials()
Returns the materials applied to the 3D model of this piece of furniture.
|
float[][] |
getModelRotation()
Returns the rotation 3 by 3 matrix of this piece of furniture that ensures
its model is correctly oriented.
|
Long |
getModelSize()
Returns the size of the 3D model of this piece of furniture.
|
String |
getName()
Returns the name of this piece of furniture.
|
float |
getNameAngle()
Returns the angle in radians used to display the piece name.
|
TextStyle |
getNameStyle()
Returns the text style used to display piece name.
|
float |
getNameXOffset()
Returns the distance along x axis applied to piece abscissa to display piece name.
|
float |
getNameYOffset()
Returns the distance along y axis applied to piece ordinate
to display piece name.
|
float |
getPitch()
Returns the pitch angle in radians of this piece of furniture.
|
Content |
getPlanIcon()
Returns the icon of this piece of furniture displayed in plan or
null. |
float[][] |
getPoints()
Returns the points of each corner of a piece.
|
BigDecimal |
getPrice()
Returns the price of this piece of furniture or
null. |
BigDecimal |
getPriceValueAddedTaxIncluded()
Returns the price of this piece of furniture, Value Added Tax included.
|
float |
getRoll()
Returns the roll angle in radians of this piece of furniture.
|
Float |
getShininess()
Returns the shininess of this piece of furniture.
|
String |
getStaircaseCutOutShape()
Returns the shape used to cut out upper levels when they intersect with the piece
like a staircase.
|
HomeTexture |
getTexture()
Returns the texture of this piece of furniture.
|
BigDecimal |
getValueAddedTax()
Returns the Value Added Tax applied to the price of this piece of furniture.
|
BigDecimal |
getValueAddedTaxPercentage()
Returns the Value Added Tax percentage applied to the price of this piece of furniture.
|
float |
getWidth()
Returns the width of this piece of furniture.
|
float |
getWidthInPlan()
Returns the width of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
|
float |
getX()
Returns the abscissa of the center of this piece of furniture.
|
float |
getY()
Returns the ordinate of the center of this piece of furniture.
|
boolean |
intersectsRectangle(float x0,
float y0,
float x1,
float y1)
Returns
true if this piece intersects
with the horizontal rectangle which opposite corners are at points
(x0, y0) and (x1, y1). |
boolean |
isAtLevel(Level level)
Returns
true if this piece is at the given level
or at a level with the same elevation and a smaller elevation index
or if the elevation of its highest point is higher than level elevation. |
boolean |
isBackFaceShown()
Returns
true if the back face of the piece of furniture
model should be displayed. |
boolean |
isBottomLeftPointAt(float x,
float y,
float margin)
Returns
true if the bottom left point of this piece is
the point at (x, y) with a given margin,
and if that point is closer to bottom left point than to top left and bottom right points. |
boolean |
isBottomRightPointAt(float x,
float y,
float margin)
Returns
true if the bottom right point of this piece is
the point at (x, y) with a given margin,
and if that point is closer to top left point than to top right and bottom left points. |
boolean |
isDeformable()
Returns
true if this piece is deformable. |
boolean |
isDoorOrWindow()
Returns
true if this piece of furniture is a door or a window. |
boolean |
isHorizontallyRotatable()
Returns
false if this piece should not rotate around an horizontal axis. |
boolean |
isHorizontallyRotated()
Returns
true if the pitch or roll angle of this piece is different from 0. |
boolean |
isModelCenteredAtOrigin()
Returns
true if model center should be always centered at the origin
when model rotation isn't null. |
boolean |
isModelMirrored()
Returns
true if the model of this piece should be mirrored. |
boolean |
isMovable()
Returns
true if this piece of furniture is movable. |
boolean |
isNameCenterPointAt(float x,
float y,
float margin)
Returns
true if the center point at which is displayed the name
of this piece is equal to the point at (x, y)
with a given margin. |
boolean |
isNameVisible()
Returns whether the name of this piece should be drawn or not.
|
boolean |
isParallelToWall(Wall wall)
Returns
true if the front side of this piece is parallel to the given wall
with a margin. |
boolean |
isPointAt(float x,
float y,
float margin)
Returns
true if one of the corner of this piece is
the point at (x, y) with a given margin. |
boolean |
isResizable()
Returns
true if this piece is resizable. |
boolean |
isTexturable()
Returns
false if this piece should always keep the same color or texture. |
boolean |
isTopLeftPointAt(float x,
float y,
float margin)
Returns
true if the top left point of this piece is
the point at (x, y) with a given margin,
and if that point is closer to top left point than to top right and bottom left points. |
boolean |
isTopRightPointAt(float x,
float y,
float margin)
Returns
true if the top right point of this piece is
the point at (x, y) with a given margin,
and if that point is closer to top right point than to top left and bottom right points. |
boolean |
isVisible()
Returns
true if this piece of furniture is visible. |
boolean |
isWidthDepthDeformable()
Returns
true if this piece is deformable. |
void |
move(float dx,
float dy)
Moves this piece of (
dx, dy) units. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the property change
listener in parameter from this piece. |
void |
scale(float scale)
Scales this piece of furniture with the given
scale. |
void |
setAngle(float angle)
Sets the angle of this piece around vertical axis.
|
void |
setColor(Integer color)
Sets the color of this piece of furniture.
|
void |
setDepth(float depth)
Sets the depth of this piece of furniture.
|
void |
setDepthInPlan(float depthInPlan)
Sets the depth of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
|
void |
setDescription(String description)
Sets the description of this piece of furniture.
|
void |
setElevation(float elevation)
Sets the elevation of this piece of furniture on its level.
|
void |
setHeight(float height)
Sets the height of this piece of furniture.
|
void |
setHeightInPlan(float heightInPlan)
Sets the height of this piece of furniture from the horizontal plan (after pitch or roll is applied to it).
|
void |
setLevel(Level level)
Sets the level of this piece of furniture.
|
void |
setModelCenteredAtOrigin(boolean modelCenteredAtOrigin)
Sets whether model center should be always centered at the origin
when model rotation isn't
null. |
void |
setModelMaterials(HomeMaterial[] modelMaterials)
Sets the materials of the 3D model of this piece of furniture.
|
void |
setModelMirrored(boolean modelMirrored)
Sets whether the model of this piece of furniture is mirrored or not.
|
void |
setModelSize(Long modelSize)
Sets the size of the 3D model of this piece of furniture.
|
void |
setMovable(boolean movable)
Sets whether this piece is movable or not.
|
void |
setName(String name)
Sets the name of this piece of furniture.
|
void |
setNameAngle(float nameAngle)
Sets the angle in radians used to display the piece name.
|
void |
setNameStyle(TextStyle nameStyle)
Sets the text style used to display piece name.
|
void |
setNameVisible(boolean nameVisible)
Sets whether the name of this piece is visible or not.
|
void |
setNameXOffset(float nameXOffset)
Sets the distance along x axis applied to piece abscissa to display piece name.
|
void |
setNameYOffset(float nameYOffset)
Sets the distance along y axis applied to piece ordinate to display piece name.
|
void |
setPitch(float pitch)
Sets the pitch angle in radians of this piece and notifies listeners of this change.
|
void |
setPrice(BigDecimal price)
Sets the price of this piece of furniture.
|
void |
setRoll(float roll)
Sets the roll angle in radians of this piece and notifies listeners of this change.
|
void |
setShininess(Float shininess)
Sets the shininess of this piece of furniture or
null if piece shininess is unchanged. |
void |
setTexture(HomeTexture texture)
Sets the texture of this piece of furniture.
|
void |
setVisible(boolean visible)
Sets whether this piece of furniture is visible or not.
|
void |
setWidth(float width)
Sets the width of this piece of furniture.
|
void |
setWidthInPlan(float widthInPlan)
Sets the width of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
|
void |
setX(float x)
Sets the abscissa of the center of this piece.
|
void |
setY(float y)
Sets the ordinate of the center of this piece.
|
getProperty, getPropertyNames, setPropertypublic HomePieceOfFurniture(PieceOfFurniture piece)
piece - the piece from which data are copiedpublic void addPropertyChangeListener(PropertyChangeListener listener)
listener in parameter to this piece.public void removePropertyChangeListener(PropertyChangeListener listener)
listener in parameter from this piece.public String getCatalogId()
null if it doesn't exist.public String getName()
getName in interface PieceOfFurniturepublic void setName(String name)
public boolean isNameVisible()
public void setNameVisible(boolean nameVisible)
public float getNameXOffset()
public void setNameXOffset(float nameXOffset)
public float getNameYOffset()
public void setNameYOffset(float nameYOffset)
public TextStyle getNameStyle()
public void setNameStyle(TextStyle nameStyle)
public float getNameAngle()
public void setNameAngle(float nameAngle)
public String getDescription()
null.getDescription in interface PieceOfFurniturepublic void setDescription(String description)
public String getInformation()
null.getInformation in interface PieceOfFurniturepublic float getDepth()
getDepth in interface PieceOfFurniturepublic void setDepth(float depth)
IllegalStateException - if this piece of furniture isn't resizablepublic float getDepthInPlan()
public void setDepthInPlan(float depthInPlan)
public float getHeight()
getHeight in interface PieceOfFurniturepublic void setHeight(float height)
IllegalStateException - if this piece of furniture isn't resizablepublic float getHeightInPlan()
public void setHeightInPlan(float heightInPlan)
public float getWidth()
getWidth in interface PieceOfFurniturepublic void setWidth(float width)
IllegalStateException - if this piece of furniture isn't resizablepublic float getWidthInPlan()
public void setWidthInPlan(float widthInPlan)
public void scale(float scale)
scale.
Once this piece is updated, listeners added to this piece will receive a change notification.public float getElevation()
getElevation in interface PieceOfFurniturepublic float getDropOnTopElevation()
getDropOnTopElevation in interface PieceOfFurniturepublic float getGroundElevation()
public void setElevation(float elevation)
public boolean isMovable()
true if this piece of furniture is movable.isMovable in interface PieceOfFurniturepublic void setMovable(boolean movable)
public boolean isDoorOrWindow()
true if this piece of furniture is a door or a window.
As this method existed before HomeDoorOrWindow class,
you shouldn't rely on the value returned by this method to guess if a piece
is an instance of DoorOrWindow class.isDoorOrWindow in interface PieceOfFurniturepublic Content getIcon()
getIcon in interface PieceOfFurniturepublic Content getPlanIcon()
null.getPlanIcon in interface PieceOfFurniturepublic Content getModel()
getModel in interface PieceOfFurniturepublic void setModelSize(Long modelSize)
public Long getModelSize()
getModelSize in interface PieceOfFurniturepublic void setModelMaterials(HomeMaterial[] modelMaterials)
modelMaterials - the materials of the 3D model or null if they shouldn't be changedIllegalStateException - if this piece of furniture isn't texturablepublic HomeMaterial[] getModelMaterials()
null
if the individual materials of the 3D model are not modified.public Integer getColor()
getColor in interface PieceOfFurniturenull if piece color is unchanged.public void setColor(Integer color)
color - the color of this piece of furniture or null if piece color is the default oneIllegalStateException - if this piece of furniture isn't texturablepublic HomeTexture getTexture()
null if piece texture is unchanged.public void setTexture(HomeTexture texture)
texture - the texture of this piece of furniture or null if piece texture is the default oneIllegalStateException - if this piece of furniture isn't texturablepublic Float getShininess()
null if piece shininess is unchanged.public void setShininess(Float shininess)
null if piece shininess is unchanged.
Once this piece is updated, listeners added to this piece will receive a change notification.IllegalStateException - if this piece of furniture isn't texturablepublic boolean isResizable()
true if this piece is resizable.isResizable in interface PieceOfFurniturepublic boolean isDeformable()
true if this piece is deformable.isDeformable in interface PieceOfFurniturepublic boolean isWidthDepthDeformable()
true if this piece is deformable.isWidthDepthDeformable in interface PieceOfFurniturepublic boolean isTexturable()
false if this piece should always keep the same color or texture.isTexturable in interface PieceOfFurniturepublic boolean isHorizontallyRotatable()
false if this piece should not rotate around an horizontal axis.isHorizontallyRotatable in interface PieceOfFurniturepublic BigDecimal getPrice()
null.getPrice in interface PieceOfFurniturepublic void setPrice(BigDecimal price)
public BigDecimal getValueAddedTaxPercentage()
getValueAddedTaxPercentage in interface PieceOfFurniturepublic BigDecimal getValueAddedTax()
public BigDecimal getPriceValueAddedTaxIncluded()
public String getCurrency()
null
if it has no price or default currency should be used.getCurrency in interface PieceOfFurniturepublic boolean isVisible()
true if this piece of furniture is visible.public void setVisible(boolean visible)
public float getX()
public void setX(float x)
public float getY()
public void setY(float y)
public float getAngle()
public void setAngle(float angle)
public float getPitch()
public void setPitch(float pitch)
public float getRoll()
public void setRoll(float roll)
public boolean isHorizontallyRotated()
true if the pitch or roll angle of this piece is different from 0.public boolean isModelMirrored()
true if the model of this piece should be mirrored.public void setModelMirrored(boolean modelMirrored)
IllegalStateException - if this piece of furniture isn't resizablepublic float[][] getModelRotation()
getModelRotation in interface PieceOfFurniturepublic void setModelCenteredAtOrigin(boolean modelCenteredAtOrigin)
null.
This method should be called only to keep unchanged the (wrong) location
of a rotated model created with version < 5.5.public boolean isModelCenteredAtOrigin()
true if model center should be always centered at the origin
when model rotation isn't null.false by default if version < 5.5public String getStaircaseCutOutShape()
getStaircaseCutOutShape in interface PieceOfFurniturepublic String getCreator()
getCreator in interface PieceOfFurniturepublic boolean isBackFaceShown()
true if the back face of the piece of furniture
model should be displayed.isBackFaceShown in interface PieceOfFurniturepublic Level getLevel()
getLevel in interface Elevatablepublic void setLevel(Level level)
public boolean isAtLevel(Level level)
true if this piece is at the given level
or at a level with the same elevation and a smaller elevation index
or if the elevation of its highest point is higher than level elevation.isAtLevel in interface Elevatablepublic float[][] getPoints()
getPoints in interface Selectablepublic boolean intersectsRectangle(float x0,
float y0,
float x1,
float y1)
true if this piece intersects
with the horizontal rectangle which opposite corners are at points
(x0, y0) and (x1, y1).intersectsRectangle in interface Selectablepublic boolean containsPoint(float x,
float y,
float margin)
true if this piece contains
the point at (x, y)
with a given margin.containsPoint in interface Selectablepublic boolean isPointAt(float x,
float y,
float margin)
true if one of the corner of this piece is
the point at (x, y) with a given margin.public boolean isTopLeftPointAt(float x,
float y,
float margin)
true if the top left point of this piece is
the point at (x, y) with a given margin,
and if that point is closer to top left point than to top right and bottom left points.public boolean isTopRightPointAt(float x,
float y,
float margin)
true if the top right point of this piece is
the point at (x, y) with a given margin,
and if that point is closer to top right point than to top left and bottom right points.public boolean isBottomLeftPointAt(float x,
float y,
float margin)
true if the bottom left point of this piece is
the point at (x, y) with a given margin,
and if that point is closer to bottom left point than to top left and bottom right points.public boolean isBottomRightPointAt(float x,
float y,
float margin)
true if the bottom right point of this piece is
the point at (x, y) with a given margin,
and if that point is closer to top left point than to top right and bottom left points.public boolean isNameCenterPointAt(float x,
float y,
float margin)
true if the center point at which is displayed the name
of this piece is equal to the point at (x, y)
with a given margin.public boolean isParallelToWall(Wall wall)
true if the front side of this piece is parallel to the given wall
with a margin.public void move(float dx,
float dy)
dx, dy) units.move in interface Selectablepublic HomePieceOfFurniture clone()
clone in interface Selectableclone in class HomeObjectpublic static Comparator<HomePieceOfFurniture> getFurnitureComparator(HomePieceOfFurniture.SortableProperty property)
property in ascending order.

© Copyrights 2006-2017 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License