public class Compass extends HomeObject implements Selectable
| Modifier and Type | Class and Description |
|---|---|
static class |
Compass.Property
The properties of a compass that may change.
|
| Constructor and Description |
|---|
Compass(float x,
float y,
float diameter)
Creates a compass drawn at the given point.
|
Compass(java.lang.String id,
float x,
float y,
float diameter)
Creates a compass drawn at the given point.
|
| Modifier and Type | Method and Description |
|---|---|
Compass |
clone()
Returns a clone of this compass.
|
boolean |
containsPoint(float x,
float y,
float margin)
Returns
true if the disc of this compass contains
the point at (x, y)
with a given margin. |
float |
getDiameter()
Returns the diameter of this compass.
|
float |
getLatitude()
Returns the latitude of this compass in radians.
|
float |
getLongitude()
Returns the longitude of this compass in radians.
|
float |
getNorthDirection()
Returns the North direction angle of this compass in radians.
|
float[][] |
getPoints()
Returns the corner points of the square that contains compass disc.
|
float |
getSunAzimuth(long date)
Returns the azimuth angle of the Sun in the sky in radians at a given
date in milliseconds since the Epoch. |
float |
getSunElevation(long date)
Returns the elevation angle of the Sun in the sky in radians at a given
date in milliseconds since the Epoch. |
java.lang.String |
getTimeZone()
Returns the time zone identifier of this compass.
|
float |
getX()
Returns the abscissa of the center of this compass.
|
float |
getY()
Returns the ordinate of the center of this compass.
|
boolean |
intersectsRectangle(float x0,
float y0,
float x1,
float 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). |
boolean |
isVisible()
Returns
true if this compass is visible. |
void |
move(float dx,
float dy)
Moves this compass of (
dx, dy) units. |
void |
setDiameter(float diameter)
Sets the diameter of this compass.
|
void |
setLatitude(float latitude)
Sets the latitude of this compass.
|
void |
setLongitude(float longitude)
Sets the longitude of the center of this compass.
|
void |
setNorthDirection(float northDirection)
Sets the North direction angle of this compass.
|
void |
setTimeZone(java.lang.String timeZone)
Sets the time zone identifier of this compass.
|
void |
setVisible(boolean visible)
Sets whether this compass is visible or not.
|
void |
setX(float x)
Sets the abscissa of the center of this compass.
|
void |
setY(float y)
Sets the ordinate of the center of this compass.
|
addPropertyChangeListener, addPropertyChangeListener, createId, duplicate, firePropertyChange, getContentProperty, getId, getProperty, getPropertyNames, isContentProperty, removePropertyChangeListener, removePropertyChangeListener, setProperty, setPropertypublic Compass(float x,
float y,
float diameter)
public Compass(java.lang.String id,
float x,
float y,
float diameter)
public float getX()
public void setX(float x)
public float getY()
public void setY(float y)
public float getDiameter()
public void setDiameter(float diameter)
public boolean isVisible()
true if this compass is visible.public void setVisible(boolean visible)
public float getNorthDirection()
public void setNorthDirection(float northDirection)
public final float getLatitude()
public void setLatitude(float latitude)
public final float getLongitude()
public void setLongitude(float longitude)
public java.lang.String getTimeZone()
TimeZonepublic void setTimeZone(java.lang.String timeZone)
java.lang.IllegalArgumentException - if timeZone is null or contains an unknown identifier.TimeZonepublic float[][] getPoints()
getPoints in interface Selectablepublic boolean intersectsRectangle(float x0,
float y0,
float x1,
float y1)
true if the disc of this compass 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 the disc of this compass contains
the point at (x, y)
with a given margin.containsPoint in interface Selectablepublic void move(float dx,
float dy)
dx, dy) units.move in interface Selectablepublic Compass clone()
clone in interface Selectableclone in class HomeObjectpublic float getSunElevation(long date)
date in milliseconds since the Epoch.
See Sun
azimuth and elevation angles for more information.public float getSunAzimuth(long date)
date in milliseconds since the Epoch.
See Sun
azimuth and elevation angles for more information.

© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License