Search this API

y.io.graphml.graph2d
Class Graph2DGraphMLHandler

java.lang.Object
  extended by y.io.graphml.GraphMLHandler
      extended by y.io.graphml.graph2d.Graph2DGraphMLHandler

public class Graph2DGraphMLHandler
extends GraphMLHandler

This class adds configuration to GraphMLHandler for handling Graph2D instances.

The following configuration is added:

 
Your browser does not support SVG content.

Nested Class Summary
 
Nested classes/interfaces inherited from class y.io.graphml.GraphMLHandler
GraphMLHandler.BoolDataAcceptorInputHandler, GraphMLHandler.BooleanDataProviderOutputHandler, GraphMLHandler.DoubleDataAcceptorInputHandler, GraphMLHandler.DoubleDataProviderOutputHandler, GraphMLHandler.FloatDataAcceptorInputHandler, GraphMLHandler.FloatDataProviderOutputHandler, GraphMLHandler.InputHandlerQueryPredicate, GraphMLHandler.IntDataAcceptorInputHandler, GraphMLHandler.IntDataProviderOutputHandler, GraphMLHandler.LongDataAcceptorInputHandler, GraphMLHandler.LongDataProviderOutputHandler, GraphMLHandler.StringDataAcceptorInputHandler, GraphMLHandler.StringDataProviderOutputHandler
 
Constructor Summary
Graph2DGraphMLHandler()
           
 
Method Summary
 void addEdgeRealizerSerializer(EdgeRealizerSerializer ers)
          Register a EdgeRealizerSerializer instance.
 void addNodeRealizerSerializer(NodeRealizerSerializer nrs)
          Register a NodeRealizerSerializer instance.
protected  void configureDefaultRealizerSerializers()
          Registers RealizerSerializers for all Realizer types in the yFiles for Java library.
protected  void configureDeserializationHandlers(Graph graph, GraphMLParser parser)
          Adds deserialization handlers for structured representation of Java framework classes Font, Color, Boolean, Byte, Short, Integer, Long, Float, Double, String, and TransformAttribute.
protected  void configureDeserializationProperties(Graph graph, GraphMLParser parser)
          Configure important deserialization properties of GraphMLHandler.
protected  void configureGraphMLParser(Graph graph, GraphMLParser graphMLParser)
          Registers a ParseEventListener for the yfiles.foldertype attribute.
protected  void configureGraphMLWriter(Graph graph, GraphMLWriter graphMLWriter)
          Registers a WriteEventListener for the yfiles.foldertype attribute.
protected  void configureInputHandlers(Graph graph, GraphMLParser parser)
          Registers input handlers for Node- and EdgeRealizers, NodePorts, PostProcessors and embedded resources.
protected  void configureLookup(Graph graph, GraphMLParser parser)
          Adds HierarchySupport and embedded resource support to the base lookup.
protected  void configureLookup(Graph graph, GraphMLWriter writer)
          Adds HierarchySupport and embedded resource support to the base lookup.
protected  void configureOutputHandlers(Graph graph, GraphMLWriter writer)
          Registers output handlers for Node- and EdgeRealizers, NodePorts, and embedded resources.
protected  void configureSerializationHandlers(Graph graph, GraphMLWriter writer)
          Adds serialization handlers for structured representation of Java framework classes Font, Color, Boolean, Byte, Short, Integer, Long, Float, Double, String, and TransformAttribute.
protected  void configureSerializationProperties(Graph graph, GraphMLWriter writer)
          Configure important serialization properties of GraphMLHandler.
protected  GraphElementFactory createGraphElementFactory(GraphMLParser parser, Graph graph)
          Create an GraphElementFactory instance that creates the graph elements for the graph instance.
protected  HierarchySupport createHierarchySupport(Graph graph, GraphMLWriter writer)
           
protected  InputHandlerProvider createNodePortReaderProvider()
          Creates a provider for NodePortGraphicsReader, NodePortGeometryReader, and NodePortUserDataReader.
protected  OutputHandlerProvider createNodePortWriterHandlerProvider()
          Creates a provider for NodePortGraphicsWriter, NodePortGeometryWriter, and NodePortUserDataWriter.
