|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.SimpleUserDataHandler
public class SimpleUserDataHandler
Simple implementation of the GenericNodeRealizer.UserDataHandler,
GenericEdgeRealizer.UserDataHandler, and YLabel.UserDataHandler interfaces.
that can be used by GenericNodeRealizer, GenericEdgeRealizer, and YLabel
instances respectively.
This implementation tries to either clone the user data and if that fails either
copies the value by reference, returns null or throws a RuntimeException
| Field Summary | |
|---|---|
static byte |
EXCEPTION_ON_FAILURE
Policy constant. |
static byte |
NULL_ON_FAILURE
Policy constant. |
static byte |
REFERENCE_ON_FAILURE
Policy constant. |
| Constructor Summary | |
|---|---|
SimpleUserDataHandler(byte mode)
Creates a new instance of SimpleUserDataHandler using the given mode |
|
| Method Summary | |
|---|---|
Object |
copyUserData(EdgeRealizer srcContext,
Object srcData,
EdgeRealizer targetContext)
Copies the user-defined data appropriately. |
Object |
copyUserData(NodePort srcPort,
Object srcData,
NodePort tgtPort)
Creates a copy of the specified user data that is suitable for the specified target port instance. |
Object |
copyUserData(NodeRealizer srcContext,
Object srcData,
NodeRealizer targetContext)
Copies the user data using its clone method and if that fails either returns the reference, null, or throws a RuntimeException, depending on the mode of this instance. |
protected Object |
copyUserData(Object srcData)
Callback method that performs the actual copy. |
Object |
copyUserData(YLabel srcContext,
Object srcData,
YLabel targetContext)
Copies the user-defined data appropriately. |
Object |
readUserData(EdgeRealizer context,
ObjectInputStream ois)
Retrieves the user-defined data object from the ObjectInputStream. |
Object |
readUserData(NodeRealizer context,
ObjectInputStream ois)
Read the user data using the default serialization method. |
protected Object |
readUserData(ObjectInputStream ois)
|
Object |
readUserData(YLabel context,
ObjectInputStream ois)
Retrieves the user-defined data object from the ObjectInputStream. |
void |
storeUserData(EdgeRealizer context,
Object userData,
ObjectOutputStream oos)
Stores the user-defined data object to the ObjectOutputStream. |
void |
storeUserData(NodeRealizer context,
Object userData,
ObjectOutputStream oos)
Writes the user data using the default serialization method. |
protected void |
storeUserData(Object userData,
ObjectOutputStream oos)
|
void |
storeUserData(YLabel context,
Object userData,
ObjectOutputStream oos)
Stores the user-defined data object to the ObjectOutputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte REFERENCE_ON_FAILURE
public static final byte NULL_ON_FAILURE
null if cloning fails
and serialize a null if serialization fails.
public static final byte EXCEPTION_ON_FAILURE
| Constructor Detail |
|---|
public SimpleUserDataHandler(byte mode)
| Method Detail |
|---|
public Object copyUserData(NodeRealizer srcContext,
Object srcData,
NodeRealizer targetContext)
copyUserData in interface GenericNodeRealizer.UserDataHandlerprotected Object copyUserData(Object srcData)
srcData - the object to copy/clone
public Object readUserData(NodeRealizer context,
ObjectInputStream ois)
throws IOException
readUserData in interface GenericNodeRealizer.UserDataHandlerIOException
protected Object readUserData(ObjectInputStream ois)
throws IOException
IOException
public void storeUserData(NodeRealizer context,
Object userData,
ObjectOutputStream oos)
throws IOException
storeUserData in interface GenericNodeRealizer.UserDataHandlerIOException
protected void storeUserData(Object userData,
ObjectOutputStream oos)
throws IOException
IOException
public void storeUserData(EdgeRealizer context,
Object userData,
ObjectOutputStream oos)
throws IOException
GenericEdgeRealizer.UserDataHandlerObjectOutputStream. Used for YGF serialization.
storeUserData in interface GenericEdgeRealizer.UserDataHandlerIOException - if an exception occurscontext - the edge to store the user-defined datauserData - the user-defined data objectoos - the stream to store the user-defined data object to
public Object readUserData(EdgeRealizer context,
ObjectInputStream ois)
throws IOException
GenericEdgeRealizer.UserDataHandlerObjectInputStream. Used for YGF deserialization.
readUserData in interface GenericEdgeRealizer.UserDataHandlerIOException - if an exception occurscontext - the edge to read the user-defined data forois - the stream to read the user-defined data object from
public Object copyUserData(EdgeRealizer srcContext,
Object srcData,
EdgeRealizer targetContext)
GenericEdgeRealizer.UserDataHandler
copyUserData in interface GenericEdgeRealizer.UserDataHandlersrcContext - the edge that will be copiedsrcData - the data associated with the srcContexttargetContext - the edge the copy will be associated with
public void storeUserData(YLabel context,
Object userData,
ObjectOutputStream oos)
throws IOException
YLabel.UserDataHandlerObjectOutputStream. Used for YGF serialization.
storeUserData in interface YLabel.UserDataHandlerIOException - if an exception occurscontext - the label to store the user-defined data foruserData - the user-defined data objectoos - the stream to store the user-defined data object to
public Object readUserData(YLabel context,
ObjectInputStream ois)
throws IOException
YLabel.UserDataHandlerObjectInputStream. Used for YGF deserialization.
readUserData in interface YLabel.UserDataHandlerIOException - if an exception occurscontext - the label to read the user-defined data forois - the stream to read the user-defined data object from
public Object copyUserData(YLabel srcContext,
Object srcData,
YLabel targetContext)
YLabel.UserDataHandler
copyUserData in interface YLabel.UserDataHandlersrcContext - the label that will be copiedsrcData - the data associated with the srcContexttargetContext - the label the copy will be associated with
public Object copyUserData(NodePort srcPort,
Object srcData,
NodePort tgtPort)
NodePort.UserDataHandler
copyUserData in interface NodePort.UserDataHandlersrcPort - the port instance whose user data is copied.srcData - the user data that has to be copied.tgtPort - the port instance for which the copy is created.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||