/** * Returns the index of the given stylename in the given style. This returns * -1 if the given stylename does not occur (as a stylename) in the given * style, otherwise it returns the index of the first character. * @deprecated Use <code>mxStyleUtils.indexOfStylename(String, String)</code> (Jan 2012) */ public static int indexOfStylename(String style, String stylename) { return mxStyleUtils.indexOfStylename(style, stylename); }
/** * Returns the index of the given stylename in the given style. This returns * -1 if the given stylename does not occur (as a stylename) in the given * style, otherwise it returns the index of the first character. * @deprecated Use <code>mxStyleUtils.indexOfStylename(String, String)</code> (Jan 2012) */ public static int indexOfStylename(String style, String stylename) { return mxStyleUtils.indexOfStylename(style, stylename); }
/** * Adds the specified stylename to the given style if it does not already * contain the stylename. */ public static String addStylename(String style, String stylename) { if (indexOfStylename(style, stylename) < 0) { if (style == null) { style = ""; } else if (style.length() > 0 && style.charAt(style.length() - 1) != ';') { style += ';'; } style += stylename; } return style; }
/** * Adds the specified stylename to the given style if it does not already * contain the stylename. */ public static String addStylename(String style, String stylename) { if (indexOfStylename(style, stylename) < 0) { if (style == null) { style = ""; } else if (style.length() > 0 && style.charAt(style.length() - 1) != ';') { style += ';'; } style += stylename; } return style; }