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