/** * Removes all stylenames from the given style and returns the updated * style. * @deprecated Use <code>mxStyleUtils.removeAllStylenames(String)</code> (Jan 2012) */ public static String removeAllStylenames(String style) { return mxStyleUtils.removeAllStylenames(style); }
/** * Adds or removes the given key, value pair to the style and returns the * new style. If value is null or zero length then the key is removed from * the style. * * @param style * String of the form <code>stylename[;key=value]</code>. * @param key * Key of the style to be changed. * @param value * New value for the given key. * @return Returns the new style. * @deprecated Use <code>mxStyleUtils.setStyle(String, String, String)</code> (Jan 2012) */ public static String setStyle(String style, String key, String value) { return mxStyleUtils.setStyle(style, key, value); }
/** * Returns the stylename in a style of the form stylename[;key=value] or an * empty string if the given style does not contain a stylename. * * @param style * String of the form stylename[;key=value]. * @return Returns the stylename from the given formatted string. * @deprecated Use <code>mxStyleUtils.getStylename(String)</code> (Jan 2012) */ public static String getStylename(String style) { return mxStyleUtils.getStylename(style); }
private void setVertexStyle(final mxICell vertex, final String colorstr) { String targetStyle = vertex.getStyle(); targetStyle = mxStyleUtils.removeAllStylenames(targetStyle); targetStyle = mxStyleUtils.setStyle(targetStyle , mxConstants.STYLE_STROKECOLOR, colorstr ); // Style specifics int width, height; if (globalStyle.equals(SIMPLE_STYLE_NAME)) { targetStyle = mxStyleUtils.setStyle(targetStyle, mxConstants.STYLE_FILLCOLOR, colorstr); width = DEFAULT_CELL_HEIGHT; height = width; } else { targetStyle = mxStyleUtils.setStyle(targetStyle, mxConstants.STYLE_FILLCOLOR, "white"); width = DEFAULT_CELL_WIDTH; height = DEFAULT_CELL_HEIGHT; } targetStyle = globalStyle + ";" + targetStyle; graphx.getModel().setStyle(vertex, targetStyle); graphx.getModel().getGeometry(vertex).setWidth(width); graphx.getModel().getGeometry(vertex).setHeight(height); }
/** * 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); }
/** * Sets or removes the given key from the specified style and returns the * new style. If value is null then the flag is toggled. * * @param style * String of the form stylename[;key=value]. * @param key * Key of the style to be changed. * @param flag * Integer for the bit to be changed. * @param value * Optional boolean value for the given flag. * @deprecated Use <code>mxStyleUtils.setStyleFlag(String, String, int, Boolean)</code> (Jan 2012) */ public static String setStyleFlag(String style, String key, int flag, Boolean value) { return mxStyleUtils.setStyleFlag(style, key, flag, value); }
/** * Assigns the value for the given key in the styles of the given cells, or * removes the key from the styles if the value is null. * * @param model * Model to execute the transaction in. * @param cells * Array of cells to be updated. * @param key * Key of the style to be changed. * @param value * New value for the given key. * @deprecated Use <code>mxStyleUtils.setCellStyles(mxIGraphModel, Object[], String, String)</code> (Jan 2012) */ public static void setCellStyles(mxIGraphModel model, Object[] cells, String key, String value) { mxStyleUtils.setCellStyles(model, cells, key, value); }
/** * Sets or toggles the flag bit for the given key in the cell's styles. If * value is null then the flag is toggled. * * <code> * mxUtils.setCellStyleFlags(graph.getModel(), * cells, * mxConstants.STYLE_FONTSTYLE, * mxConstants.FONT_BOLD, null); * </code> * * Toggles the bold font style. * * @param model * Model that contains the cells. * @param cells * Array of cells to change the style for. * @param key * Key of the style to be changed. * @param flag * Integer for the bit to be changed. * @param value * Optional boolean value for the flag. * @deprecated Use <code>mxStyleUtils.setCellStyleFlags(mxIGraphModel, Object[],String, int, Boolean)</code> (Jan 2012) */ public static void setCellStyleFlags(mxIGraphModel model, Object[] cells, String key, int flag, Boolean value) { mxStyleUtils.setCellStyleFlags(model, cells, key, flag, value); }
/** * Returns the stylenames in a style of the form stylename[;key=value] or an * empty array if the given style does not contain any stylenames. * * @param style * String of the form stylename[;stylename][;key=value]. * @return Returns the stylename from the given formatted string. * @deprecated Use <code>mxStyleUtils.getStylenames(String)</code> (Jan 2012) */ public static String[] getStylenames(String style) { return mxStyleUtils.getStylenames(style); }
private void setVertexStyle(final mxICell vertex, final String colorstr) { String targetStyle = vertex.getStyle(); targetStyle = mxStyleUtils.removeAllStylenames(targetStyle); targetStyle = mxStyleUtils.setStyle(targetStyle , mxConstants.STYLE_STROKECOLOR, colorstr ); // Style specifics int width, height; if (globalStyle.equals(SIMPLE_STYLE_NAME)) { targetStyle = mxStyleUtils.setStyle(targetStyle, mxConstants.STYLE_FILLCOLOR, colorstr); width = DEFAULT_CELL_HEIGHT; height = width; } else { targetStyle = mxStyleUtils.setStyle(targetStyle, mxConstants.STYLE_FILLCOLOR, "white"); width = DEFAULT_CELL_WIDTH; height = DEFAULT_CELL_HEIGHT; } targetStyle = globalStyle + ";" + targetStyle; graphx.getModel().setStyle(vertex, targetStyle); graphx.getModel().getGeometry(vertex).setWidth(width); graphx.getModel().getGeometry(vertex).setHeight(height); }
/** * 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); }
/** * Sets or removes the given key from the specified style and returns the * new style. If value is null then the flag is toggled. * * @param style * String of the form stylename[;key=value]. * @param key * Key of the style to be changed. * @param flag * Integer for the bit to be changed. * @param value * Optional boolean value for the given flag. * @deprecated Use <code>mxStyleUtils.setStyleFlag(String, String, int, Boolean)</code> (Jan 2012) */ public static String setStyleFlag(String style, String key, int flag, Boolean value) { return mxStyleUtils.setStyleFlag(style, key, flag, value); }
/** * Assigns the value for the given key in the styles of the given cells, or * removes the key from the styles if the value is null. * * @param model * Model to execute the transaction in. * @param cells * Array of cells to be updated. * @param key * Key of the style to be changed. * @param value * New value for the given key. * @deprecated Use <code>mxStyleUtils.setCellStyles(mxIGraphModel, Object[], String, String)</code> (Jan 2012) */ public static void setCellStyles(mxIGraphModel model, Object[] cells, String key, String value) { mxStyleUtils.setCellStyles(model, cells, key, value); }
/** * Sets or toggles the flag bit for the given key in the cell's styles. If * value is null then the flag is toggled. * * <code> * mxUtils.setCellStyleFlags(graph.getModel(), * cells, * mxConstants.STYLE_FONTSTYLE, * mxConstants.FONT_BOLD, null); * </code> * * Toggles the bold font style. * * @param model * Model that contains the cells. * @param cells * Array of cells to change the style for. * @param key * Key of the style to be changed. * @param flag * Integer for the bit to be changed. * @param value * Optional boolean value for the flag. * @deprecated Use <code>mxStyleUtils.setCellStyleFlags(mxIGraphModel, Object[],String, int, Boolean)</code> (Jan 2012) */ public static void setCellStyleFlags(mxIGraphModel model, Object[] cells, String key, int flag, Boolean value) { mxStyleUtils.setCellStyleFlags(model, cells, key, flag, value); }
/** * Returns the stylenames in a style of the form stylename[;key=value] or an * empty array if the given style does not contain any stylenames. * * @param style * String of the form stylename[;stylename][;key=value]. * @return Returns the stylename from the given formatted string. * @deprecated Use <code>mxStyleUtils.getStylenames(String)</code> (Jan 2012) */ public static String[] getStylenames(String style) { return mxStyleUtils.getStylenames(style); }
/** * Adds or removes the given key, value pair to the style and returns the * new style. If value is null or zero length then the key is removed from * the style. * * @param style * String of the form <code>stylename[;key=value]</code>. * @param key * Key of the style to be changed. * @param value * New value for the given key. * @return Returns the new style. * @deprecated Use <code>mxStyleUtils.setStyle(String, String, String)</code> (Jan 2012) */ public static String setStyle(String style, String key, String value) { return mxStyleUtils.setStyle(style, key, value); }
/** * Removes all stylenames from the given style and returns the updated * style. * @deprecated Use <code>mxStyleUtils.removeAllStylenames(String)</code> (Jan 2012) */ public static String removeAllStylenames(String style) { return mxStyleUtils.removeAllStylenames(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; }
String style = setStyleFlag(model.getStyle(cells[i]), key, flag, value); model.setStyle(cells[i], style);
/** * Sets the key to value in the styles of the given cells. This will modify * the existing cell styles in-place and override any existing assignment * for the given key. If no cells are specified, then the selection cells * are changed. If no value is specified, then the respective key is * removed from the styles. * * @param key String representing the key to be assigned. * @param value String representing the new value for the key. * @param cells Array of cells to change the style for. */ public Object[] setCellStyles(String key, String value, Object[] cells) { if (cells == null) { cells = getSelectionCells(); } mxStyleUtils.setCellStyles(model, cells, key, value); return cells; }