|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgraph.util.JGraphGXLCodec
Constructor Summary | |
JGraphGXLCodec()
|
Method Summary | |
protected static java.util.Map |
createDefaultAttributes(java.util.Map map)
Returns an attributeMap for the specified position and color. |
static void |
decode(java.io.InputStream inputStream,
JGraph graph)
Decodes a GXL File. |
protected static void |
decodeCell(org.w3c.dom.Node gnode,
java.util.Map gnode_attrs)
Extracts visual properties of the node from the child 'view' element Currently recognized properties: - Bounds - color - background-color - autosize - Font - Line-End, Line-size, Line-color |
protected static void |
decodeEdge(org.w3c.dom.Node enode,
java.util.Map enode_attrs)
Decodes a Edge. |
static java.lang.String |
encode(JGraph graph)
Create a GXL-representation for all the cells. |
static java.lang.String |
encode(JGraph graph,
java.lang.Object[] cells)
Create a GXL-representation for the specified cells. |
protected static java.lang.String |
encodeAttribute(java.lang.String values,
java.lang.String attributeName,
int level)
Attribute encoding. |
protected static java.lang.String |
encodeBean(java.lang.Object bean,
java.lang.String attributeName,
int level)
Bean encoding. |
protected static java.lang.String |
encodeBoolean(boolean value,
java.lang.String attributeName,
int level)
Boolean encoding. |
protected static java.lang.String |
encodeColor(java.awt.Color color,
java.lang.String attributeName,
int level)
Color encoding. |
protected static java.lang.String |
encodeEdge(JGraph graph,
java.lang.Object id,
java.lang.Object edge)
Encode a Edge of a graph |
protected static java.lang.String |
encodeFont(java.awt.Font font,
java.lang.String attributeName,
int level)
Font encoding. |
protected static java.lang.String |
encodeInteger(int value,
java.lang.String attributeName,
int level)
Integer encoding. |
protected static java.lang.String |
encodeRectangle(java.awt.geom.Rectangle2D rec,
java.lang.String attributeName,
int level)
Rectangle encoding. |
protected static java.lang.String |
encodeString(java.lang.String value,
java.lang.String attributeName,
int level)
String encoding. |
protected static java.lang.String |
encodeValue(int value,
int level)
Basic integer encoding. |
protected static java.lang.String |
encodeValue(java.lang.String value,
int level)
Basic String encoding. |
protected static java.lang.String |
encodeValue(java.lang.String type,
java.lang.String value,
int level)
Basic value encoding. |
protected static java.lang.String |
encodeVertex(JGraph graph,
java.lang.String id,
java.lang.Object vertex)
Encode a Vertex of a graph |
protected static java.lang.String |
getLabel(org.w3c.dom.Node node)
|
static java.util.Hashtable |
getLastDecodingHashtable()
Retrieves the decoding Hashtable with the node's Id. |
static java.util.Hashtable |
getLastEncodingHashtable()
Retrieves the encoding Hashtable with the node's Id. |
static boolean |
getValidateDTD()
Getter for the property validateDTD |
protected static void |
readGXLAttributeValues(org.w3c.dom.Node enode,
java.util.LinkedList values)
Reads the values of an GXL Attribute. |
static void |
setValidateDTD(boolean validate)
Setter for the property validateDTD |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JGraphGXLCodec()
Method Detail |
public static java.util.Hashtable getLastEncodingHashtable()
public static java.util.Hashtable getLastDecodingHashtable()
public static java.lang.String encode(JGraph graph)
graph
- JGraph to encode.
public static java.lang.String encode(JGraph graph, java.lang.Object[] cells)
graph
- JGraph to encode.cells
- Selected cells to be encoded.
protected static java.lang.String encodeValue(java.lang.String type, java.lang.String value, int level)
type
- GXL Type of the value (int, bool, ...)value
- Value to be encoded.level
- Tab level.
protected static java.lang.String encodeValue(int value, int level)
value
- Value to be encoded.level
- Tab level.
protected static java.lang.String encodeValue(java.lang.String value, int level)
value
- Value to be encoded.level
- Tab level.
protected static java.lang.String encodeAttribute(java.lang.String values, java.lang.String attributeName, int level)
values
- Values of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static java.lang.String encodeString(java.lang.String value, java.lang.String attributeName, int level)
value
- Value of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static java.lang.String encodeInteger(int value, java.lang.String attributeName, int level)
value
- Value of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static java.lang.String encodeBoolean(boolean value, java.lang.String attributeName, int level)
value
- Value of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static java.lang.String encodeColor(java.awt.Color color, java.lang.String attributeName, int level)
color
- Color of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static java.lang.String encodeFont(java.awt.Font font, java.lang.String attributeName, int level)
font
- Font of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static java.lang.String encodeRectangle(java.awt.geom.Rectangle2D rec, java.lang.String attributeName, int level)
rec
- Rectangle to be encoded.attributeName
- name of the attribute.level
- Tab level.
protected static java.lang.String encodeBean(java.lang.Object bean, java.lang.String attributeName, int level)
bean
- Bean to be encoded.attributeName
- name of the attribute.level
- Tab level.
protected static java.lang.String encodeVertex(JGraph graph, java.lang.String id, java.lang.Object vertex)
graph
- Graph containing the vertex.id
- Id of the vertex.vertex
- Vertex to be encoded.
protected static java.lang.String encodeEdge(JGraph graph, java.lang.Object id, java.lang.Object edge)
graph
- Graph containing the edge.id
- Id of the vertex.
protected static void decodeCell(org.w3c.dom.Node gnode, java.util.Map gnode_attrs)
protected static void readGXLAttributeValues(org.w3c.dom.Node enode, java.util.LinkedList values)
enode
- Node to read.protected static void decodeEdge(org.w3c.dom.Node enode, java.util.Map enode_attrs)
enode
- XML Node.enode_attrs
- Cell Attributes.public static void decode(java.io.InputStream inputStream, JGraph graph) throws java.lang.Exception
inputStream
- Stream to be decoded.graph
- Graph where the decode file is inserted.
java.lang.Exception
protected static java.util.Map createDefaultAttributes(java.util.Map map)
protected static java.lang.String getLabel(org.w3c.dom.Node node)
public static void setValidateDTD(boolean validate)
validate
- True, the validation will occur.public static boolean getValidateDTD()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |