Class 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 capitalised
      static 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 concatenate​(java.lang.String split, java.lang.String... strs)
      Concatenates the strings using the given split
      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 trueCapitalise​(java.lang.String line)
      Returns the given string with the first letter capitalised and all the others in lower case
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextUtils

        public TextUtils()
    • Method Detail

      • 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 split
        strs - 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()