Search this API

y.io.gml
Class LabelGraphicsEncoder

java.lang.Object
  extended by y.io.gml.LabelGraphicsEncoder
All Implemented Interfaces:
ObjectEncoder
Direct Known Subclasses:
EdgeLabelGraphicsEncoder, NodeLabelGraphicsEncoder

public class LabelGraphicsEncoder
extends java.lang.Object
implements ObjectEncoder

This class can encode YLabels in valid GML

 
Your browser does not support SVG content.

Constructor Summary
LabelGraphicsEncoder()
           
 
Method Summary
 void encode(java.lang.Object item, GMLEncoder enc)
          This method will try to encode the given object using the GMLEncoder
static java.lang.String encodeAlignment(byte alignment)
          Encodes a YLabel YLabel.getAlignment() to a string.
static java.lang.String encodeFontStyle(int style)
          Encodes the Font.getStyle() to a string.
protected  java.lang.String encodeType(java.lang.String qualifiedName)
          Returns the external form of the given qualified class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelGraphicsEncoder

public LabelGraphicsEncoder()
Method Detail

encode

public void encode(java.lang.Object item,
                   GMLEncoder enc)
            throws java.io.IOException
Description copied from interface: ObjectEncoder
This method will try to encode the given object using the GMLEncoder

Specified by:
encode in interface ObjectEncoder
Parameters:
item - the object to be encoded
enc - an encoder
Throws:
java.io.IOException - in the case of an I/O exception

encodeType

protected java.lang.String encodeType(java.lang.String qualifiedName)
Returns the external form of the given qualified class name.

By default, this method delegates to YGFIOHandler.encode(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), LabelGraphicsParser.decodeType(String)

encodeFontStyle

public static java.lang.String encodeFontStyle(int style)
Encodes the Font.getStyle() to a string.


encodeAlignment

public static java.lang.String encodeAlignment(byte alignment)
Encodes a YLabel YLabel.getAlignment() to a string.


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