Package com.luciad.format.s52
Class TLcdS52Text
java.lang.Object
com.luciad.format.s52.TLcdS52Text
- All Implemented Interfaces:
ILcdS52Text,ILcdAnchoredIcon,ILcdIcon,ILcdCloneable,Serializable,Cloneable
Representation of a text element in the S52 domain model.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidanchorPointSFCT(Point aPointSFCT) Updates the given point to the location of the icon's anchor point, in relative coordinates with respect to the top left.clone()MakesObject.clone()public.booleanintGets the attribute of this text objectintGets the size of the body for this text object.getFont()Gets the font used by this text objectintGets the horizontal justification for this text object.intReturns the fixed height of the icon.intReturns the fixed width of the icon.doubleGets the scale factor of this text object.getText()Gets the string representation of this text objectintGets the text group of this textintReturns the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).intGets the vertical justification for this text object.intGets the weight for this text.intGets the offset for this text object on the x-axisintGets the offset for this text object on the y-axisinthashCode()voidDraw theILcdIconat the specified location.voidsetAttribute(int aAttribute) Sets the attribute of this text objectvoidsetBodySize(int aBodySize) Sets the size of the body for this text object.voidSets the color for this text.static voidsetColorProvider(ILcdS52ColorProvider aColorProvider) Deprecated.This method should no longer be used.voidsetHorizontalJustification(int aHorizontalJustification) Sets the horizontal justification for this text object.voidsetSpace(int aSpace) Sets the spacing of this textvoidsetStyle(int aStyle) Sets the style of this textvoidSets the string representation of this text objectvoidsetTextGroup(int aTextGroup) Sets the text group of this textvoidsetTextType(int aType) Sets the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).voidsetVerticalJustification(int aVerticalJustification) Sets the vertical justification for this text object.voidsetWeight(int aWeight) Sets the weight for this text.voidsetWidth(int aWidth) Sets the width of the characters in this text.voidsetXOffset(int aXOffset) Sets the offset for this text object on the x-axisvoidsetYOffset(int aYOffset) Sets the offset for this text object on the y-axistoString()
-
Field Details
-
HJUST_CENTRE
public static final int HJUST_CENTRE- See Also:
-
HJUST_RIGHT
public static final int HJUST_RIGHT- See Also:
-
HJUST_LEFT
public static final int HJUST_LEFT- See Also:
-
VJUST_BOTTOM
public static final int VJUST_BOTTOM- See Also:
-
VJUST_CENTRE
public static final int VJUST_CENTRE- See Also:
-
VJUST_TOP
public static final int VJUST_TOP- See Also:
-
WEIGHT_LIGHT
public static final int WEIGHT_LIGHT- See Also:
-
WEIGHT_MEDIUM
public static final int WEIGHT_MEDIUM- See Also:
-
WEIGHT_BOLD
public static final int WEIGHT_BOLD- See Also:
-
WIDTH_PLAIN
public static final int WIDTH_PLAIN- See Also:
-
WIDTH_ITALIC
public static final int WIDTH_ITALIC- See Also:
-
TEXT_TYPE_TX
public static final int TEXT_TYPE_TX- See Also:
-
TEXT_TYPE_TE
public static final int TEXT_TYPE_TE- See Also:
-
-
Constructor Details
-
TLcdS52Text
public TLcdS52Text()Creates a new, emptyTLcdS52Text.
-
-
Method Details
-
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:
-
setColorProvider
Deprecated.This method should no longer be used.- Parameters:
aColorProvider-
-
anchorPointSFCT
Description copied from interface:ILcdAnchoredIconUpdates the given point to the location of the icon's anchor point, in relative coordinates with respect to the top left. The x-coordinate of the anchor point typically lies between 0 and getWidth(). The y-coordinate typically lies between 0 and getHeight().- Specified by:
anchorPointSFCTin interfaceILcdAnchoredIcon- Parameters:
aPointSFCT- the point that has to be moved to the location of the anchor point of this icon.
-
getIconHeight
public int getIconHeight()Description copied from interface:ILcdIconReturns the fixed height of the icon.- Specified by:
getIconHeightin interfaceILcdIcon- Returns:
- the fixed height of the icon.
-
getIconWidth
public int getIconWidth()Description copied from interface:ILcdIconReturns the fixed width of the icon.- Specified by:
getIconWidthin interfaceILcdIcon- Returns:
- the fixed width of the icon.
-
paintIcon
Description copied from interface:ILcdIconDraw theILcdIconat the specified location.ILcdIconimplementations may use theComponentargument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIconin interfaceILcdIcon- Parameters:
aComponent- a Component to retrieve properties from.aGraphics- the Graphics on which the icon will be painted.aX- the x position where the icon will be painted. x is the first coordinate of the top left corner point of the icon.aY- the y position where the icon will be painted. y is the second coordinate of the top left corner point of the icon.
-
getTextType
public int getTextType()Returns the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).- Returns:
- the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).
-
setTextType
public void setTextType(int aType) Sets the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).- Parameters:
aType- the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).
-
setAttribute
public void setAttribute(int aAttribute) Sets the attribute of this text object- Parameters:
aAttribute- the attribute of this text object
-
getAttribute
public int getAttribute()Gets the attribute of this text object- Specified by:
getAttributein interfaceILcdS52Text- Returns:
- the attribute
-
setColor
Sets the color for this text. The given string will be resolved by the color provider.- Parameters:
aColor- the color to set
-
setHorizontalJustification
public void setHorizontalJustification(int aHorizontalJustification) Sets the horizontal justification for this text object. This can be either HJUST_CENTRE(1), HJUST_RIGHT(2) or HJUST_LEFT(3).- Parameters:
aHorizontalJustification- the horizontal justification
-
setVerticalJustification
public void setVerticalJustification(int aVerticalJustification) Sets the vertical justification for this text object. This can be either VJUST_BOTTOM(1), VJUST_CENTRE(2) or VJUST_TOP(3).- Parameters:
aVerticalJustification- the vertical justification
-
setXOffset
public void setXOffset(int aXOffset) Sets the offset for this text object on the x-axis- Parameters:
aXOffset- the x-axis offset
-
setYOffset
public void setYOffset(int aYOffset) Sets the offset for this text object on the y-axis- Parameters:
aYOffset- the y-axis offset
-
setSpace
public void setSpace(int aSpace) Sets the spacing of this text- Parameters:
aSpace- the spacing
-
setBodySize
public void setBodySize(int aBodySize) Sets the size of the body for this text object. The size of the actual font in pixels will depend on a combination of the scale factor and this body size.- Parameters:
aBodySize- the body size of the text
-
setStyle
public void setStyle(int aStyle) Sets the style of this text- Parameters:
aStyle- the style of this text
-
setWeight
public void setWeight(int aWeight) Sets the weight for this text. This can be WEIGHT_LIGHT(4), WEIGHT_MEDIUM(5) or WEIGHT_BOLD(6).- Parameters:
aWeight- the weight of the text
-
setWidth
public void setWidth(int aWidth) Sets the width of the characters in this text. Can be either WIDTH_PLAIN(1) or WIDTH_ITALIC(2)- Parameters:
aWidth-
-
getText
Gets the string representation of this text object- Returns:
- the string representation of this text object
-
setText
Sets the string representation of this text object- Specified by:
setTextin interfaceILcdS52Text- Parameters:
aText- the string representation of this text object
-
getFont
Gets the font used by this text object- Returns:
- the font used by this text object
-
getHorizontalJustification
public int getHorizontalJustification()Gets the horizontal justification for this text object. This can be either HJUST_CENTRE(1), HJUST_RIGHT(2) or HJUST_LEFT(3).- Returns:
- the horizontal justification
-
getVerticalJustification
public int getVerticalJustification()Gets the vertical justification for this text object. This can be either VJUST_BOTTOM(1), VJUST_CENTRE(2) or VJUST_TOP(3).- Returns:
- the vertical justification
-
getXOffset
public int getXOffset()Gets the offset for this text object on the x-axis- Returns:
- the x-axis offset
-
getYOffset
public int getYOffset()Gets the offset for this text object on the y-axis- Returns:
- the y-axis offset
-
getBodySize
public int getBodySize()Gets the size of the body for this text object. The size of the actual font in pixels will depend on a combination of the scale factor and this body size.- Returns:
- the body size of the text
-
getWeight
public int getWeight()Gets the weight for this text. This can be WEIGHT_LIGHT(4), WEIGHT_MEDIUM(5) or WEIGHT_BOLD(6).- Returns:
- the weight of the text
-
getScaleFactor
public double getScaleFactor()Gets the scale factor of this text object. The scale factor determines how much the object is scaled. This value is used primarily to scale text objects to the correct size when using high-dpi devices or prints.- Returns:
- the scale factor
-
setTextGroup
public void setTextGroup(int aTextGroup) Sets the text group of this text- Parameters:
aTextGroup- the text group
-
getTextGroup
public int getTextGroup()Gets the text group of this text- Specified by:
getTextGroupin interfaceILcdS52Text- Returns:
- the text group
-
toString
-
equals
-
hashCode
public int hashCode()
-