y.io.gml
Class NodeParser

java.lang.Object
  |
  +--y.io.gml.ItemParser
        |
        +--y.io.gml.NodeParser
All Implemented Interfaces:
GMLTokenizer.Callback
Direct Known Subclasses:
HierarchyNodeParser

public class NodeParser
extends ItemParser

This class can parse Nodes from valid GML. It is used by GraphParser


Field Summary
protected  Graph2D graph
           
protected  Map id2Node
           
protected  LabelGraphicsParser labelGraphics
           
protected  NodeGraphicsParser nodeGraphics
           
protected  NodeRealizer nr
           
 
Fields inherited from class y.io.gml.ItemParser
attributes, childMap, delegate, level
 
Constructor Summary
NodeParser(Graph2D graph, Map id2Node)
           
 
Method Summary
 void begin()
          this method will be called as soon as the parser enters the scope.
 void childFinished(ItemParser child)
          this method will be called, as soon as the a child ItemParser finished and returned from its end() method.
 void end()
          this method will be called as soon as the parser leaves the scope.
 Object getItem()
          Returns the "product" of this scope.
protected  void handleLabels()
           
 
Methods inherited from class y.io.gml.ItemParser
addAttribute, addChild, attribute, attribute, beginScope, endScope, getAttributes, getBoolean, getDouble, getDouble, getInt, getInt, getLevel, getString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected Graph2D graph

nr

protected NodeRealizer nr

nodeGraphics

protected NodeGraphicsParser nodeGraphics

id2Node

protected Map id2Node

labelGraphics

protected LabelGraphicsParser labelGraphics
Constructor Detail

NodeParser

public NodeParser(Graph2D graph,
                  Map id2Node)
Method Detail

begin

public void begin()
Description copied from class: ItemParser
this method will be called as soon as the parser enters the scope. This implementation will clear the attribute map. Subclasses should therefore make a super call.

Overrides:
begin in class ItemParser

childFinished

public void childFinished(ItemParser child)
Description copied from class: ItemParser
this method will be called, as soon as the a child ItemParser finished and returned from its end() method. This implementation does nothing. Subclasses should nevertheless make a super call.

Overrides:
childFinished in class ItemParser
Parameters:
child - the child ItemParser, which just finished

handleLabels

protected void handleLabels()

end

public void end()
Description copied from class: ItemParser
this method will be called as soon as the parser leaves the scope. This implementation does nothing. Subclasses should nevertheless make a super call.

Overrides:
end in class ItemParser

getItem

public Object getItem()
Description copied from class: ItemParser
Returns the "product" of this scope. This method should be called after this parser has left the scope, i.e. after ItemParser.end() has been called. The latter should construct the resulting item from the collected data and this item should be returned by this method. By default, this method return the map of the attributes.

Overrides:
getItem in class ItemParser
Returns:
the result of the parsing, in this case a Map

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

2003