public class CatalogPieceOfFurniture extends java.lang.Object implements java.lang.Comparable<CatalogPieceOfFurniture>, PieceOfFurniture
Constructor and Description |
---|
CatalogPieceOfFurniture(java.lang.String name,
Content icon,
Content model,
float width,
float depth,
float height,
boolean movable,
boolean doorOrWindow)
Deprecated.
As of version 1.7, use constructor without
doorOrWindow
parameter since a catalog door and window is supposed to be an instance
of CatalogDoorOrWindow |
CatalogPieceOfFurniture(java.lang.String name,
Content icon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
boolean doorOrWindow,
java.lang.Integer color,
float[][] modelRotation,
boolean backFaceShown,
float iconYaw,
boolean proportional)
Deprecated.
As of version 1.7, use constructor without
doorOrWindow
parameter since a catalog door and window is supposed to be an instance
of CatalogDoorOrWindow |
CatalogPieceOfFurniture(java.lang.String name,
Content icon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
java.lang.Integer color,
float[][] modelRotation,
boolean backFaceShown,
float iconYaw,
boolean proportional)
Creates a modifiable catalog piece of furniture with all its values.
|
CatalogPieceOfFurniture(java.lang.String name,
Content icon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
java.lang.String staircaseCutOutShape,
java.lang.Integer color,
float[][] modelRotation,
boolean backFaceShown,
float iconYaw,
boolean proportional)
Creates a modifiable catalog piece of furniture with all its values.
|
CatalogPieceOfFurniture(java.lang.String id,
java.lang.String name,
java.lang.String description,
Content icon,
Content planIcon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
float[][] modelRotation,
java.lang.String creator,
boolean resizable,
java.math.BigDecimal price,
java.math.BigDecimal valueAddedTaxPercentage)
Creates an unmodifiable catalog piece of furniture of the default catalog.
|
CatalogPieceOfFurniture(java.lang.String id,
java.lang.String name,
java.lang.String description,
Content icon,
Content planIcon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
float[][] modelRotation,
java.lang.String creator,
boolean resizable,
boolean deformable,
boolean texturable,
java.math.BigDecimal price,
java.math.BigDecimal valueAddedTaxPercentage)
Creates an unmodifiable catalog piece of furniture of the default catalog.
|
CatalogPieceOfFurniture(java.lang.String id,
java.lang.String name,
java.lang.String description,
Content icon,
Content planIcon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
java.lang.String staircaseCutOutShape,
float[][] modelRotation,
java.lang.String creator,
boolean resizable,
boolean deformable,
boolean texturable,
java.math.BigDecimal price,
java.math.BigDecimal valueAddedTaxPercentage,
java.lang.String currency)
Creates an unmodifiable catalog piece of furniture of the default catalog.
|
CatalogPieceOfFurniture(java.lang.String id,
java.lang.String name,
java.lang.String description,
Content icon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
boolean doorOrWindow,
float[][] modelRotation,
java.lang.String creator,
boolean resizable,
java.math.BigDecimal price,
java.math.BigDecimal valueAddedTaxPercentage)
Deprecated.
As of version 1.7, use constructor without
doorOrWindow
parameter since a catalog door and window is supposed to be an instance
of CatalogDoorOrWindow |
CatalogPieceOfFurniture(java.lang.String id,
java.lang.String name,
java.lang.String description,
Content icon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
float[][] modelRotation,
java.lang.String creator,
boolean resizable,
java.math.BigDecimal price,
java.math.BigDecimal valueAddedTaxPercentage)
Creates an unmodifiable catalog piece of furniture of the default catalog.
|
CatalogPieceOfFurniture(java.lang.String id,
java.lang.String name,
java.lang.String description,
java.lang.String information,
java.lang.String[] tags,
java.lang.Long creationDate,
java.lang.Float grade,
Content icon,
Content planIcon,
Content model,
float width,
float depth,
float height,
float elevation,
boolean movable,
java.lang.String staircaseCutOutShape,
float[][] modelRotation,
java.lang.String creator,
boolean resizable,
boolean deformable,
boolean texturable,
java.math.BigDecimal price,
java.math.BigDecimal valueAddedTaxPercentage,
java.lang.String currency)
Creates an unmodifiable catalog piece of furniture of the default catalog.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CatalogPieceOfFurniture piece)
Compares the names of this piece and the one in parameter.
|
boolean |
equals(java.lang.Object obj)
Returns
true if this piece and the one in parameter are the same objects. |
FurnitureCategory |
getCategory()
Returns the category of this piece of furniture.
|
java.lang.Integer |
getColor()
Returns the color of this piece of furniture.
|
java.lang.Long |
getCreationDate()
Returns the creation date of this piece in milliseconds since the epoch,
or
null if no date is given to this piece. |
java.lang.String |
getCreator()
Returns the creator of this piece.
|
java.lang.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.
|
java.lang.String |
getDescription()
Returns the description of this piece of furniture.
|
float |
getElevation()
Returns the elevation of this piece of furniture.
|
java.lang.Float |
getGrade()
Returns the grade of this piece, or
null if no grade is given to this piece. |
float |
getHeight()
Returns the height of this piece of furniture.
|
Content |
getIcon()
Returns the icon of this piece of furniture.
|
float |
getIconYaw()
Returns the yaw angle used to create the piece icon.
|
java.lang.String |
getId()
Returns the ID of this piece of furniture or
null . |
java.lang.String |
getInformation()
Returns the additional information associated to this piece, or
null . |
Content |
getModel()
Returns 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.
|
java.lang.String |
getName()
Returns the name of this piece of furniture.
|
Content |
getPlanIcon()
Returns the icon of this piece of furniture displayed in plan or
null . |
java.math.BigDecimal |
getPrice()
Returns the price of this piece of furniture or
null . |
java.lang.String |
getStaircaseCutOutShape()
Returns the shape used to cut out upper levels when they intersect with the piece
like a staircase.
|
java.lang.String[] |
getTags()
Returns the tags associated to this piece.
|
java.math.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.
|
int |
hashCode()
Returns default hash code.
|
boolean |
isBackFaceShown()
Returns
true if the back face of the piece of furniture
model should be displayed. |
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 |
isModifiable()
Returns
true if this piece is modifiable (not read from resources). |
boolean |
isMovable()
Returns
true if this piece of furniture is movable. |
boolean |
isProportional()
Returns
true if size proportions should be kept. |
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 |
matchesFilter(java.lang.String filter)
Returns
true if this piece matches the given filter text. |
public CatalogPieceOfFurniture(java.lang.String name, Content icon, Content model, float width, float depth, float height, boolean movable, boolean doorOrWindow)
doorOrWindow
parameter since a catalog door and window is supposed to be an instance
of CatalogDoorOrWindow
name
- the name of the new pieceicon
- content of the icon of the new piecemodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new piecemovable
- if true
, the new piece is movabledoorOrWindow
- if true
, the new piece is a door or a windowpublic CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, boolean doorOrWindow, float[][] modelRotation, java.lang.String creator, boolean resizable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage)
doorOrWindow
parameter since a catalog door and window is supposed to be an instance
of CatalogDoorOrWindow
id
- the id of the new piece or null
name
- the name of the new piecedescription
- the description of the new pieceicon
- content of the icon of the new piecemodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movabledoorOrWindow
- if true
, the new piece is a door or a windowmodelRotation
- the rotation 3 by 3 matrix applied to the piece modelcreator
- the creator of the modelresizable
- if true
, the size of the new piece may be editedprice
- the price of the new piece or null
valueAddedTaxPercentage
- the Value Added Tax percentage applied to the
price of the new piece or null
public CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, float[][] modelRotation, java.lang.String creator, boolean resizable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage)
id
- the id of the new piece or null
name
- the name of the new piecedescription
- the description of the new pieceicon
- content of the icon of the new piecemodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movablemodelRotation
- the rotation 3 by 3 matrix applied to the piece modelcreator
- the creator of the modelresizable
- if true
, the size of the new piece may be editedprice
- the price of the new piece or null
valueAddedTaxPercentage
- the Value Added Tax percentage applied to the
price of the new piece or null
public CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content planIcon, Content model, float width, float depth, float height, float elevation, boolean movable, float[][] modelRotation, java.lang.String creator, boolean resizable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage)
id
- the id of the new piece or null
name
- the name of the new piecedescription
- the description of the new pieceicon
- content of the icon of the new pieceplanIcon
- content of the icon of the new piece displayed in planmodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movablemodelRotation
- the rotation 3 by 3 matrix applied to the piece modelcreator
- the creator of the modelresizable
- if true
, the size of the new piece may be editedprice
- the price of the new piece or null
valueAddedTaxPercentage
- the Value Added Tax percentage applied to the
price of the new piece or null
public CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content planIcon, Content model, float width, float depth, float height, float elevation, boolean movable, float[][] modelRotation, java.lang.String creator, boolean resizable, boolean deformable, boolean texturable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage)
id
- the id of the new piece or null
name
- the name of the new piecedescription
- the description of the new pieceicon
- content of the icon of the new pieceplanIcon
- content of the icon of the new piece displayed in planmodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movablemodelRotation
- the rotation 3 by 3 matrix applied to the piece modelcreator
- the creator of the modelresizable
- if true
, the size of the new piece may be editeddeformable
- if true
, the width, depth and height of the new piece may
change independently from each othertexturable
- if false
this piece should always keep the same color or texture.price
- the price of the new piece or null
valueAddedTaxPercentage
- the Value Added Tax percentage applied to the
price of the new piece or null
public CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content planIcon, Content model, float width, float depth, float height, float elevation, boolean movable, java.lang.String staircaseCutOutShape, float[][] modelRotation, java.lang.String creator, boolean resizable, boolean deformable, boolean texturable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage, java.lang.String currency)
id
- the id of the new piece or null
name
- the name of the new piecedescription
- the description of the new pieceicon
- content of the icon of the new pieceplanIcon
- content of the icon of the new piece displayed in planmodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movablestaircaseCutOutShape
- the shape used to cut out upper levels when they intersect
with the piece like a staircasemodelRotation
- the rotation 3 by 3 matrix applied to the piece modelcreator
- the creator of the modelresizable
- if true
, the size of the new piece may be editeddeformable
- if true
, the width, depth and height of the new piece may
change independently from each othertexturable
- if false
this piece should always keep the same color or texture.price
- the price of the new piece or null
valueAddedTaxPercentage
- the Value Added Tax percentage applied to the
price of the new piece or null
currency
- the price currency, noted with ISO 4217 code, or null
public CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, java.lang.String information, java.lang.String[] tags, java.lang.Long creationDate, java.lang.Float grade, Content icon, Content planIcon, Content model, float width, float depth, float height, float elevation, boolean movable, java.lang.String staircaseCutOutShape, float[][] modelRotation, java.lang.String creator, boolean resizable, boolean deformable, boolean texturable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage, java.lang.String currency)
id
- the id of the new piece or null
name
- the name of the new piecedescription
- the description of the new pieceinformation
- additional information associated to the new piecetags
- tags associated to the new piececreationDate
- creation date of the new piece in milliseconds since the epochgrade
- grade of the piece of furniture or null
icon
- content of the icon of the new pieceplanIcon
- content of the icon of the new piece displayed in planmodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movablestaircaseCutOutShape
- the shape used to cut out upper levels when they intersect
with the piece like a staircasemodelRotation
- the rotation 3 by 3 matrix applied to the piece modelcreator
- the creator of the modelresizable
- if true
, the size of the new piece may be editeddeformable
- if true
, the width, depth and height of the new piece may
change independently from each othertexturable
- if false
this piece should always keep the same color or texture.price
- the price of the new piece or null
valueAddedTaxPercentage
- the Value Added Tax percentage applied to the
price of the new piece or null
currency
- the price currency, noted with ISO 4217 code, or null
public CatalogPieceOfFurniture(java.lang.String name, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, boolean doorOrWindow, java.lang.Integer color, float[][] modelRotation, boolean backFaceShown, float iconYaw, boolean proportional)
doorOrWindow
parameter since a catalog door and window is supposed to be an instance
of CatalogDoorOrWindow
name
- the name of the new pieceicon
- content of the icon of the new piecemodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movabledoorOrWindow
- if true
, the new piece is a door or a windowcolor
- the color of the piece as RGB code or null
if piece color is unchangedmodelRotation
- the rotation 3 by 3 matrix applied to the piece modelbackFaceShown
- true
if back face should be showniconYaw
- the yaw angle used to create the piece iconproportional
- if true
, size proportions will be keptpublic CatalogPieceOfFurniture(java.lang.String name, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, java.lang.Integer color, float[][] modelRotation, boolean backFaceShown, float iconYaw, boolean proportional)
name
- the name of the new pieceicon
- content of the icon of the new piecemodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movablecolor
- the color of the piece as RGB code or null
if piece color is unchangedmodelRotation
- the rotation 3 by 3 matrix applied to the piece modelbackFaceShown
- true
if back face should be showniconYaw
- the yaw angle used to create the piece iconproportional
- if true
, size proportions will be keptpublic CatalogPieceOfFurniture(java.lang.String name, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, java.lang.String staircaseCutOutShape, java.lang.Integer color, float[][] modelRotation, boolean backFaceShown, float iconYaw, boolean proportional)
name
- the name of the new pieceicon
- content of the icon of the new piecemodel
- content of the 3D model of the new piecewidth
- the width in centimeters of the new piecedepth
- the depth in centimeters of the new pieceheight
- the height in centimeters of the new pieceelevation
- the elevation in centimeters of the new piecemovable
- if true
, the new piece is movablestaircaseCutOutShape
- the shape used to cut out upper levels when they intersect
with the piece like a staircasecolor
- the color of the piece as RGB code or null
if piece color is unchangedmodelRotation
- the rotation 3 by 3 matrix applied to the piece modelbackFaceShown
- true
if back face should be showniconYaw
- the yaw angle used to create the piece iconproportional
- if true
, size proportions will be keptpublic java.lang.String getId()
null
.public java.lang.String getName()
getName
in interface PieceOfFurniture
public java.lang.String getDescription()
null
.getDescription
in interface PieceOfFurniture
public java.lang.String getInformation()
null
.getInformation
in interface PieceOfFurniture
public java.lang.String[] getTags()
public java.lang.Long getCreationDate()
null
if no date is given to this piece.public java.lang.Float getGrade()
null
if no grade is given to this piece.public float getDepth()
getDepth
in interface PieceOfFurniture
public float getHeight()
getHeight
in interface PieceOfFurniture
public float getWidth()
getWidth
in interface PieceOfFurniture
public float getElevation()
getElevation
in interface PieceOfFurniture
public boolean isMovable()
true
if this piece of furniture is movable.isMovable
in interface PieceOfFurniture
public boolean isDoorOrWindow()
true
if this piece of furniture is a door or a window.
As this method existed before CatalogDoorOrWindow 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 PieceOfFurniture
public Content getIcon()
getIcon
in interface PieceOfFurniture
public Content getPlanIcon()
null
.getPlanIcon
in interface PieceOfFurniture
public Content getModel()
getModel
in interface PieceOfFurniture
public float[][] getModelRotation()
getModelRotation
in interface PieceOfFurniture
public java.lang.String getStaircaseCutOutShape()
getStaircaseCutOutShape
in interface PieceOfFurniture
public java.lang.String getCreator()
getCreator
in interface PieceOfFurniture
public boolean isBackFaceShown()
true
if the back face of the piece of furniture
model should be displayed.isBackFaceShown
in interface PieceOfFurniture
public java.lang.Integer getColor()
getColor
in interface PieceOfFurniture
public float getIconYaw()
public boolean isProportional()
true
if size proportions should be kept.public boolean isModifiable()
true
if this piece is modifiable (not read from resources).public boolean isResizable()
true
if this piece is resizable.isResizable
in interface PieceOfFurniture
public boolean isDeformable()
true
if this piece is deformable.isDeformable
in interface PieceOfFurniture
public boolean isTexturable()
false
if this piece should always keep the same color or texture.isTexturable
in interface PieceOfFurniture
public java.math.BigDecimal getPrice()
null
.getPrice
in interface PieceOfFurniture
public java.math.BigDecimal getValueAddedTaxPercentage()
getValueAddedTaxPercentage
in interface PieceOfFurniture
public java.lang.String getCurrency()
null
if it has no price or default currency should be used.getCurrency
in interface PieceOfFurniture
public FurnitureCategory getCategory()
public boolean equals(java.lang.Object obj)
true
if this piece and the one in parameter are the same objects.
Note that, from version 3.6, two pieces of furniture can have the same name.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(CatalogPieceOfFurniture piece)
compareTo
in interface java.lang.Comparable<CatalogPieceOfFurniture>
public boolean matchesFilter(java.lang.String filter)
true
if this piece matches the given filter
text.
Each substring of the filter
is considered as a search criterion that can math
the name, the category name, the creator, the description or the tags of this piece.
© Copyrights 2006-2014 eTeks - All rights reserved
Distributed under GNU General Public License