Search this API

y.io.gml
Class EdgeGraphicsParser

java.lang.Object
  extended by y.io.gml.ItemParser
      extended by y.io.gml.EdgeGraphicsParser
All Implemented Interfaces:
GMLTokenizer.Callback

public class EdgeGraphicsParser
extends ItemParser

This class is used by EdgeParser. It can parse the .edge.graphics scope It will create an EdgeRealizer for each run.

 

Field Summary
 
Fields inherited from class y.io.gml.ItemParser
attributes, childMap, delegate, level
 
Constructor Summary
EdgeGraphicsParser()
           
 
Method Summary
 void attribute(java.lang.String key, java.lang.String value)
          Note: subclass implementers should make a super call, if they want to overwrite this method.
 void begin()
          this method will be called as soon as the parser enters the scope.
 void beginScope(java.lang.String scopeName)
          Note: subclass implementers should make a super call, if they want to overwrite this method.
 void childFinished(ItemParser child)
          this method will be called, as soon as the a child ItemParser finished and returned from its end() method.
static byte decodeArcType(java.lang.String arcType)
          Decodes an arc-style GML value to one of the type constants ArcEdgeRealizer.FIXED_RATIO or ArcEdgeRealizer.FIXED_HEIGHT.
static Arrow decodeArrow(java.lang.String name)
          Decodes the given arrow given its name.
static byte decodeLineStyle(java.lang.String lineStyle)
          Decodes a line-style GML value to one of the line type constants LineType.LINE_STYLE, LineType.DASHED_STYLE or LineType.DOTTED_STYLE.
protected  java.lang.String decodeType(java.lang.String externalName)
          Returns the qualified class name for the given external name.
 void end()
          this method will be called as soon as the parser leaves the scope.
 EdgeRealizer getEdgeRealizer()
          Returns the realizer that is the result of the parsing.
 java.lang.Object getItem()
          Returns the "product" of this scope.
 
Methods inherited from class y.io.gml.ItemParser
addAttribute, addChild, attribute, 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
 

Constructor Detail

EdgeGraphicsParser

public EdgeGraphicsParser()
Method Detail

attribute

public void attribute(java.lang.String key,
                      java.lang.String value)
Description copied from class: ItemParser
Note: subclass implementers should make a super call, if they want to overwrite this method.

Specified by:
attribute in interface GMLTokenizer.Callback
Overrides:
attribute in class ItemParser
Parameters:
key - the key of the attribute value pair
value - the string value

beginScope

public void beginScope(java.lang.String scopeName)
Description copied from class: ItemParser
Note: subclass implementers should make a super call, if they want to overwrite this method.

Specified by:
beginScope in interface GMLTokenizer.Callback
Overrides:
beginScope in class ItemParser
Parameters:
scopeName - the name of the scope

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

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

decodeType

protected java.lang.String decodeType(java.lang.String externalName)
Returns the qualified class name for the given external name.

By default, this method delegates to YGFIOHandler.decode(String).

Note: To prevent obfuscation from breaking user data and style property serialization, an explicit class name encoding should be specified for user data types and style property value types.

See Also:
YGFIOHandler.addEncoding(String, String), EdgeRealizerObjectEncoder.encodeType(String)

decodeArcType

public static byte decodeArcType(java.lang.String arcType)
Decodes an arc-style GML value to one of the type constants ArcEdgeRealizer.FIXED_RATIO or ArcEdgeRealizer.FIXED_HEIGHT.


decodeLineStyle

public static byte decodeLineStyle(java.lang.String lineStyle)
Decodes a line-style GML value to one of the line type constants LineType.LINE_STYLE, LineType.DASHED_STYLE or LineType.DOTTED_STYLE.


getEdgeRealizer

public EdgeRealizer getEdgeRealizer()
Returns the realizer that is the result of the parsing.


getItem

public java.lang.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

decodeArrow

public static Arrow decodeArrow(java.lang.String name)
Decodes the given arrow given its name.


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