Package gaiasky.util
Class TextUtils
- java.lang.Object
-
- gaiasky.util.TextUtils
-
public class TextUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TextUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
arrayToStr(java.lang.String[] arr)
static java.lang.String
capitalise(java.lang.String line)
Returns the given string with the first letter capitalisedstatic void
capLabelWidth(com.badlogic.gdx.scenes.scene2d.ui.Label l, float targetWidth)
static java.lang.String
capString(java.lang.String in, int targetLength)
static java.lang.String
capString(java.lang.String in, int targetLength, boolean fromStart)
static java.lang.String[]
concatAll(java.lang.String base, java.lang.String[] suffixes)
Concatenates the base with each of the strings in suffixesstatic java.lang.String[]
concatAll(java.lang.String base, java.lang.String[] suffixes, java.lang.String suffixAdditional)
static java.lang.String
concatenate(java.lang.String split, com.badlogic.gdx.utils.Array<java.lang.String> strs)
Concatenates the strings using the given splitstatic java.lang.String
concatenate(java.lang.String split, java.lang.String... strs)
Concatenates the strings using the given splitstatic boolean
contains(java.lang.String[] list, java.lang.String key)
static boolean
contains(java.lang.String[] list, java.lang.String key, boolean ignoreCase)
static java.lang.String
getFormattedTimeWarp()
static java.lang.String
getFormattedTimeWarp(double warp)
static java.lang.CharSequence
limitWidth(java.lang.CharSequence text, float width, float letterWidth)
static java.lang.String
propertyToMethodName(java.lang.String property)
Converts from property displayName to method displayName by removing the separator dots and capitalising each chunk.static java.lang.String
surround(java.lang.String in, java.lang.String pre, java.lang.String post)
static java.lang.String
trueCapitalise(java.lang.String line)
Returns the given string with the first letter capitalised and all the others in lower case
-
-
-
Method Detail
-
surround
public static java.lang.String surround(java.lang.String in, java.lang.String pre, java.lang.String post)
-
capLabelWidth
public static void capLabelWidth(com.badlogic.gdx.scenes.scene2d.ui.Label l, float targetWidth)
-
limitWidth
public static java.lang.CharSequence limitWidth(java.lang.CharSequence text, float width, float letterWidth)
-
capString
public static java.lang.String capString(java.lang.String in, int targetLength)
-
capString
public static java.lang.String capString(java.lang.String in, int targetLength, boolean fromStart)
-
propertyToMethodName
public static java.lang.String propertyToMethodName(java.lang.String property)
Converts from property displayName to method displayName by removing the separator dots and capitalising each chunk. Example: model.texture.bump -> ModelTextureBump- Parameters:
property
- The property displayName- Returns:
- The method name
-
capitalise
public static java.lang.String capitalise(java.lang.String line)
Returns the given string with the first letter capitalised- Parameters:
line
- The input string- Returns:
- The string with its first letter capitalised
-
trueCapitalise
public static java.lang.String trueCapitalise(java.lang.String line)
Returns the given string with the first letter capitalised and all the others in lower case- Parameters:
line
- The input string- Returns:
- The string with its first letter capitalised and the others in lower case
-
concatenate
public static java.lang.String concatenate(java.lang.String split, java.lang.String... strs)
Concatenates the strings using the given split- Parameters:
split
- The splitstrs
- The strings- Returns:
- The concatenation
-
concatenate
public static java.lang.String concatenate(java.lang.String split, com.badlogic.gdx.utils.Array<java.lang.String> strs)
Concatenates the strings using the given split- Parameters:
split
- The splitstrs
- The strings- Returns:
- The concatenation
-
arrayToStr
public static java.lang.String arrayToStr(java.lang.String[] arr)
-
getFormattedTimeWarp
public static java.lang.String getFormattedTimeWarp(double warp)
-
getFormattedTimeWarp
public static java.lang.String getFormattedTimeWarp()
-
concatAll
public static java.lang.String[] concatAll(java.lang.String base, java.lang.String[] suffixes)
Concatenates the base with each of the strings in suffixes- Parameters:
base
- The base stringsuffixes
- All the suffixes- Returns:
- The result
-
concatAll
public static java.lang.String[] concatAll(java.lang.String base, java.lang.String[] suffixes, java.lang.String suffixAdditional)
-
contains
public static boolean contains(java.lang.String[] list, java.lang.String key)
-
contains
public static boolean contains(java.lang.String[] list, java.lang.String key, boolean ignoreCase)
-
-