yext.graphml.graph2D
Class PortConstraintInputHandler

java.lang.Object
  extended byyext.graphml.reader.AbstractDOMInputHandler
      extended byyext.graphml.graph2D.PortConstraintInputHandler
All Implemented Interfaces:
DOMInputHandler

public class PortConstraintInputHandler
extends AbstractDOMInputHandler

Input handler responsible for parsing PortConstraint data. Port contraint 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 contraints:

If a data provider for one of these keys is already present and also writable (i.e., implementing interface DataAcceptor) then this data provider will be used to store the corresponding values. In all other cases a newly created DataProvider will be registered and used.


Constructor Summary
PortConstraintInputHandler()
           
 
Method Summary
 boolean acceptKey(NamedNodeMap map, int scopeType)
          Accepts keys at edge scope whose attribute yfiles.type has the value portconstraints.
protected  void applyDefault(DOMGraphMLParseContext context, Graph graph, Object nodeedge)
          Does nothing yet.
protected  DataAcceptor getDataAcceptor(Graph graph, 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.
protected  void parseData(DOMGraphMLParseContext context, Graph graph, Object nodeedge, boolean defaultMode, Node domNode)
          Parses PortConstraint data and assigns the values to DataProvider Acceptors and executes port processing instructions.
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 yext.graphml.reader.AbstractDOMInputHandler
applyDefault, parseData
 
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(NamedNodeMap map,
                         int scopeType)
Accepts keys at edge scope whose attribute yfiles.type has the value portconstraints.

Parameters:
map - the attributes of the key tag.
scopeType - the scope for which the key is defined. One of GraphMLConstants.SCOPE_ALL, GraphMLConstants.SCOPE_EDGE, GraphMLConstants.SCOPE_ENDPOINT, GraphMLConstants.SCOPE_GRAPH, GraphMLConstants.SCOPE_NODE, GraphMLConstants.SCOPE_PORT, GraphMLConstants.SCOPE_HYPEREDGE.

parseData

protected void parseData(DOMGraphMLParseContext context,
                         Graph graph,
                         Object nodeedge,
                         boolean defaultMode,
                         Node domNode)
Parses PortConstraint data and assigns the values to DataProvider Acceptors and executes port processing instructions.

Specified by:
parseData in class AbstractDOMInputHandler
Parameters:
context - The context in which the parser is.
graph - The current graph in the parse context.
nodeedge - The current node/edge in the parse context.
defaultMode - Whether default data or real data is read.
domNode - The DOM node which is actually processed.

getDataAcceptor

protected DataAcceptor getDataAcceptor(Graph graph,
                                       Object dpKey)

applyDefault

protected void applyDefault(DOMGraphMLParseContext context,
                            Graph graph,
                            Object nodeedge)
Does nothing yet.

Specified by:
applyDefault in class AbstractDOMInputHandler
Parameters:
context - The context in which the parser is.
graph - The current graph in the parse context.
nodeedge - The current node/edge in the parse context.


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