|
mxGraph 2.4.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mxgraph.util.mxStyleUtils
public class mxStyleUtils
Contains various style helper methods for use with mxGraph.
Constructor Summary | |
---|---|
mxStyleUtils()
|
Method Summary | |
---|---|
static String |
addStylename(String style,
String stylename)
Adds the specified stylename to the given style if it does not already contain the stylename. |
static String |
getStylename(String style)
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. |
static String[] |
getStylenames(String style)
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. |
static int |
indexOfStylename(String style,
String stylename)
Returns the index of the given stylename in the given style. |
static String |
removeAllStylenames(String style)
Removes all stylenames from the given style and returns the updated style. |
static String |
removeStylename(String style,
String stylename)
Removes all occurrences of the specified stylename in the given style and returns the updated style. |
static void |
setCellStyleFlags(mxIGraphModel model,
Object[] cells,
String key,
int flag,
Boolean value)
Sets or toggles the flag bit for the given key in the cell's styles. |
static void |
setCellStyles(mxIGraphModel model,
Object[] cells,
String key,
String 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. |
static String |
setStyle(String style,
String key,
String value)
Adds or removes the given key, value pair to the style and returns the new style. |
static String |
setStyleFlag(String style,
String key,
int flag,
Boolean value)
Sets or removes the given key from the specified style and returns the new style. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public mxStyleUtils()
Method Detail |
---|
public static String getStylename(String style)
style
- String of the form stylename[;key=value].
public static String[] getStylenames(String style)
style
- String of the form stylename[;stylename][;key=value].
public static int indexOfStylename(String style, String stylename)
public static String addStylename(String style, String stylename)
public static String removeStylename(String style, String stylename)
public static String removeAllStylenames(String style)
public static void setCellStyles(mxIGraphModel model, Object[] cells, String key, String value)
model
- Model to execute the transaction in.cells
- Array of cells to be updated.key
- Key of the style to be changed.value
- New value for the given key.public static String setStyle(String style, String key, String value)
style
- String of the form stylename[;key=value]
.key
- Key of the style to be changed.value
- New value for the given key.
public static void setCellStyleFlags(mxIGraphModel model, Object[] cells, String key, int flag, Boolean value)
mxUtils.setCellStyleFlags(graph.getModel(),
cells,
mxConstants.STYLE_FONTSTYLE,
mxConstants.FONT_BOLD, null);
Toggles the bold font style.
model
- Model that contains the cells.cells
- Array of cells to change the style for.key
- Key of the style to be changed.flag
- Integer for the bit to be changed.value
- Optional boolean value for the flag.public static String setStyleFlag(String style, String key, int flag, Boolean value)
style
- String of the form stylename[;key=value].key
- Key of the style to be changed.flag
- Integer for the bit to be changed.value
- Optional boolean value for the given flag.
|
mxGraph 2.4.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |