com.yworks.yfiles.server.graphml.flexio
Class SharedDataOutputHandler

java.lang.Object
  extended byy.io.graphml.output.AbstractOutputHandler
      extended bycom.yworks.yfiles.server.graphml.flexio.SharedDataOutputHandler
All Implemented Interfaces:
java.util.EventListener, OutputHandler, OutputHandlerProvider

public class SharedDataOutputHandler
extends AbstractOutputHandler

Output handler that enables writing of shared references.


Nested Class Summary
static interface SharedDataOutputHandler.SharingRegistry
           
 
Constructor Summary
SharedDataOutputHandler(java.lang.Object nodeStyleDpKey, java.lang.Object edgeStyleDpKey, java.lang.Object edgeLabelsDpKey, java.lang.Object nodeLabelsDpKey)
          Create a new output handler for writing shared data.
 
Method Summary
 void addSharedInstance(java.lang.Object instance)
          Add a shared instance.
 WritePrecedence getPrecedence()
          This handler shall write before its children.
 SerializationHandler getSerializer()
          Returns a serializer that writes xml elements which reference shared instances.
protected  java.lang.Object getValue(GraphMLWriteContext context, java.lang.Object key)
           
protected  void handleSharedObject(java.lang.Object toShare, SharedDataOutputHandler.SharingRegistry registry)
          Allows to customize sharing for objects that are shared per default.
 void setCommitLabelLayouts(boolean commitLabelLayouts)
           
protected  void writeValueCore(GraphMLWriteContext context, java.lang.Object data)
           
 
Methods inherited from class y.io.graphml.output.AbstractOutputHandler
addNameToKeyDefinition, addScopeToKeyDefinition, addTypeToKeyDefinition, addUriToKeyDefinition, getDataTagAttributes, getDefaultValue, getKeyDefinitionAttributes, getScope, getValidScopes, hasDefaultValueAssigned, isDefaultValue, isValidScope, isWriteKeyDefault, onQueryOutputHandler, setDefaultValue, setDefaultValueAssigned, setPrecedence, setScope, setValidScopes, setWriteKeyDefault, writeKeyDefinitionContent, writeValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedDataOutputHandler

public SharedDataOutputHandler(java.lang.Object nodeStyleDpKey,
                               java.lang.Object edgeStyleDpKey,
                               java.lang.Object edgeLabelsDpKey,
                               java.lang.Object nodeLabelsDpKey)
Create a new output handler for writing shared data.

Parameters:
nodeStyleDpKey - The key for the data provider that stores node styles.
edgeStyleDpKey - The key for the data provider that stores edge styles.
edgeLabelsDpKey - The key for the data provider that stores lists of edge labels.
nodeLabelsDpKey - The key for the data provider that stores lists of node labels.
Method Detail

setCommitLabelLayouts

public void setCommitLabelLayouts(boolean commitLabelLayouts)

addSharedInstance

public void addSharedInstance(java.lang.Object instance)
Add a shared instance.

Parameters:
instance - an instance that should be considered for sharing.

handleSharedObject

protected void handleSharedObject(java.lang.Object toShare,
                                  SharedDataOutputHandler.SharingRegistry registry)
Allows to customize sharing for objects that are shared per default. E.g., if a custom node style has a property that should be considered for sharing as well, a custom implementation of this method could add the value of that property to the sharing registry.

Parameters:
toShare - An object that is considered for sharing, e.g. styles, user tags, label model parameters.
registry - A registry for objects that will be considered for sharing.

getValue

protected java.lang.Object getValue(GraphMLWriteContext context,
                                    java.lang.Object key)
                             throws GraphMLWriteException
Throws:
GraphMLWriteException

writeValueCore

protected void writeValueCore(GraphMLWriteContext context,
                              java.lang.Object data)
                       throws GraphMLWriteException
Throws:
GraphMLWriteException

getSerializer

public SerializationHandler getSerializer()
Returns a serializer that writes xml elements which reference shared instances.


getPrecedence

public WritePrecedence getPrecedence()
This handler shall write before its children.

Returns:
WritePrecedence.BEFORE_CHILDREN
See Also:
WritePrecedence


Copyright © 2000-2007 yWorks GmbH. All rights reserved