|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jeuclid.elements.support.text.StringUtil
public final class StringUtil
Utilities for String handling.
| Nested Class Summary | |
|---|---|
static class |
StringUtil.TextLayoutInfo
Contains layout information retrieved from a TextLayout. |
| Field Summary | |
|---|---|
static boolean |
OSX
Set to true if we're running under Mac OS X. |
| Method Summary | |
|---|---|
static AttributedString |
convertStringtoAttributedString(String inputString,
MathVariant baseVariant,
float fontSize,
LayoutContext context)
Converts a given String to an attributed string with the proper variants set. |
static int |
countDisplayableCharacters(String s)
Counts the displayable characters only. |
static TextLayout |
createTextLayoutFromAttributedString(Graphics2D g,
AttributedString aString,
LayoutContext context)
Safely creates a Text Layout from an attributed string. |
static StringUtil.TextLayoutInfo |
getTextLayoutInfo(TextLayout textLayout,
boolean trim)
Retrieve the actual layout information from a textLayout. |
static float |
getWidthForTextLayout(TextLayout layout)
Retrieves the real width from a given text layout. |
static AttributedCharacterIterator |
textContentAsAttributedCharacterIterator(LayoutContext contextNow,
JEuclidElement contextElement,
Node node,
float corrector)
Provide the text content of the current element as AttributedCharacterIterator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean OSX
| Method Detail |
|---|
public static AttributedString convertStringtoAttributedString(String inputString,
MathVariant baseVariant,
float fontSize,
LayoutContext context)
inputString - the string to convert.baseVariant - variant to base on for regular charactersfontSize - size of Font to use.context - Layout Context to use.
public static AttributedCharacterIterator textContentAsAttributedCharacterIterator(LayoutContext contextNow,
JEuclidElement contextElement,
Node node,
float corrector)
contextNow - LayoutContext of the parent element.contextElement - Parent Element.node - Current node.corrector - Font-size corrector.
AttributedCharacterIterator over the text contents.
public static TextLayout createTextLayoutFromAttributedString(Graphics2D g,
AttributedString aString,
LayoutContext context)
g - Graphics context.aString - an Attributed Stringcontext - Layout Context to use.
public static float getWidthForTextLayout(TextLayout layout)
layout - the textlayout
public static StringUtil.TextLayoutInfo getTextLayoutInfo(TextLayout textLayout,
boolean trim)
textLayout - TextLayout to look at.trim - Trim to actual content
public static int countDisplayableCharacters(@Nullable
String s)
s - string to count length of.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||