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
ConstructorsConstructorDescriptionCreates a newTLcdLabelPlacementfor the given label. -
Method Summary
Modifier and TypeMethodDescriptionclone()MakesObject.clone()public.doubleReturns the cached cosine value of the rotation in this label placement.intReturns 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.doubleReturns the rotation of the label bounds in radians, clockwise, 0 radians at 3 o'clock.doubleReturns the cached sine value of the rotation in this label placement.intgetWidth()Returns the width.intgetX()Returns x.intgetY()Returns y.booleanReturns if thisTLcdLabelPlacementis visible.voidSets bounds of this label placement to the given bounds.voidsetHeight(int aHeight) Sets the height of this label placement, expressed in view coordinates (pixels).voidsetLabelLocation(TLcdLabelLocation aLabelLocation) Sets the label location of this label placement.voidsetRotation(double aRotation) Sets the orientation of the rectangle in radians, clockwise, 0 radians at 3 o'clock.voidsetVisible(boolean aVisible) Set totrueto mark thisTLcdLabelPlacementas visible and tofalseto mark it as invisible.voidsetWidth(int aWidth) Sets the width of this label placement, expressed in view coordinates (pixels).voidsetX(int aX) Sets the x-coordinate of the upper left corner of this label placement, expressed in view coordinates (pixels).voidsetY(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 newTLcdLabelPlacementfor 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 thisTLcdLabelPlacementis visible.- Returns:
- if this
TLcdLabelPlacementis visible. - See Also:
-
setVisible
public void setVisible(boolean aVisible) Set totrueto mark thisTLcdLabelPlacementas visible and tofalseto mark it as invisible. Setting this field tofalsedenotes that the label location should be stored, but not marked as to-be-painted.The default value is
true.- Parameters:
aVisible-trueto mark thisTLcdLabelPlacementas visible and tofalseto 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:ILcdCloneableMakes
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:
clonein interfaceILcdCloneable- Overrides:
clonein 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.
-