com.yworks.yfiles.server.graphml.flexio
Class LabelDeserializer

java.lang.Object
  extended byy.io.graphml.input.AbstractDeserializer
      extended bycom.yworks.yfiles.server.graphml.flexio.deserializer.AbstractDeserializer
          extended bycom.yworks.yfiles.server.graphml.flexio.LabelDeserializer
All Implemented Interfaces:
DeserializationHandler, java.util.EventListener

public class LabelDeserializer
extends AbstractDeserializer

This class manages the deserialization of labels in the graphml input.

The input handler will parse the xml element that represents the list of labels for a graph item and store the List of deserialized Label instances in a data provider registered with the graph.

To deserialize a custom style or custom model parameter, corresponding deserializer instances can be registered. These deserializers will be used automatically by this handler.


Constructor Summary
LabelDeserializer()
           
 
Method Summary
 boolean canHandle(DeserializationEvent e)
          Returns true if DeserializationEvent.getXmlNode() satisfies the properties of this class.
protected  Label createLabel(java.lang.String labelText, ILabelModelParameter parameter, YDimension preferredSize, ILabelStyle style)
          Create a label instance
 java.lang.Object deserializeNode(org.w3c.dom.Node xmlNode, GraphMLParseContext context)
           
 java.lang.String getElementName(GraphMLParseContext context)
          The local name that the node must satisfy if it should be deserialized.
 
Methods inherited from class com.yworks.yfiles.server.graphml.flexio.deserializer.AbstractDeserializer
getXmlNamespaceURI, onHandleDeserialization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelDeserializer

public LabelDeserializer()
Method Detail

canHandle

public boolean canHandle(DeserializationEvent e)
Returns true if DeserializationEvent.getXmlNode() satisfies the properties of this class.

Overrides:
canHandle in class AbstractDeserializer
Parameters:
e - The event data.
Returns:
true
See Also:
AbstractDeserializer.getElementName(y.io.graphml.input.GraphMLParseContext)

getElementName

public java.lang.String getElementName(GraphMLParseContext context)
The local name that the node must satisfy if it should be deserialized. This method is called by canHandle(y.io.graphml.input.DeserializationEvent).

Specified by:
getElementName in class AbstractDeserializer
Parameters:
context - The parse context.
Returns:
'labels'.

deserializeNode

public java.lang.Object deserializeNode(org.w3c.dom.Node xmlNode,
                                        GraphMLParseContext context)
                                 throws GraphMLParseException
Throws:
GraphMLParseException

createLabel

protected Label createLabel(java.lang.String labelText,
                            ILabelModelParameter parameter,
                            YDimension preferredSize,
                            ILabelStyle style)
Create a label instance

Parameters:
labelText - The label text
parameter - The model parameter that determine the label's placement
preferredSize - The preferred size of the label
style - The style that determines the visual representation of the label
Returns:
A new Label instance with the provided properties.


Copyright © 2000-2007 yWorks GmbH. All rights reserved