|
JGraphAddons |
||||||||||
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 Map |
createDefaultAttributes(Map map)
Returns an attributeMap for the specified position and color. |
static void |
decode(InputStream inputStream,
JGraph graph)
Decodes a GXL File. |
protected static void |
decodeCell(Node gnode,
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(Node enode,
Map enode_attrs)
Decodes a Edge. |
static String |
encode(JGraph graph)
Create a GXL-representation for all the cells. |
static String |
encode(JGraph graph,
Object[] cells)
Create a GXL-representation for the specified cells. |
protected static String |
encodeAttribute(String values,
String attributeName,
int level)
Attribute encoding. |
protected static String |
encodeBean(Object bean,
String attributeName,
int level)
Bean encoding. |
protected static String |
encodeBoolean(boolean value,
String attributeName,
int level)
Boolean encoding. |
protected static String |
encodeColor(Color color,
String attributeName,
int level)
Color encoding. |
protected static String |
encodeEdge(JGraph graph,
Object id,
Object edge)
Encode a Edge of a graph |
protected static String |
encodeFont(Font font,
String attributeName,
int level)
Font encoding. |
protected static String |
encodeInteger(int value,
String attributeName,
int level)
Integer encoding. |
protected static String |
encodeRectangle(Rectangle2D rec,
String attributeName,
int level)
Rectangle encoding. |
protected static String |
encodeString(String value,
String attributeName,
int level)
String encoding. |
protected static String |
encodeValue(int value,
int level)
Basic integer encoding. |
protected static String |
encodeValue(String value,
int level)
Basic String encoding. |
protected static String |
encodeValue(String type,
String value,
int level)
Basic value encoding. |
protected static String |
encodeVertex(JGraph graph,
String id,
Object vertex)
Encode a Vertex of a graph |
protected static String |
getLabel(Node node)
|
static Hashtable |
getLastDecodingHashtable()
Retrieves the decoding Hashtable with the node's Id. |
static Hashtable |
getLastEncodingHashtable()
Retrieves the encoding Hashtable with the node's Id. |
static boolean |
getValidateDTD()
Getter for the property validateDTD |
protected static void |
readGXLAttributeValues(Node enode,
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 Hashtable getLastEncodingHashtable()
public static Hashtable getLastDecodingHashtable()
public static String encode(JGraph graph)
graph
- JGraph to encode.
public static String encode(JGraph graph, Object[] cells)
graph
- JGraph to encode.cells
- Selected cells to be encoded.
protected static String encodeValue(String type, String value, int level)
type
- GXL Type of the value (int, bool, ...)value
- Value to be encoded.level
- Tab level.
protected static String encodeValue(int value, int level)
value
- Value to be encoded.level
- Tab level.
protected static String encodeValue(String value, int level)
value
- Value to be encoded.level
- Tab level.
protected static String encodeAttribute(String values, String attributeName, int level)
values
- Values of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static String encodeString(String value, String attributeName, int level)
value
- Value of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static String encodeInteger(int value, String attributeName, int level)
value
- Value of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static String encodeBoolean(boolean value, String attributeName, int level)
value
- Value of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static String encodeColor(Color color, String attributeName, int level)
color
- Color of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static String encodeFont(Font font, String attributeName, int level)
font
- Font of the attribute.attributeName
- name of the attribute.level
- Tab level.
protected static String encodeRectangle(Rectangle2D rec, String attributeName, int level)
rec
- Rectangle to be encoded.attributeName
- name of the attribute.level
- Tab level.
protected static String encodeBean(Object bean, String attributeName, int level)
bean
- Bean to be encoded.attributeName
- name of the attribute.level
- Tab level.
protected static String encodeVertex(JGraph graph, String id, Object vertex)
graph
- Graph containing the vertex.id
- Id of the vertex.vertex
- Vertex to be encoded.
protected static String encodeEdge(JGraph graph, Object id, Object edge)
graph
- Graph containing the edge.id
- Id of the vertex.
protected static void decodeCell(Node gnode, Map gnode_attrs)
protected static void readGXLAttributeValues(Node enode, LinkedList values)
enode
- Node to read.protected static void decodeEdge(Node enode, Map enode_attrs)
enode
- XML Node.enode_attrs
- Cell Attributes.public static void decode(InputStream inputStream, JGraph graph) throws Exception
inputStream
- Stream to be decoded.graph
- Graph where the decode file is inserted.
Exception
protected static Map createDefaultAttributes(Map map)
protected static String getLabel(Node node)
public static void setValidateDTD(boolean validate)
validate
- True, the validation will occur.public static boolean getValidateDTD()
|
JGraphAddons |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |