Class TextFormatter
java.lang.Object
org.strassburger.tui4j.formatting.TextFormatter
Deprecated.
Format text with color codes and position text in the terminal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringDeprecated.Center text in the terminalstatic StringDeprecated.Center text in the terminalstatic StringclearFormatting(String text) Deprecated.Clear formatting from textstatic StringDeprecated.Format text with color codesstatic StringDeprecated.Add an HSL gradient to textstatic <T extends org.strassburger.colorlab4j.color.Color>
StringDeprecated.Add an HSL gradient to textstatic <T extends org.strassburger.colorlab4j.color.Color,U extends org.strassburger.colorlab4j.gradients.Gradient<T>>
StringDeprecated.Add a gradient to textstatic StringspaceBetween(String text1, String text2) Deprecated.Add spaces between two textsstatic StringspaceBetween(String text1, String text2, String spaceChar) Deprecated.Add spaces between two textsstatic StringspaceBetween(String text1, String text2, String spaceChar, int terminalWidth) Deprecated.Add spaces between two texts Add spaces between two texts
-
Constructor Details
-
TextFormatter
public TextFormatter()Deprecated.
-
-
Method Details
-
format
Deprecated.Format text with color codes- Parameters:
text- Text with color codes- Returns:
- Formatted text
-
center
Deprecated.Center text in the terminal- Parameters:
text- Text to center (allows color codes)- Returns:
- Centered text
-
center
Deprecated.Center text in the terminal- Parameters:
text- Text to center (allows color codes)terminalWidth- Width of the terminal- Returns:
- Centered text
-
spaceBetween
Deprecated.Add spaces between two texts- Parameters:
text1- First text (allows color codes)text2- Second text (allows color codes)- Returns:
- Text with spaces between
-
spaceBetween
Deprecated.Add spaces between two texts- Parameters:
text1- First text (allows color codes)text2- Second text (allows color codes)spaceChar- Character to use for spaces (allows color codes)- Returns:
- Text with spaces between
-
spaceBetween
Deprecated.Add spaces between two texts Add spaces between two texts- Parameters:
text1- First text (allows color codes)text2- Second text (allows color codes)spaceChar- Character to use for spaces (allows color codes)terminalWidth- Width of the terminal- Returns:
- Text with spaces between
-
clearFormatting
Deprecated.Clear formatting from text- Parameters:
text- Text with color codes- Returns:
- Text without color codes
-
gradient
Deprecated.Add an HSL gradient to text- Parameters:
text- Text to add gradient tostartColor- Start color of the gradientendColor- End color of the gradient- Returns:
- The text formatted with an HSL gradient
-
gradient
public static <T extends org.strassburger.colorlab4j.color.Color> String gradient(String text, T startColor, T endColor) Deprecated.Add an HSL gradient to text- Parameters:
text- Text to add gradient tostartColor- Start color of the gradientendColor- End color of the gradient- Returns:
- The text formatted with an HSL gradient
-
gradient
public static <T extends org.strassburger.colorlab4j.color.Color,U extends org.strassburger.colorlab4j.gradients.Gradient<T>> String gradient(String text, U gradient) Deprecated.Add a gradient to text- Parameters:
text- Text to add gradient togradient- Gradient to apply- Returns:
- The text formatted with a gradient
-
StyledTextandPrinterinstead