Packagecom.yworks.io.graphml.reader
Classpublic class DefaultGraphElementFactory
InheritanceDefaultGraphElementFactory Inheritance Object
Implements IGraphItemFactory

Default implementation of the IGraphItemFactory interface.



Public Properties
 PropertyDefined By
  clearGraphBeforeRead : Boolean
Whether to clear an existing graph instance before reading If set to true, an exisisting graph instance will be cleared before the graph is read into this instance, otherwise the loaded raph will be merged into the existing one.
DefaultGraphElementFactory
Protected Properties
 PropertyDefined By
  _createdGraph : IGraph
Graph instance to work on.
DefaultGraphElementFactory
Public Methods
 MethodDefined By
  
Creates an element factory for the given graph instance.
DefaultGraphElementFactory
  
createBend(context:GraphMLParseContext, edge:Object, index:int):Object
Returns a user object which represents a bend.
DefaultGraphElementFactory
  
createEdge(context:GraphMLParseContext, id:String, source:Object, target:Object, sourcePort:Object, targetPort:Object, directed:Boolean):Object
Returns a user object representing an edge.
DefaultGraphElementFactory
  
createGraph(context:GraphMLParseContext, id:String, edgeDefault:String):Object
Returns a user object which represents a graph.
DefaultGraphElementFactory
  
Returns null.
DefaultGraphElementFactory
  
createLabel(context:GraphMLParseContext, labeledItem:Object):Object
Returns a user object which represents a label.
DefaultGraphElementFactory
  
createNode(context:GraphMLParseContext, id:String):Object
Returns a user object which represents a node.
DefaultGraphElementFactory
  
createPort(context:GraphMLParseContext, name:String, owner:Object):Object
Returns a user object which represents a port.
DefaultGraphElementFactory
Protected Methods
 MethodDefined By
  
Gets the IGraph from the context.
DefaultGraphElementFactory
Property Detail
_createdGraphproperty
protected var _createdGraph:IGraph

Graph instance to work on.

clearGraphBeforeReadproperty 
clearGraphBeforeRead:Boolean

Whether to clear an existing graph instance before reading

If set to true, an exisisting graph instance will be cleared before the graph is read into this instance, otherwise the loaded raph will be merged into the existing one.


Implementation
    public function get clearGraphBeforeRead():Boolean
    public function set clearGraphBeforeRead(value:Boolean):void
Constructor Detail
DefaultGraphElementFactory()Constructor
public function DefaultGraphElementFactory(graph:IGraph)

Creates an element factory for the given graph instance.

Parameters
graph:IGraph — The graph instance to work on. Creates a new instance if none is provided.
Method Detail
createBend()method
public function createBend(context:GraphMLParseContext, edge:Object, index:int):Object

Returns a user object which represents a bend.

Parameters

context:GraphMLParseContext — The current parse context.
 
edge:Object — The edge to create the bend for.
 
index:int

Returns
Object — a newly created bend.
createEdge()method 
public function createEdge(context:GraphMLParseContext, id:String, source:Object, target:Object, sourcePort:Object, targetPort:Object, directed:Boolean):Object

Returns a user object representing an edge.

Parameters

context:GraphMLParseContext — the current parse context.
 
id:String — the identifier of the edge as defined in the input data. May be null if no id has been specified.
 
source:Object — the user object representing the source node of the edge.
 
target:Object — the user object representing the target node of the edge.
 
sourcePort:Object — the user object representing the source port of the edge.
 
targetPort:Object — the user object representing the target port of the edge.
 
directed:Boolean — indicates whether the edge is directed or not.

Returns
Object — a user object representing an edge.
createGraph()method 
public function createGraph(context:GraphMLParseContext, id:String, edgeDefault:String):Object

Returns a user object which represents a graph.

Parameters

context:GraphMLParseContext — the current parse context.
 
id:String — the identifier of the graph as defined in the input data. May be null if no id has been specified.
 
edgeDefault:String — indicates whether edges are directed per default.

Returns
Object — a user object representing a graph.
createGraphML()method 
public function createGraphML(context:GraphMLParseContext):Object

Returns null.

Parameters

context:GraphMLParseContext

Returns
Object
createLabel()method 
public function createLabel(context:GraphMLParseContext, labeledItem:Object):Object

Returns a user object which represents a label.

Parameters

context:GraphMLParseContext — the current parse context.
 
labeledItem:Object — the label owner

Returns
Object — a user object representing a label.
createNode()method 
public function createNode(context:GraphMLParseContext, id:String):Object

Returns a user object which represents a node.

Parameters

context:GraphMLParseContext
 
id:String — the identifier of the node as defined in the input data.

Returns
Object — a user object representing a node.
createPort()method 
public function createPort(context:GraphMLParseContext, name:String, owner:Object):Object

Returns a user object which represents a port.

Parameters

context:GraphMLParseContext — the current parse context.
 
name:String — the identifier of the port as defined in the input data.
 
owner:Object — the port owner

Returns
Object — a user object representing a port.
getLastContainer()method 
protected function getLastContainer(context:GraphMLParseContext):IGraph

Gets the IGraph from the context.

Parameters

context:GraphMLParseContext — the current GraphMLParseContext

Returns
IGraph — the IGraph from the context.