Search this API

y.io.graphml.graph2d
Class PortConstraintInputHandler

java.lang.Object
  extended by y.io.graphml.graph2d.PortConstraintInputHandler
All Implemented Interfaces:
InputHandler

public class PortConstraintInputHandler
extends java.lang.Object
implements InputHandler

Input handler responsible for parsing PortConstraint data. Port constraint data includes source and target port constraints, as well as source group and target group IDs. These data will be attached to the edges of the graph by registering data providers using the following standard look-up keys for port constraints:

 
Your browser does not support SVG content.

Constructor Summary
PortConstraintInputHandler()
           
 
Method Summary
 boolean acceptKey(org.w3c.dom.Element keyDefinition)
          Accepts keys at edge scope whose attribute yfiles.type has the value portconstraints.
 void applyDefault(GraphMLParseContext context)
          This method is invoked when no data tag is defined, and the default value should be applied.
protected  DataAcceptor getDataAcceptor(Graph graph, java.lang.Object dpKey)
           
static ObjectStringConverter getEdgeGroupIDConverter(ObjectStringConverter c)
          Returns the converter that is responsible for converting the string representation of a source or target group id to an object.
 ParsePrecedence getPrecedence()
          Gets the parse precedence that is associated with this instance.
 void parseData(GraphMLParseContext context, org.w3c.dom.Node node)
          This method is invoked each time a data element with matching key is processed.
static void setEdgeGroupIDConverter(ObjectStringConverter c)
          Sets the converter that is responsible for converting the string representation of a source or target group id to an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortConstraintInputHandler

public PortConstraintInputHandler()
Method Detail

setEdgeGroupIDConverter

public static void setEdgeGroupIDConverter(ObjectStringConverter c)
Sets the converter that is responsible for converting the string representation of a source or target group id to an object. If no converter is set, the string representation itself will be used as ID.


getEdgeGroupIDConverter

public static ObjectStringConverter getEdgeGroupIDConverter(ObjectStringConverter c)
Returns the converter that is responsible for converting the string representation of a source or target group id to an object. If no converter is set, the string representation itself will be used as ID.


acceptKey

public boolean acceptKey(org.w3c.dom.Element keyDefinition)
Accepts keys at edge scope whose attribute yfiles.type has the value portconstraints.


getDataAcceptor

protected DataAcceptor getDataAcceptor(Graph graph,
                                       java.lang.Object dpKey)

getPrecedence

public ParsePrecedence getPrecedence()
Description copied from interface: InputHandler
Gets the parse precedence that is associated with this instance.

Specified by:
getPrecedence in interface InputHandler
Returns:
The parse precedence for this instance.

parseData

public void parseData(GraphMLParseContext context,
                      org.w3c.dom.Node node)
               throws GraphMLParseException
Description copied from interface: InputHandler
This method is invoked each time a data element with matching key is processed.

Specified by:
parseData in interface InputHandler
Parameters:
context - the current parse context.
node - the DOM node representing the data element.
Throws:
GraphMLParseException

applyDefault

public void applyDefault(GraphMLParseContext context)
                  throws GraphMLParseException
Description copied from interface: InputHandler
This method is invoked when no data tag is defined, and the default value should be applied.

Specified by:
applyDefault in interface InputHandler
Parameters:
context - the current parse context.
Throws:
GraphMLParseException

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.