JGraph X 1.0.2.8


com.mxgraph.view
Class mxStylesheet

java.lang.Object
  extended by com.mxgraph.view.mxStylesheet

public class mxStylesheet
extends Object

Defines the appearance of the cells in a graph.


Field Summary
static Hashtable EMPTY_STYLE
          Shared immutable empty hashtable (for undefined cell styles).
protected  Hashtable styles
          Maps from names to styles.
 
Constructor Summary
mxStylesheet()
          Constructs a new stylesheet and assigns default styles.
 
Method Summary
protected  Hashtable createDefaultEdgeStyle()
          Creates and returns the default edge style.
protected  Hashtable createDefaultVertexStyle()
          Creates and returns the default vertex style.
 Hashtable getCellStyle(String name, Hashtable defaultStyle)
          Returns the cell style for the specified cell or the given defaultStyle if no style can be found for the given stylename.
 Hashtable getDefaultEdgeStyle()
          Returns the default style for edges.
 Hashtable getDefaultVertexStyle()
          Returns the default style for vertices.
 Hashtable getStyles()
          Returns all styles as map of name, hashtable pairs.
 void putCellStyle(String name, Hashtable style)
          Stores the specified style under the given name.
 void setDefaultEdgeStyle(Hashtable value)
          Sets the default style for edges.
 void setDefaultVertexStyle(Hashtable value)
          Sets the default style for vertices.
 void setStyles(Hashtable styles)
          Sets all styles in the stylesheet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_STYLE

public static final Hashtable EMPTY_STYLE
Shared immutable empty hashtable (for undefined cell styles).


styles

protected Hashtable styles
Maps from names to styles.

Constructor Detail

mxStylesheet

public mxStylesheet()
Constructs a new stylesheet and assigns default styles.

Method Detail

getStyles

public Hashtable getStyles()
Returns all styles as map of name, hashtable pairs.

Returns:
All styles in this stylesheet.

setStyles

public void setStyles(Hashtable styles)
Sets all styles in the stylesheet.


createDefaultVertexStyle

protected Hashtable createDefaultVertexStyle()
Creates and returns the default vertex style.

Returns:
Returns the default vertex style.

createDefaultEdgeStyle

protected Hashtable createDefaultEdgeStyle()
Creates and returns the default edge style.

Returns:
Returns the default edge style.

getDefaultVertexStyle

public Hashtable getDefaultVertexStyle()
Returns the default style for vertices.

Returns:
Returns the default vertex style.

setDefaultVertexStyle

public void setDefaultVertexStyle(Hashtable value)
Sets the default style for vertices.

Parameters:
value - Style to be used for vertices.

getDefaultEdgeStyle

public Hashtable getDefaultEdgeStyle()
Returns the default style for edges.

Returns:
Returns the default edge style.

setDefaultEdgeStyle

public void setDefaultEdgeStyle(Hashtable value)
Sets the default style for edges.

Parameters:
value - Style to be used for edges.

putCellStyle

public void putCellStyle(String name,
                         Hashtable style)
Stores the specified style under the given name.

Parameters:
name - Name for the style to be stored.
style - Key, value pairs that define the style.

getCellStyle

public Hashtable getCellStyle(String name,
                              Hashtable defaultStyle)
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.

JGraph X 1.0.2.8


Copyright (c) 2008 Gaudenz Alder. All rights reserved.