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.JSONObject
createBorderMap(String borderValue)
map odf border strings to JSON border object see Changes API Borderstatic Map<String,String>
createColorMap(String rgbValue)
see Changes API Colorstatic Double
dateToDouble(Object value)
static OfficeValueTypeAttribute.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 knownstatic Map<String,Object>
getMappedStyleProperties(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
isColor(String color)
static boolean
mapColor(org.json.JSONObject border, String width)
static String
mapFoTextAlign(String propValue)
static org.json.JSONObject
mapProperties(String styleFamilyGroup, Map<String,String> odfProps)
static boolean
mapStyle(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 boolean
mapWidth(org.json.JSONObject border, String widthString, String[] tokens)
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!) unique so it can only be found in one of the two containersstatic String
removeQuotedAndColor(String compareCode)
static Double
timeToDouble(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
-
-