protected  InputHandlerProvider createPostprocessorInputHandlerProvider()
          Creates a provider for PostprocessorInputHandler.
protected  InputHandlerProvider createReadEdgeRealizerHandlerProvider()
          Creates a provider for ReadEdgeRealizerHandler.
protected  InputHandlerProvider createReadNodeRealizerHandlerProvider()
          Creates a provider for ReadNodeRealizerHandler.
protected  InputHandlerProvider createResourceInputHandlerProvider()
          Creates a provider that registers a handler for reading shared resources.
protected  OutputHandlerProvider createResourceOutputHandlerProvider()
          Creates a provider that registers a handler for writing shared resources.
protected  OutputHandlerProvider createWriteEdgeRealizerHandlerProvider()
          Creates a provider for WriteEdgeRealizerHandler.
protected  OutputHandlerProvider createWriteNodeRealizerHandlerProvider()
          Creates a provider for WriteNodeRealizerHandler.
 void removeEdgeRealizerSerializer(EdgeRealizerSerializer ers)
          Unregister a EdgeRealizerSerializer instance that has been registered with addEdgeRealizerSerializer(EdgeRealizerSerializer)
 void removeNodeRealizerSerializer(NodeRealizerSerializer nrs)
          Unregister a NodeRealizerSerializer instance that has been registered with addNodeRealizerSerializer(NodeRealizerSerializer)
 
Methods inherited from class y.io.graphml.GraphMLHandler
addDeserializationHandler, addInputDataAcceptor, addInputDataAcceptor, addInputDataAcceptor, addInputDataAcceptor, addInputDataAcceptor, addInputDataAcceptor, addInputDataAcceptorFuture, addInputDataAcceptorFuture, addInputDataAcceptorFuture, addInputHandlerProvider, addNamespace, addOutputDataProvider, addOutputDataProvider, addOutputDataProvider, addOutputDataProvider, addOutputHandlerProvider, addParseEventListener, addRegisteredOutputDataProvider, addRegisteredOutputDataProvider, addRegisteredOutputDataProvider, addSchemaLocation, addSerializationHandler, addWriteEventListener, configureNamespaces, configureParseEvents, configureSchemaLocations, configureWriteEvents, configureXMLWriter, createGraphMLParser, createGraphMLWriter, createXMLWriter, createXMLWriter, fireDeserializationEvent, fireQueryInputHandlersProviders, fireQueryOutputHandlersEvent, fireSerializationEvent, getDeserializationProperty, getKeyName, getKeyScope, getKeyType, getKeyUri, getSerializationProperty, isClearGraphBeforeRead, isWriteXMLSchema, matchesName, matchesScope, matchesType, matchesUri, onGraphMLParserHandleDeserialization, onGraphMLParserQueryInputHandlers, onGraphMLWriterHandleSerialization, onGraphMLWriterQueryOutputHandlers, read, read, removeDeserializationHandler, removeDeserializationProperty, removeInputHandlerProvider, removeOutputHandlerProvider, removeParseEventListener, removeSerializationHandler, removeSerializationProperty, removeWriteEventListener, setClearGraphBeforeRead, setDeserializationProperty, setSerializationProperty, setWriteXMLSchema, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graph2DGraphMLHandler

public Graph2DGraphMLHandler()
Method Detail

configureLookup

protected void configureLookup(Graph graph,
                               GraphMLWriter writer)
Adds HierarchySupport and embedded resource support to the base lookup.

Overrides:
configureLookup in class GraphMLHandler
Parameters:
graph - The Graph that is written
writer - The writer to configure.
See Also:
GraphMLWriter.setLookup(Class,Object)

createHierarchySupport

protected HierarchySupport createHierarchySupport(Graph graph,
                                                  GraphMLWriter writer)

configureInputHandlers

protected void configureInputHandlers(Graph graph,
                                      GraphMLParser parser)
Registers input handlers for Node- and EdgeRealizers, NodePorts, PostProcessors and embedded resources.

Calls createPostprocessorInputHandlerProvider(), createReadEdgeRealizerHandlerProvider(), createReadNodeRealizerHandlerProvider(), createNodePortReaderProvider(), and createResourceInputHandlerProvider().

