|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectyext.graphml.reader.YGraphElementFactory
Implementation of GraphElementFactory for yfiles.
| Nested Class Summary | |
protected class |
YGraphElementFactory.AttributeData
Data class for attributes. |
| Field Summary | |
protected YList |
attributeList
|
protected Map |
attributeMap
|
protected YList |
createdGraphList
|
protected Class |
graphImpl
|
protected YList |
graphList
|
| Fields inherited from interface org.graphdrawing.graphml.reader.GraphElementFactory |
EDGEDEFAULT_DIRECTED, EDGEDEFAULT_UNDIRECTED, HYPEREDGE_TYPE_INT, HYPEREDGE_TYPE_OUT, HYPEREDGE_TYPE_UNDIR |
| Fields inherited from interface org.graphdrawing.graphml.attr.AttributeConstants |
TYPE_BOOLEAN, TYPE_COMPLEX, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_LONG, TYPE_STRING |
| Constructor Summary | |
YGraphElementFactory(Class _graphImpl)
Creates a new factory. |
|
YGraphElementFactory(Graph _graph)
Creates a new factory using a given graph instance to store the data. |
|
| Method Summary | |
void |
createAttribute(GraphMLParseContext context,
String name,
String value)
This method is called when an attribute value is encountered. |
Object |
createEdge(GraphMLParseContext context,
String id,
Object source,
Object target,
Object sourceport,
Object targetport,
boolean directed)
This method creates an edge on the graph, between nodes source and target. |
Object |
createEndPoint(GraphMLParseContext context,
String id,
Object node,
Object port,
int type)
Not implemented. |
Object |
createGraph(GraphMLParseContext context,
String id,
int edgedefault)
Creates the graph, should set up data with attributes. |
Object |
createGraphML(GraphMLParseContext context)
Not implemented. |
Object |
createHyperEdge(GraphMLParseContext context,
String id)
Not implemented. |
Object |
createNode(GraphMLParseContext context,
String id)
Creates a node on the passed graph, could be set up with attributes passed by. |
Object |
createPort(GraphMLParseContext context,
Object owner,
String name)
Not implemented. |
void |
defineAttribute(String name,
int contentType,
int scopeType)
This method is called when an attribute definition is encountered. |
YList |
getGraphList()
Returns the list of graphs read from the input. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected YList graphList
protected YList createdGraphList
protected Class graphImpl
protected YList attributeList
protected Map attributeMap
| Constructor Detail |
public YGraphElementFactory(Class _graphImpl)
_graphImpl - Defines the class which is instantiated
for every graph in the input.
The class must provide a constructor without arguments
and must be a subclass of Graph.public YGraphElementFactory(Graph _graph)
_graph - the data of the first graph in the input is stored here.| Method Detail |
public YList getGraphList()
public Object createGraphML(GraphMLParseContext context)
createGraphML in interface GraphElementFactorycontext - the current parse context.
null.
public Object createGraph(GraphMLParseContext context,
String id,
int edgedefault)
createGraph in interface GraphElementFactorycontext - the current parse context.id - the identifier of the graph as defined in the
input data. May be null if no
id has been specified.edgedefault - indicating if edges are per default directed
or undirected.
public Object createNode(GraphMLParseContext context,
String id)
createNode in interface GraphElementFactorycontext - the current parse context.id - the identifier of the node as defined in the
input data.
public Object createEdge(GraphMLParseContext context,
String id,
Object source,
Object target,
Object sourceport,
Object targetport,
boolean directed)
createEdge in interface GraphElementFactorycontext - the current parse context.id - the identifier of the edge as defined in the
input data. May be null if no
id has been specified.source - the user object representing the source node
of the edge.target - the user object representing the target node
of the edge.sourceport - the user object representing the source port
of the edge.targetport - the user object representing the target port
of the edge.directed - indicates whether the edge is directed or not.
public Object createPort(GraphMLParseContext context,
Object owner,
String name)
createPort in interface GraphElementFactorycontext - the current parse context.owner - the owner of the port (a node or another port)name - the identifier of the port as defined in the
input data.
null
public Object createHyperEdge(GraphMLParseContext context,
String id)
createHyperEdge in interface GraphElementFactorycontext - the current parse context.id - the identifier of the hyperedge as defined in the
input data. May be null if no
id has been specified.
null
public Object createEndPoint(GraphMLParseContext context,
String id,
Object node,
Object port,
int type)
createEndPoint in interface GraphElementFactorycontext - the current parse context.id - the identifier of the endpoint as defined in the
input data. May be null if no
id has been specified.node - the user object representing the associated
node of the endpoint.type - the direction type of the endpoint.
null
public void defineAttribute(String name,
int contentType,
int scopeType)
AttributeFactory
defineAttribute in interface AttributeFactoryname - the name of the attributecontentType - one of AttributeConstants.TYPE_INT,
AttributeConstants.TYPE_LONG,
AttributeConstants.TYPE_FLOAT,
AttributeConstants.TYPE_DOUBLE,
AttributeConstants.TYPE_STRING,
AttributeConstants.TYPE_BOOLEAN.
public void createAttribute(GraphMLParseContext context,
String name,
String value)
AttributeFactory
createAttribute in interface AttributeFactorycontext - the context in which the parser is.name - the name of the attribute.value - the value of the attribute.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||