com.yworks.yfiles.server.graphml.support
Class LabelCompatInputHandler

java.lang.Object
  extended byy.io.graphml.input.AbstractInputHandler
      extended bycom.yworks.yfiles.server.graphml.flexio.AbstractInputHandlerProvider
          extended bycom.yworks.yfiles.server.graphml.support.LabelCompatInputHandler
All Implemented Interfaces:
java.util.EventListener, InputHandler, InputHandlerProvider

public class LabelCompatInputHandler
extends AbstractInputHandlerProvider

Input Handler that tries to create the corresponding yFiles Java label models for all labels in a <Labels> element.

This will work for the slider- and free edge label models and for the discrete (interior and exterior) node label models.

See Also:
LabelCompatOutputHandler

Constructor Summary
LabelCompatInputHandler()
           
 
Method Summary
 boolean acceptKey(org.w3c.dom.Element keyDefinition)
          This method is called by AbstractInputHandlerProvider.onQueryInputHandler(y.io.graphml.input.QueryInputHandlersEvent) and shall decide if the given keyDefinition shall be accepted so that this input handler gets provided for the event.
protected  EdgeLabelModel createDefaultEdgeLabelModel(GraphMLParseContext context, Edge edge, org.w3c.dom.Node node)
          Create the default edge label model that will be used if a parsed edge label model cannot be mapped to a yFiles Java edge label model.
protected  NodeLabelModel createDefaultNodeLabelModel(GraphMLParseContext context, Node graphNode, org.w3c.dom.Node node)
          Create the default node label model that will be used if a parsed node label model cannot be mapped to a yFiles Java node label model.
protected  EdgeLabelLayoutImpl createEdgeLabelLayout(GraphMLParseContext context, DefaultLayoutGraph graph, Edge graphEdge, org.w3c.dom.Node node)
          Create the EdgeLabelLayoutImpl instance that defines the label layout for the given graph edge.
protected  NodeLabelLayoutImpl createNodeLabelLayout(GraphMLParseContext context, DefaultLayoutGraph graph, Node graphNode, org.w3c.dom.Node node)
          Create the NodeLabelLayoutImpl instance that defines the label layout for the given graph node.
protected  java.lang.Object parseDataCore(GraphMLParseContext context, org.w3c.dom.Node node)
           
protected  void setValue(GraphMLParseContext context, java.lang.Object key, java.lang.Object data)
           
 
Methods inherited from class com.yworks.yfiles.server.graphml.flexio.AbstractInputHandlerProvider
onQueryInputHandler
 
Methods inherited from class y.io.graphml.input.AbstractInputHandler
applyDefault, getDefaultValue, getPrecedence, getValidScopes, initializeFromKeyDefinition, isDefaultExists, isParseDefaultValue, parseData, setDefaultExists, setDefaultValue, setParseDefaultValue, setPrecedence, setValidScopes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelCompatInputHandler

public LabelCompatInputHandler()
Method Detail

setValue

protected void setValue(GraphMLParseContext context,
                        java.lang.Object key,
                        java.lang.Object data)
                 throws GraphMLParseException
Throws:
GraphMLParseException

parseDataCore

protected java.lang.Object parseDataCore(GraphMLParseContext context,
                                         org.w3c.dom.Node node)
                                  throws GraphMLParseException
Throws:
GraphMLParseException

createDefaultEdgeLabelModel

protected EdgeLabelModel createDefaultEdgeLabelModel(GraphMLParseContext context,
                                                     Edge edge,
                                                     org.w3c.dom.Node node)
Create the default edge label model that will be used if a parsed edge label model cannot be mapped to a yFiles Java edge label model. This method will create an edge label model instance that provides an empty label candidates list.

Parameters:
context - The current parse context.
edge - The current edge.
node - The current XML node.
Returns:
An EdgeLabelModel instance.

createDefaultNodeLabelModel

protected NodeLabelModel createDefaultNodeLabelModel(GraphMLParseContext context,
                                                     Node graphNode,
                                                     org.w3c.dom.Node node)
Create the default node label model that will be used if a parsed node label model cannot be mapped to a yFiles Java node label model. This method will create a label model instance that provides an empty label candidates list.

Parameters:
context - The current parse context.
graphNode - The current node.
node - The current XML node.
Returns:
An NodeLabelModel instance.

createEdgeLabelLayout

protected EdgeLabelLayoutImpl createEdgeLabelLayout(GraphMLParseContext context,
                                                    DefaultLayoutGraph graph,
                                                    Edge graphEdge,
                                                    org.w3c.dom.Node node)
Create the EdgeLabelLayoutImpl instance that defines the label layout for the given graph edge.

Parameters:
context - The current parse context.
graph - The graph the graphEdge belongs to.
graphEdge - The graphEdge that is currently being parsed.
node - The current XML node.
Returns:
An EdgeLabelLayoutImpl instance.

createNodeLabelLayout

protected NodeLabelLayoutImpl createNodeLabelLayout(GraphMLParseContext context,
                                                    DefaultLayoutGraph graph,
                                                    Node graphNode,
                                                    org.w3c.dom.Node node)
Create the NodeLabelLayoutImpl instance that defines the label layout for the given graph node.

Parameters:
context - The current parse context.
graph - The graph the graphNode belongs to.
graphNode - The graphNode that is currently being parsed.
node - The current XML node.
Returns:
A NodeLabelLayoutImpl instance.

acceptKey

public boolean acceptKey(org.w3c.dom.Element keyDefinition)
This method is called by AbstractInputHandlerProvider.onQueryInputHandler(y.io.graphml.input.QueryInputHandlersEvent) and shall decide if the given keyDefinition shall be accepted so that this input handler gets provided for the event.

Specified by:
acceptKey in class AbstractInputHandlerProvider
Parameters:
keyDefinition - The key definition to check.
Returns:
true if the key definition matches name 'labels' and has either scope KeyScope.NODE or scope KeyScope.EDGE.
See Also:
KeyScope


Copyright © 2000-2013 yWorks GmbH. All rights reserved