Overrides:
configureInputHandlers in class GraphMLHandler
Parameters:
graph - The graph that will be parsed
parser - The parser to configure.

createNodePortReaderProvider

protected InputHandlerProvider createNodePortReaderProvider()
Creates a provider for NodePortGraphicsReader, NodePortGeometryReader, and NodePortUserDataReader. Called from configureInputHandlers(y.base.Graph, y.io.graphml.input.GraphMLParser).

Returns:
a provider for NodePortGraphicsReader, NodePortGeometryReader, and NodePortUserDataReader.

createPostprocessorInputHandlerProvider

protected InputHandlerProvider createPostprocessorInputHandlerProvider()
Creates a provider for PostprocessorInputHandler. Called from configureInputHandlers(y.base.Graph, y.io.graphml.input.GraphMLParser).

Returns:
a provider for PostprocessorInputHandler.

createReadEdgeRealizerHandlerProvider

protected InputHandlerProvider createReadEdgeRealizerHandlerProvider()
Creates a provider for ReadEdgeRealizerHandler. Called from configureInputHandlers(y.base.Graph, y.io.graphml.input.GraphMLParser).

Returns:
a provider for ReadEdgeRealizerHandler.

createReadNodeRealizerHandlerProvider

protected InputHandlerProvider createReadNodeRealizerHandlerProvider()
Creates a provider for ReadNodeRealizerHandler. Called from configureInputHandlers(y.base.Graph, y.io.graphml.input.GraphMLParser).

Returns:
a provider for ReadNodeRealizerHandler.

createResourceInputHandlerProvider

protected InputHandlerProvider createResourceInputHandlerProvider()
Creates a provider that registers a handler for reading shared resources. Called from configureInputHandlers(y.base.Graph, y.io.graphml.input.GraphMLParser).

Returns:
a provider that registers a handler for reading shared resources.

configureOutputHandlers

protected void configureOutputHandlers(Graph graph,
                                       GraphMLWriter writer)
Registers output handlers for Node- and EdgeRealizers, NodePorts, and embedded resources.

Calls createWriteNodeRealizerHandlerProvider(), createWriteEdgeRealizerHandlerProvider(), createNodePortWriterHandlerProvider(), and createResourceOutputHandlerProvider().

Overrides:
configureOutputHandlers in class GraphMLHandler
Parameters:
graph - The graph that will be written
writer - The writer to configure.

createResourceOutputHandlerProvider

protected OutputHandlerProvider createResourceOutputHandlerProvider()
Creates a provider that registers a handler for writing shared resources. Called from configureOutputHandlers(y.base.Graph, y.io.graphml.output.GraphMLWriter).

Returns:
a provider that registers a handler for writing shared resources.

createNodePortWriterHandlerProvider

protected OutputHandlerProvider createNodePortWriterHandlerProvider()
Creates a provider for NodePortGraphicsWriter, NodePortGeometryWriter, and NodePortUserDataWriter. Called from configureOutputHandlers(y.base.Graph, y.io.graphml.output.GraphMLWriter).

Returns:
a provider for NodePortGraphicsWriter, NodePortGeometryWriter, and NodePortUserDataWriter.

createWriteEdgeRealizerHandlerProvider

protected OutputHandlerProvider createWriteEdgeRealizerHandlerProvider()
Creates a provider for WriteEdgeRealizerHandler. Called from configureOutputHandlers(y.base.Graph, y.io.graphml.output.GraphMLWriter).

Returns:
a provider for WriteEdgeRealizerHandler.

createWriteNodeRealizerHandlerProvider

protected OutputHandlerProvider createWriteNodeRealizerHandlerProvider()
Creates a provider for WriteNodeRealizerHandler. Called from configureOutputHandlers(y.base.Graph, y.io.graphml.output.GraphMLWriter).

Returns:
a provider for WriteNodeRealizerHandler.

configureSerializationHandlers

protected void configureSerializationHandlers(Graph graph,
                                              GraphMLWriter writer)
Adds serialization handlers for structured representation of Java framework classes Font, Color, Boolean, Byte, Short, Integer, Long, Float, Double, String, and TransformAttribute.

Overrides:
configureSerializationHandlers in class GraphMLHandler
Parameters:
graph - The graph that will be written.
writer - The writer to configure.

