Package org.odftoolkit.odfdom.changes
Class MapHelper
- java.lang.Object
-
- org.odftoolkit.odfdom.changes.MapHelper
-
public class MapHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description MapHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.json.JSONObjectcreateBorderMap(String borderValue)map odf border strings to JSON border object see Changes API Borderstatic Map<String,String>createColorMap(String rgbValue)see Changes API Colorstatic DoubledateToDouble(Object value)static OfficeValueTypeAttribute.ValuedetectFormatType(String code)static StringfindOrCreateDataStyle(String code, long id, OdfFileDom fileDom)static StringgetLocaleFromLangCode(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 knownstatic Map<String,Object>getMappedStyleProperties(OdfStyle style)static StringgetMSLangCode(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 voidgetStyleProperties(OdfStyleBase style, Map<String,OdfStylePropertiesSet> familyPropertyGroups, Map<String,Map<String,String>> allOdfProps)static voidgetStyleProperties(OdfStyleBase style, OdfStylableElement styleElement, Map<String,Map<String,String>> allOdfProps)static booleanisColor(String color)static booleanmapColor(org.json.JSONObject border, String width)static StringmapFoTextAlign(String propValue)static org.json.JSONObjectmapProperties(String styleFamilyGroup, Map<String,String> odfProps)static booleanmapStyle(org.json.JSONObject border, String style)static Map<String,Object>mapStyleProperties(Map<String,OdfStylePropertiesSet> familyPropertyGroups, Map<String,Map<String,String>> allOdfProps)static Map<String,Object>mapStyleProperties(OdfStylableElement styleElement, Map<String,Map<String,String>> allOdfProps)static booleanmapWidth(org.json.JSONObject border, String widthString, String[] tokens)static voidmoveParaToCell(Map<String,Object> allHardFormatting)static intnormalizeLength(String value)Currently the normalized length is 100th millimeter (or 10 micrometer)static booleanputNumberFormat(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 containersstatic StringremoveQuotedAndColor(String compareCode)static DoubletimeToDouble(Object value)
-
-
-
Field Detail
-
AUTO
public static final String AUTO
- See Also:
- Constant Field Values
-
NORMAL
public static final String NORMAL
- See Also:
- Constant Field Values
-
BOLD
public static final String BOLD
- See Also:
- Constant Field Values
-
THIN
public static final String THIN
- See Also:
- Constant Field Values
-
MEDIUM
public static final String MEDIUM
- See Also:
- Constant Field Values
-
THICK
public static final String THICK
- See Also:
- Constant Field Values
-
HASH
public static final String HASH
- See Also:
- Constant Field Values
-
TRANSPARENT
public static final String TRANSPARENT
- See Also:
- Constant Field Values
-
-
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)
-
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)
-
mapStyleProperties
public static Map<String,Object> mapStyleProperties(OdfStylableElement styleElement, Map<String,Map<String,String>> allOdfProps)
-
mapStyleProperties
public static Map<String,Object> mapStyleProperties(Map<String,OdfStylePropertiesSet> familyPropertyGroups, Map<String,Map<String,String>> allOdfProps)
-
getMappedStyleProperties
public static Map<String,Object> getMappedStyleProperties(OdfStyle style)
-
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)
-
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:
-
detectFormatType
public static OfficeValueTypeAttribute.Value detectFormatType(String code)
-
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
-
-