Search this API

y.view
Interface YLabel.UserDataHandler

All Known Implementing Classes:
SimpleUserDataHandler
Enclosing class:
YLabel

public static interface YLabel.UserDataHandler

This interface is used during YGF serialization to delegate the copying and serialization/deserialization of any user-defined data to. Registered implementations of this interface will be used to perform the actual serialization and deserialization of the user-defined data object. Additionally, implementations are responsible for creating appropriate copies of the user-defined data.


Method Summary
 Object copyUserData(YLabel srcContext, Object srcData, YLabel targetContext)
          Copies the user-defined data appropriately.
 Object readUserData(YLabel context, ObjectInputStream ois)
          Retrieves the user-defined data object from the ObjectInputStream.
 void storeUserData(YLabel context, Object userData, ObjectOutputStream oos)
          Stores the user-defined data object to the ObjectOutputStream.
 

Method Detail

storeUserData

void storeUserData(YLabel context,
                   Object userData,
                   ObjectOutputStream oos)
                   throws IOException
Stores the user-defined data object to the ObjectOutputStream. Used for YGF serialization.

Throws:
IOException - if an exception occurs
Parameters:
context - the label to store the user-defined data for
userData - the user-defined data object
oos - the stream to store the user-defined data object to

readUserData

Object readUserData(YLabel context,
                    ObjectInputStream ois)
                    throws IOException
Retrieves the user-defined data object from the ObjectInputStream. Used for YGF deserialization.

Throws:
IOException - if an exception occurs
Parameters:
context - the label to read the user-defined data for
ois - the stream to read the user-defined data object from
Returns:
the user-defined data object as read in from the stream

copyUserData

Object copyUserData(YLabel srcContext,
                    Object srcData,
                    YLabel targetContext)
Copies the user-defined data appropriately.

Parameters:
srcContext - the label that will be copied
srcData - the data associated with the srcContext
targetContext - the label the copy will be associated with
Returns:
the copy that will be stored with the targetContext

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