Class Compass
Extends
HomeObject.
Defined in: SweetHome3D.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Compass(id, x, y, diameter)
Creates a compass drawn at the given point.
|
Method Attributes | Method Name and Description |
---|---|
clone()
Returns a clone of this compass.
|
|
containsPoint(x, y, margin)
Returns
true if the disc of this compass contains
the point at (x , y )
with a given margin . |
|
Returns the diameter of this compass.
|
|
Returns the latitude of this compass in radians.
|
|
Returns the longitude of this compass in radians.
|
|
Returns the North direction angle of this compass in radians.
|
|
Returns the corner points of the square that contains compass disc.
|
|
Returns the time zone identifier of this compass.
|
|
getX()
Returns the abscissa of the center of this compass.
|
|
getY()
Returns the ordinate of the center of this compass.
|
|
intersectsRectangle(x0, y0, x1, y1)
Returns
true if the disc of this compass intersects
with the horizontal rectangle which opposite corners are at points
(x0 , y0 ) and (x1 , y1 ). |
|
Returns
true if this compass is visible. |
|
move(dx, dy)
Moves this compass of (
dx , dy ) units. |
|
setDiameter(diameter)
Sets the diameter of this compass.
|
|
setLatitude(latitude)
Sets the latitude of this compass.
|
|
setLongitude(longitude)
Sets the longitude of the center of this compass.
|
|
setNorthDirection(northDirection)
Sets the North direction angle of this compass.
|
|
setTimeZone(timeZone)
Sets the time zone identifier of this compass.
|
|
setVisible(visible)
Sets whether this compass is visible or not.
|
|
setX(x)
Sets the abscissa of the center of this compass.
|
|
setY(y)
Sets the ordinate of the center of this compass.
|
- Methods borrowed from class HomeObject:
- duplicate, firePropertyChange, getContentProperty, getId, getProperty, getPropertyNames, isContentProperty, setProperty
Class Detail
Compass(id, x, y, diameter)
Creates a compass drawn at the given point.
North direction is set to zero, time zone to default
and the latitude and the longitude of this new compass is equal
to the geographic point matching the default time zone.
Author: Emmanuel Puybaret.
Author: Emmanuel Puybaret.
- Parameters:
- {string} id
- {number} x
- {number} y
- {number} diameter
Method Detail
{Compass}
clone()
Returns a clone of this compass.
- Returns:
- {Compass}
{boolean}
containsPoint(x, y, margin)
Returns
true
if the disc of this compass contains
the point at (x
, y
)
with a given margin
.
- Parameters:
- {number} x
- {number} y
- {number} margin
- Returns:
- {boolean}
{number}
getDiameter()
Returns the diameter of this compass.
- Returns:
- {number}
{number}
getLatitude()
Returns the latitude of this compass in radians.
- Returns:
- {number}
{number}
getLongitude()
Returns the longitude of this compass in radians.
- Returns:
- {number}
{number}
getNorthDirection()
Returns the North direction angle of this compass in radians.
- Returns:
- {number}
{float[][]}
getPoints()
Returns the corner points of the square that contains compass disc.
- Returns:
- {float[][]}
{string}
getTimeZone()
Returns the time zone identifier of this compass.
- Returns:
- {string}
- See:
- java.util.TimeZone
{number}
getX()
Returns the abscissa of the center of this compass.
- Returns:
- {number}
{number}
getY()
Returns the ordinate of the center of this compass.
- Returns:
- {number}
{boolean}
intersectsRectangle(x0, y0, x1, y1)
Returns
true
if the disc of this compass intersects
with 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}
isVisible()
Returns
true
if this compass is visible.
- Returns:
- {boolean}
move(dx, dy)
Moves this compass of (
dx
, dy
) units.
- Parameters:
- {number} dx
- {number} dy
setDiameter(diameter)
Sets the diameter of this compass. Once this compass is updated,
listeners added to this compass will receive a change notification.
- Parameters:
- {number} diameter
setLatitude(latitude)
Sets the latitude of this compass. Once this compass is updated,
listeners added to this compass will receive a change notification.
- Parameters:
- {number} latitude
setLongitude(longitude)
Sets the longitude of the center of this compass. Once this compass is updated,
listeners added to this compass will receive a change notification.
- Parameters:
- {number} longitude
setNorthDirection(northDirection)
Sets the North direction angle of this compass. Once this compass is updated,
listeners added to this compass will receive a change notification.
- Parameters:
- {number} northDirection
setTimeZone(timeZone)
Sets the time zone identifier of this compass. Once this compass is updated,
listeners added to this compass will receive a change notification.
- Parameters:
- {string} timeZone
- Throws:
- IllegalArgumentException if
timeZone
isnull
or contains an unknown identifier.
- See:
- java.util.TimeZone
setVisible(visible)
Sets whether this compass is visible or not. Once this compass is updated,
listeners added to this piece will receive a change notification.
- Parameters:
- {boolean} visible
setX(x)
Sets the abscissa of the center of this compass. Once this compass is updated,
listeners added to this compass will receive a change notification.
- Parameters:
- {number} x
setY(y)
Sets the ordinate of the center of this compass. Once this compass is updated,
listeners added to this compass will receive a change notification.
- Parameters:
- {number} y