Search this API

y.io.gml
Class LabelGraphicsParser

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

public class LabelGraphicsParser
extends ItemParser

This class will collect the general attributes from the LabelGraphics section in a GML file.

 
Your browser does not support SVG content.

Field Summary
static java.util.Map edgeLabelModelMap
           
static java.util.Map edgeLabelPosMap
           
static java.util.Map edgeLabelPrefMap
           
static java.util.Map externalNodeLabelPosMap
           
static java.util.Map internalNodeLabelPosMap
           
static java.util.Map nodeLabelModelMap
           
 
Fields inherited from class y.io.gml.ItemParser
attributes, childMap, delegate, level
 
Constructor Summary
LabelGraphicsParser()
           
 
Method Summary
 void commitValues(YLabel label)
          Commits the parsed values to a YLabel instance.
static byte decodeAlignment(java.lang.String alignment)
          Decodes a GML text alignment value to one of YLabel.ALIGN_LEFT, YLabel.ALIGN_CENTER or YLabel.ALIGN_RIGHT,
static byte decodeAutoSizePolicy(java.lang.String policy)
          Decodes a GML value to one of the auto-size policy constants defined in class NodeLabel.
static int decodeFontStyle(java.lang.String fontStyle)
          Decodes a GML font-style value to one of Font.BOLD, Font.ITALIC or Font.PLAIN.
static byte decodeHorizontalTextPosition(java.lang.String htp)
          Decodes a GML horizontalTextPosition value to one of YLabel.CENTER_TEXT_POSITION, YLabel.RIGHT_TEXT_POSITION, YLabel.LEFT_TEXT_POSITION, YLabel.LEFT_ALIGNED_TEXT_POSITION or YLabel.RIGHT_ALIGNED_TEXT_POSITION
protected  java.lang.String decodeType(java.lang.String externalName)
          Returns the qualified class name for the given external name.
static byte decodeVerticalTextPosition(java.lang.String htp)
          Decodes a GML verticalTextPosition value to one of YLabel.CENTER_TEXT_POSITION, YLabel.TOP_TEXT_POSITION or YLabel.BOTTOM_TEXT_POSITION.
 void resetItem()
          Resets the internally help attribute map.
 void setAttributes(java.util.Map attributes)
          Sets the internally used attribute map.
 
Methods inherited from class y.io.gml.ItemParser
addAttribute, addChild, attribute, attribute, begin, beginScope, childFinished, end, endScope, getAttributes, getBoolean, getDouble, getDouble, getInt, getInt, getItem, getLevel, getString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

externalNodeLabelPosMap

public static final java.util.Map externalNodeLabelPosMap

internalNodeLabelPosMap

public static final java.util.Map internalNodeLabelPosMap

nodeLabelModelMap

public static final java.util.Map nodeLabelModelMap

edgeLabelModelMap

public static final java.util.Map edgeLabelModelMap

edgeLabelPosMap

public static final java.util.Map edgeLabelPosMap

edgeLabelPrefMap

public static final java.util.Map edgeLabelPrefMap
Constructor Detail

LabelGraphicsParser

public LabelGraphicsParser()
Method Detail

setAttributes

public void setAttributes(java.util.Map attributes)
Sets the internally used attribute map.


resetItem

public void resetItem()
Resets the internally help attribute map.


commitValues

public void commitValues(YLabel label)
Commits the parsed values to a YLabel instance.


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 serialization, an explicit class name encoding should be specified for user data types.

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

decodeAutoSizePolicy

public static byte decodeAutoSizePolicy(java.lang.String policy)
Decodes a GML value to one of the auto-size policy constants defined in class NodeLabel.


decodeFontStyle

public static int decodeFontStyle(java.lang.String fontStyle)
Decodes a GML font-style value to one of Font.BOLD, Font.ITALIC or Font.PLAIN.


decodeHorizontalTextPosition

public static byte decodeHorizontalTextPosition(java.lang.String htp)
Decodes a GML horizontalTextPosition value to one of YLabel.CENTER_TEXT_POSITION, YLabel.RIGHT_TEXT_POSITION, YLabel.LEFT_TEXT_POSITION, YLabel.LEFT_ALIGNED_TEXT_POSITION or YLabel.RIGHT_ALIGNED_TEXT_POSITION


decodeVerticalTextPosition

public static byte decodeVerticalTextPosition(java.lang.String htp)
Decodes a GML verticalTextPosition value to one of YLabel.CENTER_TEXT_POSITION, YLabel.TOP_TEXT_POSITION or YLabel.BOTTOM_TEXT_POSITION.


decodeAlignment

public static byte decodeAlignment(java.lang.String alignment)
Decodes a GML text alignment value to one of YLabel.ALIGN_LEFT, YLabel.ALIGN_CENTER or YLabel.ALIGN_RIGHT,


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