Package org.jjazz.uiutilities.api
Class StringMetrics
java.lang.Object
org.jjazz.uiutilities.api.StringMetrics
Compute string metrics.
Try to cache data whenever possible.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
get the height of this text, including the leading (interline space).double
getHeightNoLeading
(String text) Get the height of this text, excluding the leading (interline space).getLogicalBounds
(String text) Return a rectangle in baseline relative coordinates, include the leading (interline spacing).Return a rectangle in baseline relative coordinates, excluding the leading (interline spacing).Return a rectangle in baseline relative coordinates, excluding the descent and the leading (interline spacing).double
-
Constructor Details
-
StringMetrics
-
StringMetrics
-
-
Method Details
-
getLogicalBounds
Return a rectangle in baseline relative coordinates, include the leading (interline spacing).If this method is called several times with the same text, the cached result is returned.
- Parameters:
text
-- Returns:
-
getLogicalBoundsNoLeading
Return a rectangle in baseline relative coordinates, excluding the leading (interline spacing).If this method is called several times with the same text, the cached result is returned.
- Parameters:
text
-- Returns:
-
getLogicalBoundsNoLeadingNoDescent
Return a rectangle in baseline relative coordinates, excluding the descent and the leading (interline spacing).See LineMetrics or FontMetrics for more info about descent/leading.
If this method is called several times with the same text, the cached result is returned.
- Parameters:
text
-- Returns:
-
getWidth
-
getHeight
get the height of this text, including the leading (interline space).- Parameters:
text
-- Returns:
-
getHeightNoLeading
Get the height of this text, excluding the leading (interline space).- Parameters:
text
-- Returns:
-