Class PropertyParser


  • public class PropertyParser
    extends Object
    A Utility class for parsing particular Strings into particular types of object. Used primarily with preferences and user options.
    • Method Detail

      • getPaint

        public static Paint getPaint​(String text,
                                     Paint def)
        Convert the specified string into a Paint
        Parameters:
        text - the string
        def - the default value
      • getColor

        public static Color getColor​(String text,
                                     Color def)
        Convert the specified string into a Color
        Parameters:
        text - the string
        def - the default value
      • getHighlightType

        public static int getHighlightType​(String text,
                                           int def)
        Convert the specified string into a highlight (eg TextSelection.TYPE_BLOCK)
        Parameters:
        text - the string
        def - the default value
      • getStroke

        public static Stroke getStroke​(String text,
                                       Stroke def)
        Convert the specified string into a Stroke
        Parameters:
        text - the string
        def - the default value
      • getMargin

        public static float getMargin​(String text,
                                      float def)
        Convert the specified string into a margin;
        Parameters:
        text - the string
        def - the default value