Package docking.util
Class TextShaper
java.lang.Object
docking.util.TextShaper
A class that will layout text into lines based on the given display size. This class requires
the graphics context in order to correctly size the text.
-
Constructor Summary
ConstructorDescriptionTextShaper
(String text, Dimension displaySize, Graphics2D g2d) Creates a text shaper with the given text, display size and graphics context. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Renders the wrapped text into the graphics used to create this class.List
<docking.util.TextShaper.TextShaperLine> getLines()
Returns the bounds of the wrapped text of this classboolean
Returns true if the text is too large to fit in the original display size
-
Constructor Details
-
TextShaper
Creates a text shaper with the given text, display size and graphics context.- Parameters:
text
- the textdisplaySize
- the sizeg2d
- the graphics
-
-
Method Details
-
getTextSize
Returns the bounds of the wrapped text of this class- Returns:
- the bounds of the wrapped text of this class
-
isClipped
public boolean isClipped()Returns true if the text is too large to fit in the original display size- Returns:
- true if the text is too large to fit in the original display size
-
getLines
-
drawText
Renders the wrapped text into the graphics used to create this class.- Parameters:
g
- the graphics into which the text should be painted.
-