Package com.storedobject.svg
Class Text
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdjusts the width of the text element by applying spacing-based adjustments.voidAdjusts the width of the text element by applying spacing and glyph-based adjustments.protected StringRetrieves a string representation of the node's attributes.charWidth(double width) Sets the width of a single character for the text element and returns the current instance.displayHeight(double height) Sets the display height for the text element and returns the current instance.getText()Get the text.doublegetX()Retrieves the X coordinate.doublegetY()Retrieves the Y coordinate.protected StringRetrieves the inner content of the node.static TextCreate a text.Create a text.static TextCreate a text.voidRemoves any width adjustment applied to the text element.voidsetCharWidth(double width) Sets the width of a single character for the text element and marks the element as not built, requiring it to be rebuilt for rendering.voidsetDisplayHeight(double height) Sets the display height for the text element and marks the element as not built, requiring it to be rebuilt before rendering.Set the text.x(double x) Set the X coordinate.y(double y) Set the Y coordinate.Methods inherited from class com.storedobject.svg.Node
compute, copy, createDocument, equals, escapeXml, extraContent, flipHorizontally, flipHorizontallyAroundOrigin, flipVertically, flipVerticallyAroundOrigin, getCoordinates, getId, getMargin, getSvg, hashCode, id, ID, IDValue, moveTo, moveTo, rotate, rotateAround, rotateAround, rotateAroundCenter, scale, scale, scaleHeightTo, scaleTo, scaleWidthTo, toString, toString, transform, translate, translate
-
Constructor Details
-
Text
-
Text
Constructor.- Parameters:
x- X coordinate.y- Y coordinate.text- Text.
-
Text
-
Text
public Text()Constructor. -
Text
-
Text
public Text(double x, double y) Constructor.- Parameters:
x- X coordinate.y- Y coordinate.
-
-
Method Details
-
getX
-
getY
-
getText
-
adjustWidthWithSpacing
public void adjustWidthWithSpacing()Adjusts the width of the text element by applying spacing-based adjustments. Sets the width adjustment mode to spacing and marks the element as not built. -
adjustWidthWithSpacingAndGlyphs
public void adjustWidthWithSpacingAndGlyphs()Adjusts the width of the text element by applying spacing and glyph-based adjustments. Sets the width adjustment mode to glyph-based and marks the element as not built. -
removeWidthAdjustment
public void removeWidthAdjustment()Removes any width adjustment applied to the text element. Resets the width adjustment mode by clearing the adjustment character and marks the element as unbuilt, requiring rebuilding if rendered. -
setCharWidth
public void setCharWidth(double width) Sets the width of a single character for the text element and marks the element as not built, requiring it to be rebuilt for rendering.- Parameters:
width- The width of a single character.
-
charWidth
Sets the width of a single character for the text element and returns the current instance. The text element will be marked as not built, requiring it to be rebuilt before rendering.- Parameters:
width- The width to set for a single character.- Returns:
- The current instance of the
Textobject.
-
setDisplayHeight
public void setDisplayHeight(double height) Sets the display height for the text element and marks the element as not built, requiring it to be rebuilt before rendering.- Parameters:
height- The height to set for the text element.
-
displayHeight
Sets the display height for the text element and returns the current instance. The text element will be marked as not built, requiring it to be rebuilt before rendering.- Parameters:
height- The height to set for the text element.- Returns:
- The current instance of the
Textobject.
-
of
-
of
-
of
-
x
-
y
-
text
-
innerContent
Description copied from class:NodeRetrieves the inner content of the node. This method is typically implemented or overridden by subclasses to provide specific content representing the inner state or structure of the node.- Overrides:
innerContentin classNode<Text>- Returns:
- A string containing the inner content of the node, or null if no content is defined.
-
attributes
Description copied from class:NodeRetrieves a string representation of the node's attributes. This method is typically overridden by subclasses to provide specific attributes corresponding to the node's state or properties. By default, this method returns null if no attributes are defined.- Overrides:
attributesin classNode<Text>- Returns:
- A string representing the attributes of the node, or null if no attributes are defined.
-