Search this API

y.io.graphml.input
Interface GraphElementFactory

All Known Implementing Classes:
DefaultGraphElementFactory, Graph2DElementFactory, GroupingBasedGraphElementFactory, HierarchyManagerBasedGraphElementFactory

public interface GraphElementFactory

This is the interface for a factory that is used for creating the constituents of an Graph that are encountered during the parsing of GraphMLParser

See Also:
GraphMLHandler.createGraphElementFactory(GraphMLParser, y.base.Graph)
 

Method Summary
 Edge createEdge(GraphMLParseContext context, Node sourceNode, Port sourcePort, Node targetNode, Port targetPort)
          Creates an edge for the given context and the provided source and target nodes or ports.
 Node createNode(GraphMLParseContext context)
          Creates a node for the given context.
 Port createPort(GraphMLParseContext context, Node owner)
          Creates a port object that is owned by owner
 

Method Detail

createNode

Node createNode(GraphMLParseContext context)
Creates a node for the given context.

Parameters:
context - The context from which the graph, the CreationProperties, and the GraphMLParseContext.getObjectStack() can be queried.
Returns:
A newly created node

createEdge

Edge createEdge(GraphMLParseContext context,
                Node sourceNode,
                Port sourcePort,
                Node targetNode,
                Port targetPort)
Creates an edge for the given context and the provided source and target nodes or ports.

Parameters:
context - The context from which the graph, the CreationProperties, and the GraphMLParseContext.getObjectStack() can be queried.
sourceNode - The source node for the edge.
sourcePort - The source port for the edge, if specified, otherwise null.
targetNode - The target node for the edge.
targetPort - The target port for the edge, if specified, otherwise null.
Returns:
A newly created edge.

createPort

Port createPort(GraphMLParseContext context,
                Node owner)
Creates a port object that is owned by owner

Parameters:
context - The context from which the graph, the CreationProperties, and the GraphMLParseContext.getObjectStack() can be queried.
owner - The owner of the port object
Returns:
a new port object, or null if ports are not supported

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.