Packagecom.yworks.io.graphml.realizer
Classpublic class ReadLabelRealizerHandler
InheritanceReadLabelRealizerHandler Inheritance AbstractInputHandler

Input handler that delegates deserialization to IRealizerSerializer instances.



Public Methods
 MethodDefined by
  
acceptKey(keyElement:XML, scopeType:String):Boolean
This method defines whether a specific key/data pair is handled by the input handler.
ReadLabelRealizerHandler
 Inherited
applyDefault(context:GraphMLParseContext, defaultElement:XML, value:Object):void
This method is invoked when no data tag is defined, and the default value should be applied.
AbstractInputHandler
  
parseData(context:GraphMLParseContext, defaultValue:Boolean, dataElement:XML):void
Parse a GraphML data element and delegate label element parsing to parseItemData

This implementation first tries to find the IRealizerSerializer for the current element.

ReadLabelRealizerHandler
 Inherited
parseDefaultData(context:GraphMLParseContext, keyElement:XML):Object
This method is invoked when the default value of the key element for a data element is parsed.
AbstractInputHandler
Protected Methods
 MethodDefined by
  
parseItemData(context:GraphMLParseContext, graph:IGraph, item:Object, defaultMode:Boolean, labelElement:XML):void
Parse the element for the given item.
ReadLabelRealizerHandler
  
parseRealizer(graph:IGraph, label:ILabel, element:XML, context:GraphMLParseContext):ILabelStyle
Parse a GraphML label element
ReadLabelRealizerHandler
Method detail
acceptKey()method
public override function acceptKey(keyElement:XML, scopeType:String):Boolean

This method defines whether a specific key/data pair is handled by the input handler. When it returns true, each occurence of data elements which match the id of the key element are forwarded to the input handler.

Parameters
keyElement:XML — the key element
 
scopeType:String — the scope type for which the key is defined.

One of

  • GraphMLConstants.SCOPE_ALL
  • GraphMLConstants.SCOPE_GRAPH
  • GraphMLConstants.SCOPE_NODE
  • GraphMLConstants.SCOPE_EDGE
  • GraphMLConstants.SCOPE_PORT

Returns
Booleantrue, if this hanlder can handle the data elements asked for.
parseData()method 
public override function parseData(context:GraphMLParseContext, defaultValue:Boolean, dataElement:XML):void

Parse a GraphML data element and delegate label element parsing to parseItemData

This implementation first tries to find the IRealizerSerializer for the current element. If a realizer serializer is found and it implements ILabelElementSelector, the list of label elements is queried from the realizer serializer. Else, all NodeLabel or EdgeLabel elments are parsed.

Parameters
context:GraphMLParseContext — The current parse context
 
defaultValue:Boolean — whether the default value is being parsed.
 
dataElement:XML — A GraphML data element

See also

parseItemData()method 
protected override function parseItemData(context:GraphMLParseContext, graph:IGraph, item:Object, defaultMode:Boolean, labelElement:XML):void

Parse the element for the given item.

Parameters
context:GraphMLParseContext — The parse context
 
graph:IGraph — The graph to work on
 
item:Object — The item.
 
defaultMode:Booleantrue when the default value, which is included in the key element, is processed, false otherwise.
 
labelElement:XML — The data element of the graphml file.
parseRealizer()method 
protected function parseRealizer(graph:IGraph, label:ILabel, element:XML, context:GraphMLParseContext):ILabelStyle

Parse a GraphML label element

Parameters
graph:IGraph — The current graph instance
 
label:ILabel — The label instance
 
element:XML — A GraphML NodeLabel or EdgeLabel element
 
context:GraphMLParseContext — The current parse context.

Returns
ILabelStyle — A label style created by an ILabelSerializer instance.