public class Room extends HomeObject implements Selectable, Elevatable
Modifier and Type | Class and Description |
---|---|
static class |
Room.Property
The properties of a room that may change.
|
Constructor and Description |
---|
Room(float[][] points)
Creates a room from its name and the given coordinates.
|
Room(java.lang.String id,
float[][] points)
Creates a room from its name and the given coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(float x,
float y)
Adds a point at the end of room points.
|
void |
addPoint(float x,
float y,
int index)
Adds a point at the given
index . |
Room |
clone()
Returns a clone of this room.
|
boolean |
containsPoint(float x,
float y,
float margin)
Returns
true if this room contains
the point at (x , y ) with a given margin . |
float |
getArea()
Returns the area of this room.
|
float |
getAreaAngle()
Returns the angle in radians used to display the room area.
|
TextStyle |
getAreaStyle()
Returns the text style used to display room area.
|
float |
getAreaXOffset()
Returns the distance along x axis applied to room center abscissa
to display room area.
|
float |
getAreaYOffset()
Returns the distance along y axis applied to room center ordinate
to display room area.
|
float[] |
getBoundsMaximumCoordinates()
Returns the maximum coordinates of the rectangle bounding this room.
|
float[] |
getBoundsMinimumCoordinates()
Returns the minimum coordinates of the rectangle bounding this room.
|
java.lang.Integer |
getCeilingColor()
Returns the ceiling color color of this room.
|
float |
getCeilingShininess()
Returns the ceiling shininess of this room.
|
HomeTexture |
getCeilingTexture()
Returns the ceiling texture of this room.
|
java.lang.Integer |
getFloorColor()
Returns the floor color of this room.
|
float |
getFloorShininess()
Returns the floor shininess of this room.
|
HomeTexture |
getFloorTexture()
Returns the floor texture of this room.
|
Level |
getLevel()
Returns the level which this room belongs to.
|
java.lang.String |
getName()
Returns the name of this room.
|
float |
getNameAngle()
Returns the angle in radians used to display the room name.
|
TextStyle |
getNameStyle()
Returns the text style used to display room name.
|
float |
getNameXOffset()
Returns the distance along x axis applied to room center abscissa
to display room name.
|
float |
getNameYOffset()
Returns the distance along y axis applied to room center ordinate
to display room name.
|
int |
getPointCount()
Returns the number of points of the polygon matching this room.
|
int |
getPointIndexAt(float x,
float y,
float margin)
Returns the index of the point of this room equal to
the point at (
x , y ) with a given margin . |
float[][] |
getPoints()
Returns the points of the polygon matching this room.
|
float |
getXCenter()
Returns the abscissa of the center point of this room.
|
float |
getYCenter()
Returns the ordinate of the center point of this room.
|
boolean |
intersectsRectangle(float x0,
float y0,
float x1,
float y1)
Returns
true if this room intersects
with the horizontal rectangle which opposite corners are at points
(x0 , y0 ) and (x1 , y1 ). |
boolean |
isAreaCenterPointAt(float x,
float y,
float margin)
Returns
true if the center point at which is displayed the area
of this room is equal to the point at (x , y )
with a given margin . |
boolean |
isAreaVisible()
Returns whether the area of this room is visible or not.
|
boolean |
isAtLevel(Level level)
Returns
true if this room is at the given level
or at a level with the same elevation and a smaller elevation index. |
boolean |
isCeilingFlat()
Returns
true if the ceiling should remain flat whatever its environment. |
boolean |
isCeilingVisible()
Returns whether the ceiling of this room is visible or not.
|
boolean |
isClockwise()
Returns
true if the points of this room are in clockwise order. |
boolean |
isFloorVisible()
Returns whether the floor of this room is visible or not.
|
boolean |
isNameCenterPointAt(float x,
float y,
float margin)
Returns
true if the center point at which is displayed the name
of this room is equal to the point at (x , y )
with a given margin . |
boolean |
isSingular()
Returns
true if this room is comprised of only one polygon. |
void |
move(float dx,
float dy)
Moves this room of (
dx , dy ) units. |
void |
removePoint(int index)
Removes the point at the given
index . |
void |
setAreaAngle(float areaAngle)
Sets the angle in radians used to display the room area.
|
void |
setAreaStyle(TextStyle areaStyle)
Sets the text style used to display room area.
|
void |
setAreaVisible(boolean areaVisible)
Sets whether the area of this room is visible or not.
|
void |
setAreaXOffset(float areaXOffset)
Sets the distance along x axis applied to room center abscissa to display room area.
|
void |
setAreaYOffset(float areaYOffset)
Sets the distance along y axis applied to room center ordinate to display room area.
|
void |
setCeilingColor(java.lang.Integer ceilingColor)
Sets the ceiling color of this room.
|
void |
setCeilingFlat(boolean ceilingFlat)
Sets whether the floor texture should remain flat.
|
void |
setCeilingShininess(float ceilingShininess)
Sets the ceiling shininess of this room.
|
void |
setCeilingTexture(HomeTexture ceilingTexture)
Sets the ceiling texture of this room.
|
void |
setCeilingVisible(boolean ceilingVisible)
Sets whether the ceiling of this room is visible or not.
|
void |
setFloorColor(java.lang.Integer floorColor)
Sets the floor color of this room.
|
void |
setFloorShininess(float floorShininess)
Sets the floor shininess of this room.
|
void |
setFloorTexture(HomeTexture floorTexture)
Sets the floor texture of this room.
|
void |
setFloorVisible(boolean floorVisible)
Sets whether the floor of this room is visible or not.
|
void |
setLevel(Level level)
Sets the level of this room.
|
void |
setName(java.lang.String name)
Sets the name of this room.
|
void |
setNameAngle(float nameAngle)
Sets the angle in radians used to display the room name.
|
void |
setNameStyle(TextStyle nameStyle)
Sets the text style used to display room name.
|
void |
setNameXOffset(float nameXOffset)
Sets the distance along x axis applied to room center abscissa to display room name.
|
void |
setNameYOffset(float nameYOffset)
Sets the distance along y axis applied to room center ordinate to display room name.
|
void |
setPoint(float x,
float y,
int index)
Sets the point at the given
index . |
void |
setPoints(float[][] points)
Sets the points of the polygon matching this room.
|
addPropertyChangeListener, addPropertyChangeListener, createId, duplicate, firePropertyChange, getContentProperty, getId, getProperty, getPropertyNames, isContentProperty, removePropertyChangeListener, removePropertyChangeListener, setProperty, setProperty
public Room(float[][] points)
public Room(java.lang.String id, float[][] points)
public java.lang.String getName()
public void setName(java.lang.String name)
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 float[][] getPoints()
getPoints
in interface Selectable
public int getPointCount()
public void setPoints(float[][] points)
public void addPoint(float x, float y)
public void addPoint(float x, float y, int index)
index
.java.lang.IndexOutOfBoundsException
- if index
is negative or > getPointCount()
public void setPoint(float x, float y, int index)
index
.java.lang.IndexOutOfBoundsException
- if index
is negative or >= getPointCount()
public void removePoint(int index)
index
.java.lang.IndexOutOfBoundsException
- if index
is negative or >= getPointCount()
public float[] getBoundsMinimumCoordinates()
public float[] getBoundsMaximumCoordinates()
public boolean isAreaVisible()
public void setAreaVisible(boolean areaVisible)
public float getAreaXOffset()
public void setAreaXOffset(float areaXOffset)
public float getAreaYOffset()
public void setAreaYOffset(float areaYOffset)
public TextStyle getAreaStyle()
public void setAreaStyle(TextStyle areaStyle)
public float getAreaAngle()
public void setAreaAngle(float areaAngle)
public float getXCenter()
public float getYCenter()
public java.lang.Integer getFloorColor()
public void setFloorColor(java.lang.Integer floorColor)
public HomeTexture getFloorTexture()
public void setFloorTexture(HomeTexture floorTexture)
public boolean isFloorVisible()
public void setFloorVisible(boolean floorVisible)
public float getFloorShininess()
public void setFloorShininess(float floorShininess)
public java.lang.Integer getCeilingColor()
public void setCeilingColor(java.lang.Integer ceilingColor)
public HomeTexture getCeilingTexture()
public void setCeilingTexture(HomeTexture ceilingTexture)
public boolean isCeilingVisible()
public void setCeilingVisible(boolean ceilingVisible)
public float getCeilingShininess()
public void setCeilingShininess(float ceilingShininess)
public boolean isCeilingFlat()
true
if the ceiling should remain flat whatever its environment.public void setCeilingFlat(boolean ceilingFlat)
public Level getLevel()
getLevel
in interface Elevatable
public void setLevel(Level level)
public boolean isAtLevel(Level level)
true
if this room is at the given level
or at a level with the same elevation and a smaller elevation index.isAtLevel
in interface Elevatable
public float getArea()
public boolean isClockwise()
true
if the points of this room are in clockwise order.public boolean isSingular()
true
if this room is comprised of only one polygon.public boolean intersectsRectangle(float x0, float y0, float x1, float y1)
true
if this room intersects
with the horizontal rectangle which opposite corners are at points
(x0
, y0
) and (x1
, y1
).intersectsRectangle
in interface Selectable
public boolean containsPoint(float x, float y, float margin)
true
if this room contains
the point at (x
, y
) with a given margin
.containsPoint
in interface Selectable
public int getPointIndexAt(float x, float y, float margin)
x
, y
) with a given margin
.public boolean isNameCenterPointAt(float x, float y, float margin)
true
if the center point at which is displayed the name
of this room is equal to the point at (x
, y
)
with a given margin
.public boolean isAreaCenterPointAt(float x, float y, float margin)
true
if the center point at which is displayed the area
of this room is equal to the point at (x
, y
)
with a given margin
.public void move(float dx, float dy)
dx
, dy
) units.move
in interface Selectable
public Room clone()
clone
in interface Selectable
clone
in class HomeObject
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License