Package org.odftoolkit.odfdom.changes
Class MapHelper
java.lang.Object
org.odftoolkit.odfdom.changes.MapHelper
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.json.JSONObject
createBorderMap
(String borderValue) map odf border strings to JSON border object see Changes API BordercreateColorMap
(String rgbValue) see Changes API Colorstatic Double
dateToDouble
(Object value) detectFormatType
(String code) static String
findOrCreateDataStyle
(String code, long id, OdfFileDom fileDom) 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 knowngetMappedStyleProperties
(OdfStyle style) 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 foundstatic void
getStyleProperties
(OdfStyleBase style, Map<String, OdfStylePropertiesSet> familyPropertyGroups, Map<String, Map<String, String>> allOdfProps) static void
getStyleProperties
(OdfStyleBase style, OdfStylableElement styleElement, Map<String, Map<String, String>> allOdfProps) static boolean
static boolean
static String
mapFoTextAlign
(String propValue) static org.json.JSONObject
mapProperties
(String styleFamilyGroup, Map<String, String> odfProps) static boolean
mapStyleProperties
(Map<String, OdfStylePropertiesSet> familyPropertyGroups, Map<String, Map<String, String>> allOdfProps) mapStyleProperties
(OdfStylableElement styleElement, Map<String, Map<String, String>> allOdfProps) static boolean
static void
moveParaToCell
(Map<String, Object> allHardFormatting) static int
normalizeLength
(String value) Currently the normalized length is 100th millimeter (or 10 micrometer)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!)static String
removeQuotedAndColor
(String compareCode) static Double
timeToDouble
(Object value)
-
Field Details
-
AUTO
- See Also:
-
NORMAL
- See Also:
-
BOLD
- See Also:
-
THIN
- See Also:
-
MEDIUM
- See Also:
-
THICK
- See Also:
-
HASH
- See Also:
-
TRANSPARENT
- See Also:
-
-
Constructor Details
-
MapHelper
public MapHelper()
-
-
Method Details
-
createBorderMap
map odf border strings to JSON border object see Changes API Border -
isColor
-
mapColor
-
mapStyle
public static boolean mapStyle(org.json.JSONObject border, String style) throws org.json.JSONException - Throws:
org.json.JSONException
-
createColorMap
see Changes API Color -
mapWidth
-
normalizeLength
Currently the normalized length is 100th millimeter (or 10 micrometer) -
mapProperties
-
mapFoTextAlign
-
mapStyleProperties
-
mapStyleProperties
-
getMappedStyleProperties
-
getStyleProperties
public static void getStyleProperties(OdfStyleBase style, OdfStylableElement styleElement, Map<String, Map<String, String>> allOdfProps) -
getStyleProperties
public static void getStyleProperties(OdfStyleBase style, Map<String, OdfStylePropertiesSet> familyPropertyGroups, Map<String, Map<String, String>> allOdfProps) -
dateToDouble
-
timeToDouble
-
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 nullofficeStyles
- should always be set- Returns:
-
removeQuotedAndColor
-
detectFormatType
-
findOrCreateDataStyle
-
getLocaleFromLangCode
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
converts locale information to a hex value string but without a hex marker like '0x' returns null if no value can be found -
moveParaToCell
-