Packagecom.yworks.io.graphml.realizer
Classpublic class ProxyNodeRealizerSerializer
InheritanceProxyNodeRealizerSerializer Inheritance AbstractJavaNodeRealizerSerializer Inheritance Object
Implements ILabelElementSelector, IInactiveLabelElementSelector

A realizer serializer that parses yFiles Java ProxyShapeNodeRealizer and ProxyAutoBoundsNodeRealizer instances.

There are no corresponding proxy node styles in yFiles FLEX. Instead, this implementation tries to find a suitable realizer serializer for the currently active realizer of the proxy realizer and delegates the actual parsing to that serializer.



Public Properties
 PropertyDefined By
  instance : ProxyNodeRealizerSerializer
[static] [read-only] Returns the shared instance of the realizer serializer.
ProxyNodeRealizerSerializer
Public Methods
 MethodDefined By
 Inherited
canRead(node:XML, context:GraphMLParseContext):Boolean
Whether this instance can deserialize the given xml element in the given context.
AbstractJavaNodeRealizerSerializer
 Inherited
canWrite(node:INode, context:GraphMLWriteContext):Boolean
Whether this instance can serialize the style of the given node in the given context.
AbstractJavaNodeRealizerSerializer
  
[override] This implementation tries to find a realizer serializer for the currently active realizer of the proxy realizer.
ProxyNodeRealizerSerializer
 Inherited
getElementName(item:Object):String
Returns the name of the element that will be written by this serializer given the provided item.
AbstractJavaNodeRealizerSerializer
  
[override] This realizer serializer will parse both ProxyShapeNodeRealizer and ProxyAutoBoundsNodeRealizer instances.
ProxyNodeRealizerSerializer
 Inherited
getNamespace():Namespace
Returns the namespace of the element this serilaizer writes.
AbstractJavaNodeRealizerSerializer
  
[override] Always returns null, beacuse this realizer serializer can only read realiers.
ProxyNodeRealizerSerializer
  
parse(style:INodeStyle, layout:IMutableRectangle, element:XML, context:GraphMLParseContext):void
[override] Tries to find a realizer serializers for the active and inactive realizer of the proxy realizer.
ProxyNodeRealizerSerializer
  
selectInactiveLabelElements(context:GraphMLParseContext, defaultValue:Boolean, dataElement:XML):XMLList
Returns all child NodeLabel elements of the collapsed realizer element.
ProxyNodeRealizerSerializer
  
selectLabelElements(context:GraphMLParseContext, defaultValue:Boolean, dataElement:XML):XMLList
Returns all child NodeLabel elements of the expanded realizer element.
ProxyNodeRealizerSerializer
  
write(node:INode, writer:IXmlWriter, context:GraphMLWriteContext):void
[override] Because only the active realizer of all yFiles Java proxy realizers is parsed, serialization is handled by the serializers for style instances representing the active realizers.
ProxyNodeRealizerSerializer
 Inherited
Write the attributes of the realizer xml element
AbstractJavaNodeRealizerSerializer
Protected Methods
 MethodDefined By
  
Create the default style instance that is used if no realizer serializer is found for the currently active realizer of the proxy realizer.
ProxyNodeRealizerSerializer
 Inherited
Writes the fill style into the XML writer.
AbstractJavaNodeRealizerSerializer
Property Detail
instanceproperty
instance:ProxyNodeRealizerSerializer  [read-only]

Returns the shared instance of the realizer serializer.


Implementation
    public static function get instance():ProxyNodeRealizerSerializer
Method Detail
createDefaultStyle()method
protected function createDefaultStyle(element:XML, context:GraphMLParseContext):INodeStyle

Create the default style instance that is used if no realizer serializer is found for the currently active realizer of the proxy realizer.

The default implementation returns an instance of JavaShapeNodeStyle.

Parameters

element:XML — The current XML element.
 
context:GraphMLParseContext — The current parse context

Returns
INodeStyle — A node style instance.
createStyleInstance()method 
override public function createStyleInstance(element:XML, context:GraphMLParseContext):INodeStyle

This implementation tries to find a realizer serializer for the currently active realizer of the proxy realizer. Style creation will be delegated to the realizer serializer of the active realizer, if such a serializer is available. Else, An instance returned by createDefaultStyle is used.

Parameters

element:XML — The current XML element.
 
context:GraphMLParseContext — The current parse context

Returns
INodeStyle — A style instance for the node element that is being parsed.

See also

getElementNames()method 
override public function getElementNames():Array

This realizer serializer will parse both ProxyShapeNodeRealizer and ProxyAutoBoundsNodeRealizer instances.

Returns
Array
getStyleClass()method 
override public function getStyleClass():Class

Always returns null, beacuse this realizer serializer can only read realiers.

Returns
Class
parse()method 
override public function parse(style:INodeStyle, layout:IMutableRectangle, element:XML, context:GraphMLParseContext):void

Tries to find a realizer serializers for the active and inactive realizer of the proxy realizer. If such serializers are found, parsing is delgated to those instances.

The representation of the expanded state of the node is assigned to the given style while the collapsed style is set in the IChangeDummyNodeAppearanceCallback of the node if a FoldingManager is found in the lookup of the graph.

Parameters

style:INodeStyle — The style instance that represents the currenlty active realizer instance of the proxy realizer.
 
layout:IMutableRectangle — The node layout.
 
element:XML — The proxy realizer XML element
 
context:GraphMLParseContext — The current parse context.

selectInactiveLabelElements()method 
public function selectInactiveLabelElements(context:GraphMLParseContext, defaultValue:Boolean, dataElement:XML):XMLList

Returns all child NodeLabel elements of the collapsed realizer element.

Parameters

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

Returns
XMLList — All child NodeLabel elements of the collapsed realizer element.
selectLabelElements()method 
public function selectLabelElements(context:GraphMLParseContext, defaultValue:Boolean, dataElement:XML):XMLList

Returns all child NodeLabel elements of the expanded realizer element.

Parameters

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

Returns
XMLList — All child NodeLabel elements of the expanded realizer element.
write()method 
override public function write(node:INode, writer:IXmlWriter, context:GraphMLWriteContext):void

Because only the active realizer of all yFiles Java proxy realizers is parsed, serialization is handled by the serializers for style instances representing the active realizers. Therefore, this implementation is empty.

Parameters

node:INode — The node that is to be serialized
 
writer:IXmlWriter — The xml writer
 
context:GraphMLWriteContext — The current write context