Class Label
Extends
HomeObject.
Defined in: SweetHome3D.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Label(id, text, x, y)
Creates a label with the given
text . |
Method Attributes | Method Name and Description |
---|---|
clone()
Returns a clone of this label.
|
|
containsPoint(x, y, margin)
Returns
true if this text is at the point at (x , y )
with a given margin . |
|
getAngle()
Returns the angle in radians around vertical axis used to display this label.
|
|
getColor()
Returns the color used to display the text of this label.
|
|
Returns the elevation of this label on its level.
|
|
Returns the elevation of this label
from the ground according to the elevation of its level.
|
|
getLevel()
Returns the level which this label belongs to.
|
|
Returns the color used to outline the text of this label.
|
|
getPitch()
Returns the pitch angle in radians used to rotate this label around horizontal axis in 3D.
|
|
Returns the point of this label.
|
|
getStyle()
Returns the style used to display the text of this label.
|
|
getText()
Returns the text of this label.
|
|
getX()
Returns the abscissa of the text of this label.
|
|
getY()
Returns the ordinate of the text of this label.
|
|
intersectsRectangle(x0, y0, x1, y1)
Returns
true if the point of this label is contained
in the horizontal rectangle which opposite corners are at points
(x0 , y0 ) and (x1 , y1 ). |
|
isAtLevel(level)
Returns
true if this label is at the given level
or at a level with the same elevation and a smaller elevation index
or if the elevation of this label is higher than level elevation. |
|
move(dx, dy)
Moves this label of (
dx , dy ) units. |
|
setAngle(angle)
Sets the angle in radians around vertical axis used to display this label.
|
|
setColor(color)
Sets the color used to display the text of this label.
|
|
setElevation(elevation)
Sets the elevation of this label on its level.
|
|
setLevel(level)
Sets the level of this label.
|
|
setOutlineColor(outlineColor)
Sets the color used to outline the text of this label.
|
|
setPitch(pitch)
Sets the angle in radians used to rotate this label around horizontal axis in 3D.
|
|
setStyle(style)
Sets the style used to display the text of this label.
|
|
setText(text)
Sets the text of this label.
|
|
setX(x)
Sets the abscissa of the text of this label.
|
|
setY(y)
Sets the ordinate of the text of this label.
|
- Methods borrowed from class HomeObject:
- duplicate, firePropertyChange, getContentProperty, getId, getProperty, getPropertyNames, isContentProperty, setProperty
Class Detail
Label(id, text, x, y)
Creates a label with the given
Author: Emmanuel Puybaret.
text
.
Author: Emmanuel Puybaret.
- Parameters:
- {string} id
- {string} text
- {number} x
- {number} y
Method Detail
{Label}
clone()
Returns a clone of this label.
- Returns:
- {Label}
{boolean}
containsPoint(x, y, margin)
Returns
true
if this text is at the point at (x
, y
)
with a given margin
.
- Parameters:
- {number} x
- {number} y
- {number} margin
- Returns:
- {boolean}
{number}
getAngle()
Returns the angle in radians around vertical axis used to display this label.
- Returns:
- {number}
{number}
getColor()
Returns the color used to display the text of this label.
- Returns:
- {number}
{number}
getElevation()
Returns the elevation of this label on its level.
- Returns:
- {number}
- See:
- #getPitch()
{number}
getGroundElevation()
Returns the elevation of this label
from the ground according to the elevation of its level.
- Returns:
- {number}
{Level}
getLevel()
Returns the level which this label belongs to.
- Returns:
- {Level}
{number}
getOutlineColor()
Returns the color used to outline the text of this label.
- Returns:
- {number}
{number}
getPitch()
Returns the pitch angle in radians used to rotate this label around horizontal axis in 3D.
- Returns:
- {number} an angle in radians or
null
if the label shouldn't be displayed in 3D. A pitch angle equal to 0 should make this label fully visible when seen from top.
{float[][]}
getPoints()
Returns the point of this label.
- Returns:
- {float[][]} an array of the (x,y) coordinates of this label.
{TextStyle}
getStyle()
Returns the style used to display the text of this label.
- Returns:
- {TextStyle}
{string}
getText()
Returns the text of this label.
- Returns:
- {string}
{number}
getX()
Returns the abscissa of the text of this label.
- Returns:
- {number}
{number}
getY()
Returns the ordinate of the text of this label.
- Returns:
- {number}
{boolean}
intersectsRectangle(x0, y0, x1, y1)
Returns
true
if the point of this label is contained
in the horizontal rectangle which opposite corners are at points
(x0
, y0
) and (x1
, y1
).
- Parameters:
- {number} x0
- {number} y0
- {number} x1
- {number} y1
- Returns:
- {boolean}
{boolean}
isAtLevel(level)
Returns
true
if this label is at the given level
or at a level with the same elevation and a smaller elevation index
or if the elevation of this label is higher than level
elevation.
- Parameters:
- {Level} level
- Returns:
- {boolean}
move(dx, dy)
Moves this label of (
dx
, dy
) units.
- Parameters:
- {number} dx
- {number} dy
setAngle(angle)
Sets the angle in radians around vertical axis used to display this label. Once this label is updated,
listeners added to this label will receive a change notification.
- Parameters:
- {number} angle
setColor(color)
Sets the color used to display the text of this label.
Once this label is updated, listeners added to this label will receive a change notification.
- Parameters:
- {number} color
setElevation(elevation)
Sets the elevation of this label on its level. Once this label is updated,
listeners added to this label will receive a change notification.
- Parameters:
- {number} elevation
setLevel(level)
Sets the level of this label. Once this label is updated,
listeners added to this label will receive a change notification.
- Parameters:
- {Level} level
setOutlineColor(outlineColor)
Sets the color used to outline the text of this label.
Once this label is updated, listeners added to this label will receive a change notification.
- Parameters:
- {number} outlineColor
setPitch(pitch)
Sets the angle in radians used to rotate this label around horizontal axis in 3D. Once this label is updated,
listeners added to this label will receive a change notification.
Pitch axis is horizontal transverse axis.
- Parameters:
- {number} pitch
setStyle(style)
Sets the style used to display the text of this label.
Once this label is updated, listeners added to this label will receive a change notification.
- Parameters:
- {TextStyle} style
setText(text)
Sets the text of this label. Once this label is updated,
listeners added to this label will receive a change notification.
- Parameters:
- {string} text
setX(x)
Sets the abscissa of the text of this label. Once this label is updated,
listeners added to this label will receive a change notification.
- Parameters:
- {number} x
setY(y)
Sets the ordinate of the text of this label. Once this label is updated,
listeners added to this label will receive a change notification.
- Parameters:
- {number} y