Packagecom.yworks.io.graphml.realizer
Classpublic class ShapeNodeStyleRealizerSerializer
InheritanceShapeNodeStyleRealizerSerializer Inheritance AbstractNodeRealizerSerializer Inheritance Object

An IRealizerSerializer that can read y:ShapeNode elements written by yFiles Java and write ShapeNodeStyle instances into y:ShapeNode elements readable by yFiles Java.



Public Properties
 PropertyDefined By
  instance : ShapeNodeStyleRealizerSerializer
[static] [read-only] The shared instance.
ShapeNodeStyleRealizerSerializer
Public Methods
 MethodDefined By
 Inherited
canRead(node:XML, context:GraphMLParseContext):Boolean
Whether this instance can deserialize the given xml element in the given context.
AbstractNodeRealizerSerializer
  
canWrite(node:INode, context:GraphMLWriteContext):Boolean
[override] Whether this instance can serialize the style of the given node in the given context.
ShapeNodeStyleRealizerSerializer
 Inherited
Create a style instance that can represent the node graphics information of the given xml element.
AbstractNodeRealizerSerializer
  
getElementName(item:Object):String
[override] Returns the name of the element that will be written by this serializer given the provided item.
ShapeNodeStyleRealizerSerializer
  
[override] Returns the names of all XML elements that can be parsed or written by this serializer.
ShapeNodeStyleRealizerSerializer
 Inherited
getNamespace():Namespace
Returns GraphMLConstants.YWORKS_EXT_NS.
AbstractNodeRealizerSerializer
  
[override] Returns the style class that can be serialized or deserialized by this instance.
ShapeNodeStyleRealizerSerializer
  
parse(style:INodeStyle, layout:IMutableRectangle, element:XML, context:GraphMLParseContext):void
[override] Parses a serialized yFiles Java node realizer into the given style.
ShapeNodeStyleRealizerSerializer
  
write(node:INode, writer:IXmlWriter, context:GraphMLWriteContext):void
[override] Write the given node style in a format that can be parsed into a node realizer by yFiles Java.
ShapeNodeStyleRealizerSerializer
 Inherited
Write the attributes of the realizer xml element
AbstractNodeRealizerSerializer
Protected Methods
 MethodDefined By
  
parseBorderStyle(style:ShapeNodeStyle, borderStyleElement:XML, context:GraphMLParseContext):void
Parse a GraphML border style element
ShapeNodeStyleRealizerSerializer
  
parseFill(style:ShapeNodeStyle, fillElement:XML, context:GraphMLParseContext):void
Parse a GraphML fill element
ShapeNodeStyleRealizerSerializer
  
parseShape(style:ShapeNodeStyle, shapeElement:XML, context:GraphMLParseContext):void
Parse a GraphML shape element
ShapeNodeStyleRealizerSerializer
  
shape2String(shape:uint):String
Gets a String for serialization from an integer id
ShapeNodeStyleRealizerSerializer
  
string2Shape(string:String):Object
Gets an integer id (as defined in ShapeNodeShape) for a serialization String.
ShapeNodeStyleRealizerSerializer
Property Detail
instanceproperty
instance:ShapeNodeStyleRealizerSerializer  [read-only]

The shared instance.


Implementation
    public static function get instance():ShapeNodeStyleRealizerSerializer
Method Detail
canWrite()method
override public function canWrite(node:INode, context:GraphMLWriteContext):Boolean

Whether this instance can serialize the style of the given node in the given context.

Parameters

node:INode — The node.
 
context:GraphMLWriteContext — The write context.

Returns
Booleantrue if this instance can serialize the given node's style.
getElementName()method 
override public function getElementName(item:Object):String

Returns the name of the element that will be written by this serializer given the provided item.

Parameters

item:Object

Returns
String — the name of the item
getElementNames()method 
override public function getElementNames():Array

Returns the names of all XML elements that can be parsed or written by this serializer.

Returns
Array — The names of all xml elements this serializer can handle as Array.
getStyleClass()method 
override public function getStyleClass():Class

Returns the style class that can be serialized or deserialized by this instance.

Returns
Class — The class that can be serialized by this instance.
parse()method 
override public function parse(style:INodeStyle, layout:IMutableRectangle, element:XML, context:GraphMLParseContext):void

Parses a serialized yFiles Java node realizer into the given style.

Parameters

style:INodeStyle — A node style that is used to display the appearance of the yFiles Java node realizer.
 
layout:IMutableRectangle — A mutable rectangle that will be set to the bounds of the parsed realizer.
 
element:XML — the graphml node element
 
context:GraphMLParseContext — the current parsing context

parseBorderStyle()method 
protected function parseBorderStyle(style:ShapeNodeStyle, borderStyleElement:XML, context:GraphMLParseContext):void

Parse a GraphML border style element

Parameters

style:ShapeNodeStyle — The ShapeNodeStyle instance to write the parameters to.
 
borderStyleElement:XML — The xml element to parse.
 
context:GraphMLParseContext — The parse context.

parseFill()method 
protected function parseFill(style:ShapeNodeStyle, fillElement:XML, context:GraphMLParseContext):void

Parse a GraphML fill element

Parameters

style:ShapeNodeStyle — The ShapeNodeStyle instance to write the parameters to.
 
fillElement:XML — The xml element to parse.
 
context:GraphMLParseContext — The parse context.

parseShape()method 
protected function parseShape(style:ShapeNodeStyle, shapeElement:XML, context:GraphMLParseContext):void

Parse a GraphML shape element

Parameters

style:ShapeNodeStyle — The ShapeNodeStyle instance to write the parameters to.
 
shapeElement:XML — The xml element to parse.
 
context:GraphMLParseContext — The parse context.

shape2String()method 
protected function shape2String(shape:uint):String

Gets a String for serialization from an integer id

Parameters

shape:uint — The integer id of the shape as defined in ShapeNodeShape

Returns
String — The serialization String
string2Shape()method 
protected function string2Shape(string:String):Object

Gets an integer id (as defined in ShapeNodeShape) for a serialization String.

Parameters

string:String — The serialization String.

Returns
Object — The integer id of the shape as defined in ShapeNodeShape
write()method 
override public function write(node:INode, writer:IXmlWriter, context:GraphMLWriteContext):void

Write the given node style in a format that can be parsed into a node realizer by yFiles Java.

Parameters

node:INode — node whose style can be serialized to a format that can be read by yFiles Java.
 
writer:IXmlWriter — The xml writer
 
context:GraphMLWriteContext — The current write context.