Class MapHelper


  • public class MapHelper
    extends Object
    • Constructor Detail

      • MapHelper

        public MapHelper()
    • Method Detail

      • createBorderMap

        public static org.json.JSONObject createBorderMap​(String borderValue)
        map odf border strings to JSON border object see Changes API Border
      • isColor

        public static boolean isColor​(String color)
      • mapColor

        public static boolean mapColor​(org.json.JSONObject border,
                                       String width)
      • mapStyle

        public static boolean mapStyle​(org.json.JSONObject border,
                                       String style)
                                throws org.json.JSONException
        Throws:
        org.json.JSONException
      • createColorMap

        public static Map<String,​String> createColorMap​(String rgbValue)
        see Changes API Color
      • mapWidth

        public static boolean mapWidth​(org.json.JSONObject border,
                                       String widthString,
                                       String[] tokens)
        auto normal bold thin medium thick
      • normalizeLength

        public static int normalizeLength​(String value)
        Currently the normalized length is 100th millimeter (or 10 micrometer)
      • mapProperties

        public static org.json.JSONObject mapProperties​(String styleFamilyGroup,
                                                        Map<String,​String> odfProps)
      • mapFoTextAlign

        public static String mapFoTextAlign​(String propValue)
      • dateToDouble

        public static Double dateToDouble​(Object value)
      • timeToDouble

        public static Double timeToDouble​(Object value)
      • putNumberFormat

        public static boolean putNumberFormat​(Map<String,​Object> jsonStyleProperties,
                                              Map<String,​Map<String,​String>> stringProperties,
                                              OdfStyle autoStyle,
                                              OdfStylesBase autoStyles,
                                              OdfStylesBase officeStyles)
        get number format attribute via data-style-name attribute from one of the different number format style elements either from office styles or automatic styles names are (implicitly!) unique so it can only be found in one of the two containers
        Parameters:
        jsonStyleProperties -
        stringProperties -
        autoStyle -
        autoStyles - auto style interface, is allowed to b null
        officeStyles - should always be set
        Returns:
      • removeQuotedAndColor

        public static String removeQuotedAndColor​(String compareCode)
      • findOrCreateDataStyle

        public static String findOrCreateDataStyle​(String code,
                                                   long id,
                                                   OdfFileDom fileDom)
      • getLocaleFromLangCode

        public static String getLocaleFromLangCode​(String languageCode)
        converts a language code from a string and interpretes the number as hex value and returns the a locale or null if either the format is wrong or no locale is known
      • getMSLangCode

        public static String getMSLangCode​(String language,
                                           String country)
        converts locale information to a hex value string but without a hex marker like '0x' returns null if no value can be found
      • moveParaToCell

        public static void moveParaToCell​(Map<String,​Object> allHardFormatting)