public class Label extends HomeObject implements Selectable, Elevatable
Modifier and Type | Class and Description |
---|---|
static class |
Label.Property
The properties of a label that may change.
|
Constructor and Description |
---|
Label(java.lang.String text,
float x,
float y)
Creates a label with the given
text . |
Label(java.lang.String id,
java.lang.String text,
float x,
float y)
Creates a label with the given
text . |
Modifier and Type | Method and Description |
---|---|
Label |
clone()
Returns a clone of this label.
|
boolean |
containsPoint(float x,
float y,
float margin)
Returns
true if this text is at the point at (x , y )
with a given margin . |
float |
getAngle()
Returns the angle in radians around vertical axis used to display this label.
|
java.lang.Integer |
getColor()
Returns the color used to display the text of this label.
|
float |
getElevation()
Returns the elevation of this label on its level.
|
float |
getGroundElevation()
Returns the elevation of this label
from the ground according to the elevation of its level.
|
Level |
getLevel()
Returns the level which this label belongs to.
|
java.lang.Integer |
getOutlineColor()
Returns the color used to outline the text of this label.
|
java.lang.Float |
getPitch()
Returns the pitch angle in radians used to rotate this label around horizontal axis in 3D.
|
float[][] |
getPoints()
Returns the point of this label.
|
TextStyle |
getStyle()
Returns the style used to display the text of this label.
|
java.lang.String |
getText()
Returns the text of this label.
|
float |
getX()
Returns the abscissa of the text of this label.
|
float |
getY()
Returns the ordinate of the text of this label.
|
boolean |
intersectsRectangle(float x0,
float y0,
float x1,
float 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 ). |
boolean |
isAtLevel(Level 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. |
void |
move(float dx,
float dy)
Moves this label of (
dx , dy ) units. |
void |
setAngle(float angle)
Sets the angle in radians around vertical axis used to display this label.
|
void |
setColor(java.lang.Integer color)
Sets the color used to display the text of this label.
|
void |
setElevation(float elevation)
Sets the elevation of this label on its level.
|
void |
setLevel(Level level)
Sets the level of this label.
|
void |
setOutlineColor(java.lang.Integer outlineColor)
Sets the color used to outline the text of this label.
|
void |
setPitch(java.lang.Float pitch)
Sets the angle in radians used to rotate this label around horizontal axis in 3D.
|
void |
setStyle(TextStyle style)
Sets the style used to display the text of this label.
|
void |
setText(java.lang.String text)
Sets the text of this label.
|
void |
setX(float x)
Sets the abscissa of the text of this label.
|
void |
setY(float y)
Sets the ordinate of the text of this label.
|
addPropertyChangeListener, addPropertyChangeListener, createId, duplicate, firePropertyChange, getContentProperty, getId, getProperty, getPropertyNames, isContentProperty, removePropertyChangeListener, removePropertyChangeListener, setProperty, setProperty
public Label(java.lang.String text, float x, float y)
text
.public Label(java.lang.String id, java.lang.String text, float x, float y)
text
.public java.lang.String getText()
public void setText(java.lang.String text)
public float getX()
public void setX(float x)
public float getY()
public void setY(float y)
public float getGroundElevation()
public float getElevation()
getPitch()
public void setElevation(float elevation)
public TextStyle getStyle()
public void setStyle(TextStyle style)
public java.lang.Integer getColor()
public void setColor(java.lang.Integer color)
public java.lang.Integer getOutlineColor()
public void setOutlineColor(java.lang.Integer outlineColor)
public float getAngle()
public void setAngle(float angle)
public java.lang.Float getPitch()
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.public void setPitch(java.lang.Float pitch)
public Level getLevel()
getLevel
in interface Elevatable
public void setLevel(Level level)
public boolean isAtLevel(Level level)
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.isAtLevel
in interface Elevatable
public float[][] getPoints()
getPoints
in interface Selectable
public boolean intersectsRectangle(float x0, float y0, float x1, float y1)
true
if the point of this label is contained
in 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 text is at the point at (x
, y
)
with a given margin
.containsPoint
in interface Selectable
public void move(float dx, float dy)
dx
, dy
) units.move
in interface Selectable
public Label clone()
clone
in interface Selectable
clone
in class HomeObject
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License