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.
 void addSharedInstanceProvider(ISharedInstanceProvider provider)
          Recursively adds all shared instances of the passed provider.
 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)
           
 boolean isCommitPortLocations()
           
 void onQueryOutputHandler(QueryOutputHandlersEvent event)
           
 void setCommitLabelLayouts(boolean commitLabelLayouts)
           
 void setCommitPortLocations(boolean commitPortLocations)
           
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, 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)

isCommitPortLocations

public boolean isCommitPortLocations()

setCommitPortLocations

public void setCommitPortLocations(boolean commitPortLocations)

onQueryOutputHandler

public void onQueryOutputHandler(QueryOutputHandlersEvent event)
                          throws GraphMLWriteException
Throws:
GraphMLWriteException

addSharedInstanceProvider

public void addSharedInstanceProvider(ISharedInstanceProvider provider)
Recursively adds all shared instances of the passed provider.

Parameters:
provider - An provider for instances that should be considered for sharing.

addSharedInstance

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

Parameters:
instance - an instance that should 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-2013 yWorks GmbH. All rights reserved