Class mxStylesheet
java.lang.Object
com.mxgraph.view.mxStylesheet
Defines the appearance of the cells in a graph. The following example
changes the font size for all vertices by changing the default vertex
style in-place:
getDefaultVertexStyle().put(mxConstants.STYLE_FONTSIZE, 16);
To change the default font size for all cells, set
mxConstants.DEFAULT_FONTSIZE.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates and returns the default edge style.Creates and returns the default vertex style.getCellStyle(String name, Map<String, Object> defaultStyle) Returns the cell style for the specified cell or the given defaultStyle if no style can be found for the given stylename.Returns the default style for edges.Returns the default style for vertices.Returns all styles as map of name, hashtable pairs.voidputCellStyle(String name, Map<String, Object> style) Stores the specified style under the given name.voidsetDefaultEdgeStyle(Map<String, Object> value) Sets the default style for edges.voidsetDefaultVertexStyle(Map<String, Object> value) Sets the default style for vertices.voidSets all styles in the stylesheet.
-
Field Details
-
EMPTY_STYLE
-
styles
-
-
Constructor Details
-
mxStylesheet
public mxStylesheet()Constructs a new stylesheet and assigns default styles.
-
-
Method Details
-
getStyles
-
setStyles
-
createDefaultVertexStyle
-
createDefaultEdgeStyle
-
getDefaultVertexStyle
-
setDefaultVertexStyle
-
getDefaultEdgeStyle
-
setDefaultEdgeStyle
-
putCellStyle
-
getCellStyle
Returns the cell style for the specified cell or the given defaultStyle if no style can be found for the given stylename.- Parameters:
name- String of the form [(stylename|key=value);] that represents the style.defaultStyle- Default style to be returned if no style can be found.- Returns:
- Returns the style for the given formatted cell style.
-