public class ContentsCreatorUtils extends Object
ContentsCreatorPageSegmentBuilder
. Methods in this class are static, therefore it is not
possible to instantiate objects of this class.Modifier and Type | Method and Description |
---|---|
static Dimension2D |
calculateTextBounds(String text,
ContentsCreatorControls contentsCreatorControls)
Calculates and returns the bound for the given text using the given
ContentsCreatorControls . |
static Rectangle2D |
calculateTextDimensions(String text,
ContentsCreatorControls contentsCreatorControls)
Calculates and returns the visual bounds of the given text rendered with the
ContentsCreatorTextSettings retrieved from the given cc. |
public static Rectangle2D calculateTextDimensions(String text, ContentsCreatorControls contentsCreatorControls)
ContentsCreatorTextSettings
retrieved from the given cc.
ContentsCreatorTransformationSettings
contained in the ContentsCreatorControls
are not considered when calculating the visual bounds.text
- the String to calculate the size for if it was rendered with the
ContentsCreatorTextSettings
contained in the ContentsCreatorControls
contentsCreatorControls
- the ContentsCreatorControls
containing the
ContentsCreatorTextSettings
defining how to render the text given.ContentsCreatorTextSettings
public static Dimension2D calculateTextBounds(String text, ContentsCreatorControls contentsCreatorControls)
ContentsCreatorControls
. The Rectangle2D
returned is a rectangle which completely
encloses the rendered text. Note that there is no guarantee that the returned Rectangle is the
smallest box that encloses the rendered text, only that the rendered text lies entirely within
the indicated Rectangle. The returned Rectangle might also fail to completely enclose the
rendered text if the VisualElement overflows the limited range of the integer data type. This
method also considers the ContentsCreatorTransformationSettings
contained in the
ContentsCreatorControls
.text
- the String to calculate the size for if it was rendered with the
ContentsCreatorTextSettings
contained in the ContentsCreatorControls
contentsCreatorControls
- the ContentsCreatorControls
containing the
ContentsCreatorTextSettings
defining how to render the text given.Rectangle2D
enclosing the text rendered based on the given
ContentsCreatorControls
with the limitations explained in this JavaDoc-comment.Copyright © 2024 levigo holding gmbh. All rights reserved.