Search this API

y.io.graphml.graph2d
Class Graph2DElementFactory

java.lang.Object
  extended by y.io.graphml.graph2d.Graph2DElementFactory
All Implemented Interfaces:
GraphElementFactory

public class Graph2DElementFactory
extends java.lang.Object
implements GraphElementFactory

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

This implementation does not create any hierarchy information, you should use a decoration implementation like HierarchyManagerBasedGraphElementFactory instead.

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.

 
Your browser does not support SVG content.

Constructor Summary
Graph2DElementFactory()
           
 
Method Summary
 Edge createEdge(GraphMLParseContext context, Node sourceNode, Port sourcePort, Node targetNode, Port targetPort)
          Creates an normal edge for the given context and the provided source and target nodes or ports.
 Node createNode(GraphMLParseContext context)
          Creates and configures a normal node for the given context.
 Port createPort(GraphMLParseContext context, Node owner)
          Creates NodePort instances that are bound to the specified node's visual representation (its NodeRealizer).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graph2DElementFactory

public Graph2DElementFactory()
Method Detail

createNode

public Node createNode(GraphMLParseContext context)
Creates and configures a normal node for the given context.

This implementation uses node realizer and layout information from the context if available

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)
Creates an normal edge for the given context and the provided source and target nodes or ports.

This implementation uses edge realizer and layout information from the context if available

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)
Creates NodePort instances that are bound to the specified node's visual representation (its NodeRealizer).

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 NodePort.

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