Class TLcdLabelPlacement
java.lang.Object
com.luciad.view.labeling.algorithm.TLcdLabelPlacement
- All Implemented Interfaces:
ILcdCloneable
,Cloneable
A label placement defines a location of a label. This location is specified by a
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.
- Since:
- 10.1
-
Constructor Summary
ConstructorDescriptionCreates a newTLcdLabelPlacement
for the given label. -
Method Summary
Modifier and TypeMethodDescriptionclone()
MakesObject.clone()
public.double
Returns the cached cosine value of the rotation in this label placement.int
Returns the height.getLabel()
Returns the label of this label placement.Returns the label location set in this label placement.Returns a map that can be used to store and retrieve info properties using a String key.double
Returns the rotation of the label bounds in radians, clockwise, 0 radians at 3 o'clock.double
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
Returns if thisTLcdLabelPlacement
is visible.void
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 totrue
to mark thisTLcdLabelPlacement
as visible and tofalse
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).
-
Constructor Details
-
TLcdLabelPlacement
Creates a newTLcdLabelPlacement
for the given label.- Parameters:
aLabel
- the label for which this placement is created.
-
-
Method Details
-
getLabel
Returns the label of this label placement.- Returns:
- the label of this label placement.
-
getLabelLocation
Returns the label location set in this label placement.- Returns:
- the label location set in this label placement.
-
setLabelLocation
Sets the label location of this label placement.- Parameters:
aLabelLocation
- the label location of this label placement.
-
getX
public int getX()Returns x.- Returns:
- x.
- See Also:
-
setX
public void setX(int aX) Sets the x-coordinate of the upper left corner of this label placement, expressed in view coordinates (pixels).- Parameters:
aX
- The x.
-
getY
public int getY()Returns y.- Returns:
- y.
- See Also:
-
setY
public void setY(int aY) Sets the y-coordinate of the upper left corner of this label placement, expressed in view coordinates (pixels).- Parameters:
aY
- The y.
-
getWidth
public int getWidth()Returns the width.- Returns:
- the width.
- See Also:
-
setWidth
public void setWidth(int aWidth) Sets the width of this label placement, expressed in view coordinates (pixels).- Parameters:
aWidth
- The width.
-
getHeight
public int getHeight()Returns the height.- Returns:
- the height.
- See Also:
-
setHeight
public void setHeight(int aHeight) Sets the height of this label placement, expressed in view coordinates (pixels).- Parameters:
aHeight
- The height.
-
getRotation
public double getRotation()Returns the rotation of the label bounds in radians, clockwise, 0 radians at 3 o'clock.- Returns:
- the rotation of the label bounds.
- See Also:
-
setRotation
public void setRotation(double aRotation) Sets the orientation of the rectangle in radians, clockwise, 0 radians at 3 o'clock.- Parameters:
aRotation
- The rotation of the label bounds.
-
setBounds
Sets bounds of this label placement to the given bounds.- Parameters:
aBoundsRectangle
- the bounds rectangle.aRotation
- the orientation of the rectangle in RADIANs, clockwise, 0 radians at 3 o'clock.
-
isVisible
public boolean isVisible()Returns if thisTLcdLabelPlacement
is visible.- Returns:
- if this
TLcdLabelPlacement
is visible. - See Also:
-
setVisible
public void setVisible(boolean aVisible) Set totrue
to mark thisTLcdLabelPlacement
as visible and tofalse
to mark it as invisible. Setting this field tofalse
denotes that the label location should be stored, but not marked as to-be-painted.The default value is
true
.- Parameters:
aVisible
-true
to mark thisTLcdLabelPlacement
as visible and tofalse
to mark it as invisible.
-
getProperties
Returns a map that can be used to store and retrieve info properties using a String key.- Returns:
- a map that can be used to store and retrieve info properties using a String key.
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.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 ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-
getCosRotation
public double getCosRotation()Returns the cached cosine value of the rotation in this label placement.- Returns:
- the cached cosine value of the rotation in this label placement.
-
getSinRotation
public double getSinRotation()Returns the cached sine value of the rotation in this label placement.- Returns:
- the cached sine value of the rotation in this label placement.
-