public class mxStylesheet extends Object
getDefaultVertexStyle().put(mxConstants.STYLE_FONTSIZE, 16);
To change the default font size for all cells, set
mxConstants.DEFAULT_FONTSIZE.Modifier and Type | Field and Description |
---|---|
static Map<String,Object> |
EMPTY_STYLE
Shared immutable empty hashtable (for undefined cell styles).
|
protected Map<String,Map<String,Object>> |
styles
Maps from names to styles.
|
Constructor and Description |
---|
mxStylesheet()
Constructs a new stylesheet and assigns default styles.
|
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
createDefaultEdgeStyle()
Creates and returns the default edge style.
|
protected Map<String,Object> |
createDefaultVertexStyle()
Creates and returns the default vertex style.
|
Map<String,Object> |
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.
|
Map<String,Object> |
getDefaultEdgeStyle()
Returns the default style for edges.
|
Map<String,Object> |
getDefaultVertexStyle()
Returns the default style for vertices.
|
Map<String,Map<String,Object>> |
getStyles()
Returns all styles as map of name, hashtable pairs.
|
void |
putCellStyle(String name,
Map<String,Object> style)
Stores the specified style under the given name.
|
void |
setDefaultEdgeStyle(Map<String,Object> value)
Sets the default style for edges.
|
void |
setDefaultVertexStyle(Map<String,Object> value)
Sets the default style for vertices.
|
void |
setStyles(Map<String,Map<String,Object>> styles)
Sets all styles in the stylesheet.
|
public static final Map<String,Object> EMPTY_STYLE
public mxStylesheet()
public Map<String,Map<String,Object>> getStyles()
public void setStyles(Map<String,Map<String,Object>> styles)
protected Map<String,Object> createDefaultVertexStyle()
protected Map<String,Object> createDefaultEdgeStyle()
public Map<String,Object> getDefaultVertexStyle()
public void setDefaultVertexStyle(Map<String,Object> value)
value
- Style to be used for vertices.public Map<String,Object> getDefaultEdgeStyle()
public void setDefaultEdgeStyle(Map<String,Object> value)
value
- Style to be used for edges.public void putCellStyle(String name, Map<String,Object> style)
name
- Name for the style to be stored.style
- Key, value pairs that define the style.public Map<String,Object> getCellStyle(String name, Map<String,Object> defaultStyle)
name
- String of the form [(stylename|key=value);] that represents the
style.defaultStyle
- Default style to be returned if no style can be found.Copyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.