Search this API

y.io.graphml.input
Class DefaultGraphElementFactory

java.lang.Object
  extended by y.io.graphml.input.DefaultGraphElementFactory
All Implemented Interfaces:
GraphElementFactory

public class DefaultGraphElementFactory
extends java.lang.Object
implements GraphElementFactory

The basic implementation of the GraphElementFactory interface for use with the default Graphs.

This uses the CreationProperties from the GraphMLParseContext to create the items with the correct initial values if they have been put into the creation properties by InputHandler implementations that have been invoked before the creation of the items.

 

Constructor Summary
DefaultGraphElementFactory()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGraphElementFactory

public DefaultGraphElementFactory()
Method Detail

createNode

public Node createNode(GraphMLParseContext context)
Description copied from interface: GraphElementFactory
Creates a node for the given context.

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

createEdge

public Edge createEdge(GraphMLParseContext context,
                       Node sourceNode,
                       Port sourcePort,
                       Node targetNode,
                       Port targetPort)
Description copied from interface: GraphElementFactory
Creates an edge for the given context and the provided source and target nodes or ports.

Specified by:
createEdge in interface GraphElementFactory
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

public Port createPort(GraphMLParseContext context,
                       Node owner)
Description copied from interface: GraphElementFactory
Creates a port object that is owned by owner

Specified by:
createPort in interface GraphElementFactory
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.