public class TLcdLabelPlacement extends Object implements ILcdCloneable
TLcdLabelLocation
, and label bounds.
The label bounds is a rotated rectangle expressed in view coordinates (pixels), see illustration.
It is possible to store other information in a label placement using getProperties()
. A
TLcdLabelPlacement
is always created for a specific TLcdCollectedLabelInfo
,
which is also stored inside this class.
Constructor and Description |
---|
TLcdLabelPlacement(TLcdCollectedLabelInfo aLabel)
Creates a new
TLcdLabelPlacement for the given label. |
Modifier and Type | Method and Description |
---|---|
TLcdLabelPlacement |
clone()
Makes
Object.clone() public. |
double |
getCosRotation()
Returns the cached cosine value of the rotation in this label placement.
|
int |
getHeight()
Returns the height.
|
TLcdCollectedLabelInfo |
getLabel()
Returns the label of this label placement.
|
TLcdLabelLocation |
getLabelLocation()
Returns the label location set in this label placement.
|
Map<String,Object> |
getProperties()
Returns a map that can be used to store and retrieve info properties using a String key.
|
double |
getRotation()
Returns the rotation of the label bounds in radians, clockwise, 0 radians at 3 o'clock.
|
double |
getSinRotation()
Returns the cached sine value of the rotation in this label placement.
|
int |
getWidth()
Returns the width.
|
int |
getX()
Returns x.
|
int |
getY()
Returns y.
|
boolean |
isVisible()
Returns if this
TLcdLabelPlacement is visible. |
void |
setBounds(Rectangle aBoundsRectangle,
double aRotation)
Sets bounds of this label placement to the given bounds.
|
void |
setHeight(int aHeight)
Sets the height of this label placement, expressed in view coordinates (pixels).
|
void |
setLabelLocation(TLcdLabelLocation aLabelLocation)
Sets the label location of this label placement.
|
void |
setRotation(double aRotation)
Sets the orientation of the rectangle in radians, clockwise, 0 radians at 3 o'clock.
|
void |
setVisible(boolean aVisible)
Set to
true to mark this TLcdLabelPlacement as visible and
to false to mark it as invisible. |
void |
setWidth(int aWidth)
Sets the width of this label placement, expressed in view coordinates (pixels).
|
void |
setX(int aX)
Sets the x-coordinate of the upper left corner of this label placement, expressed
in view coordinates (pixels).
|
void |
setY(int aY)
Sets the y-coordinate of the upper left corner of this label placement, expressed
in view coordinates (pixels).
|
public TLcdLabelPlacement(TLcdCollectedLabelInfo aLabel)
TLcdLabelPlacement
for the given label.aLabel
- the label for which this placement is created.public TLcdCollectedLabelInfo getLabel()
public TLcdLabelLocation getLabelLocation()
public void setLabelLocation(TLcdLabelLocation aLabelLocation)
aLabelLocation
- the label location of this label placement.public int getX()
setX(int)
public void setX(int aX)
aX
- The x.public int getY()
setY(int)
public void setY(int aY)
aY
- The y.public int getWidth()
setWidth(int)
public void setWidth(int aWidth)
aWidth
- The width.public int getHeight()
setHeight(int)
public void setHeight(int aHeight)
aHeight
- The height.public double getRotation()
setRotation(double)
public void setRotation(double aRotation)
aRotation
- The rotation of the label bounds.public void setBounds(Rectangle aBoundsRectangle, double aRotation)
aBoundsRectangle
- the bounds rectangle.aRotation
- the orientation of the rectangle in RADIANs, clockwise, 0
radians at 3 o'clock.public boolean isVisible()
TLcdLabelPlacement
is visible.TLcdLabelPlacement
is visible.setVisible(boolean)
public void setVisible(boolean aVisible)
true
to mark this TLcdLabelPlacement
as visible and
to false
to mark it as invisible. Setting this field to false
denotes that the label location should be stored, but not marked as to-be-painted.
The default value is true
.
aVisible
- true
to mark this TLcdLabelPlacement
as visible
and to false
to mark it as invisible.public Map<String,Object> getProperties()
public TLcdLabelPlacement clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public double getCosRotation()
public double getSinRotation()