configureDeserializationHandlers

protected void configureDeserializationHandlers(Graph graph,
                                                GraphMLParser parser)
Adds deserialization handlers for structured representation of Java framework classes Font, Color, Boolean, Byte, Short, Integer, Long, Float, Double, String, and TransformAttribute.

Overrides:
configureDeserializationHandlers in class GraphMLHandler
Parameters:
graph - The graph that will be parsed.
parser - The parser to configure.

configureLookup

protected void configureLookup(Graph graph,
                               GraphMLParser parser)
Adds HierarchySupport and embedded resource support to the base lookup.

Overrides:
configureLookup in class GraphMLHandler
Parameters:
graph - The graph that is parsed
parser - The parser to configure.
See Also:
GraphMLParser.setLookup(Class,Object)

configureGraphMLWriter

protected void configureGraphMLWriter(Graph graph,
                                      GraphMLWriter graphMLWriter)
Registers a WriteEventListener for the yfiles.foldertype attribute.

Overrides:
configureGraphMLWriter in class GraphMLHandler
Parameters:
graph - The graph that is written
graphMLWriter - The writer to configure.

configureGraphMLParser

protected void configureGraphMLParser(Graph graph,
                                      GraphMLParser graphMLParser)
Registers a ParseEventListener for the yfiles.foldertype attribute.

Overrides:
configureGraphMLParser in class GraphMLHandler
Parameters:
graph - The graph that is parsed.
graphMLParser - the parser to configure.

createGraphElementFactory

protected GraphElementFactory createGraphElementFactory(GraphMLParser parser,
                                                        Graph graph)
Description copied from class: GraphMLHandler
Create an GraphElementFactory instance that creates the graph elements for the graph instance.

Overrides:
createGraphElementFactory in class GraphMLHandler
Parameters:
parser - The parser to use.
graph - The graph that is populated.
Returns:
An GraphElementFactory instance that is configured for the given parameters.

configureDefaultRealizerSerializers

protected void configureDefaultRealizerSerializers()
Registers RealizerSerializers for all Realizer types in the yFiles for Java library.


configureSerializationProperties

protected void configureSerializationProperties(Graph graph,
                                                GraphMLWriter writer)
Configure important serialization properties of GraphMLHandler.

Overrides:
configureSerializationProperties in class GraphMLHandler
Parameters:
graph - The graph to write.
writer - The writer to configure.
See Also:
GraphMLWriter.setSerializationProperty(Object,Object)

configureDeserializationProperties

protected void configureDeserializationProperties(Graph graph,
                                                  GraphMLParser parser)
Description copied from class: GraphMLHandler
Configure important deserialization properties of GraphMLHandler.

Overrides:
configureDeserializationProperties in class GraphMLHandler
Parameters:
graph - The graph to parse.
parser - The parser to configure.
See Also:
GraphMLParser.setDeserializationProperty(Object,Object)

addNodeRealizerSerializer

public void addNodeRealizerSerializer(NodeRealizerSerializer nrs)
Register a NodeRealizerSerializer instance.

Parameters:
nrs - The NodeRealizerSerializer to register.

addEdgeRealizerSerializer

public void addEdgeRealizerSerializer(EdgeRealizerSerializer ers)
Register a EdgeRealizerSerializer instance.

Parameters:
ers - The EdgeRealizerSerializer to register.

removeNodeRealizerSerializer

public void removeNodeRealizerSerializer(NodeRealizerSerializer nrs)
Unregister a NodeRealizerSerializer instance that has been registered with addNodeRealizerSerializer(NodeRealizerSerializer)

Parameters:
nrs - The NodeRealizerSerializer to unregister.
See Also:
addNodeRealizerSerializer(NodeRealizerSerializer)

removeEdgeRealizerSerializer

public void removeEdgeRealizerSerializer(EdgeRealizerSerializer ers)
Unregister a EdgeRealizerSerializer instance that has been registered with addEdgeRealizerSerializer(EdgeRealizerSerializer)

Parameters:
ers - The EdgeRealizerSerializer to unregister.
See Also:
addEdgeRealizerSerializer(EdgeRealizerSerializer)

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