|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.graphml.GraphMLHandler com.yworks.yfiles.server.graphml.support.GraphMLLayoutGraphIOHandler
IOHandler for (de)serializing graphs from/to GraphML format.
GraphMLLayoutGraphIOHandler supports (de)serialization of custom GraphML attributes that
hold data of simple type, as well as ids, and styles as DocumentFragment
s.
For more information about the GraphML file format please refer to the GraphML Primer.
Nested Class Summary |
Field Summary |
Fields inherited from class y.io.graphml.GraphMLHandler |
z |
Constructor Summary | |
GraphMLLayoutGraphIOHandler()
Creates a new instance of GraphMLLayoutGraphIOHandler. |
Method Summary | |
protected void |
configureInputHandlers(Graph graph,
GraphMLParser parser)
Configures default event handlers for the GraphMLParser.fireQueryInputHandlersEvent(y.io.graphml.input.QueryInputHandlersEvent) event.
|
protected void |
configureLookup(Graph graph,
GraphMLParser parser)
Configure the default lookup map of parser .
|
protected void |
configureLookup(Graph graph,
GraphMLWriter writer)
Configure the default lookup map of writer .
|
protected void |
configureOutputHandlers(Graph graph,
GraphMLWriter writer)
Configures default event handlers for the QueryOutputHandlersEvent event.
|
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)
Creates a new HierarchySupport that can be used to traverse the hierarchy structure of the graph. |
protected PortProvider |
createPortProvider(Graph graph,
GraphMLWriter writer)
Creates a new PortProvider that is used to get the ports to write. |
DataAcceptor |
getGraphIdAcceptor()
Return the DataAcceptor instance for graph ids that has been previously registered with setGraphIdAcceptor(y.base.DataAcceptor) |
DataProvider |
getGraphIdProvider()
Return the DataProvider instance for graph ids that has been previously registered with setGraphIdProvider(y.base.DataProvider) |
DataAcceptor |
getIdDataAcceptor()
Return the DataAcceptor instance for graph element ids that has been previously registered with setIdDataAcceptor(y.base.DataAcceptor) |
DataProvider |
getIdDataProvider()
Return the DataProvider instance for graph element ids that has been previously registered with setIdDataProvider(y.base.DataProvider) |
boolean |
isAutoCreateGroupingDPs()
Returns whether data providers for grouping information should automatically be created and registered. |
void |
read(Graph graph,
java.lang.String name)
Fills the contents of the given graph from a file. |
void |
read(Graph graph,
java.net.URL url)
Fills the contents of the given graph from a URL. |
void |
setAutoCreateGroupingDPs(boolean autoCreateGroupingDPs)
Sets whether data providers for grouping information should automatically be created and registered. |
void |
setGraphIdAcceptor(DataAcceptor graphIdAcceptor)
Register a DataAcceptor instance that stores graphml graph element ids for each graph itself.
|
void |
setGraphIdProvider(DataProvider graphIdProvider)
Register a DataProvider instance that provides graphml element ids for each graph itself.
|
void |
setIdDataAcceptor(DataAcceptor idDataAcceptor)
Register a DataAcceptor instance that stores graphml element ids.
|
void |
setIdDataProvider(DataProvider idDataProvider)
Register a DataProvider instance that provides graphml element ids for each element.
|
void |
write(Graph graph,
java.lang.String name)
Writes the contents of the given graph to a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GraphMLLayoutGraphIOHandler()
Method Detail |
public boolean isAutoCreateGroupingDPs()
false
.
setAutoCreateGroupingDPs(boolean)
,
GroupingKeys.GROUP_DPKEY
,
GroupingKeys.NODE_ID_DPKEY
,
GroupingKeys.PARENT_NODE_ID_DPKEY
public void setAutoCreateGroupingDPs(boolean autoCreateGroupingDPs)
true
.
Note: If this flag is set to true
, DataProviders for the following keys will be automatically created and registered:
isAutoCreateGroupingDPs()
,
GroupingKeys.GROUP_DPKEY
,
GroupingKeys.NODE_ID_DPKEY
,
GroupingKeys.PARENT_NODE_ID_DPKEY
protected void configureLookup(Graph graph, GraphMLWriter writer)
writer
.
This implementation add a HierarchySupport
created by
createHierarchySupport(y.base.Graph, y.io.graphml.output.GraphMLWriter)
,
a PortProvider
created via createPortProvider(y.base.Graph, y.io.graphml.output.GraphMLWriter)
a custom GraphElementIdProvider
as well as this instance as GraphMLHandler
to the lookup.
graph
- The graph that will be written.writer
- The writer to configure.GraphMLWriter.setLookup(Class,Object)
,
HierarchySupport
,
PortProvider
,
GraphElementIdProvider
,
GraphMLHandler
protected HierarchySupport createHierarchySupport(Graph graph, GraphMLWriter writer)
HierarchySupport
that can be used to traverse the hierarchy structure of the graph.
graph
- The graph to create the support for.writer
- The writer the support is used in.
protected PortProvider createPortProvider(Graph graph, GraphMLWriter writer)
PortProvider
that is used to get the ports to write.
graph
- The graph the provider shall provide ports for.writer
- The writer that uses the port provider.
protected void configureLookup(Graph graph, GraphMLParser parser)
parser
.
This implementation does add a GraphElementIdAcceptor
as well as
a ReferenceResolver
to the lookup.
graph
- The graph that will be populated.parser
- The parser to configure.GraphMLParser.setLookup(Class,Object)
,
GraphElementIdAcceptor
,
ReferenceResolver
protected void configureInputHandlers(Graph graph, GraphMLParser parser)
GraphMLParser.fireQueryInputHandlersEvent(y.io.graphml.input.QueryInputHandlersEvent)
event.
Support for post-processors is added by default
.
graph
- The graph object the parser shall use.parser
- The parser that should be configured.protected void configureOutputHandlers(Graph graph, GraphMLWriter writer)
QueryOutputHandlersEvent
event.
This implementation does add handlers writing the node and edge layouts.
graph
- The graph that will be written.writer
- The writer that should be configured.public void write(Graph graph, java.lang.String name) throws java.io.IOException
name
- The name of the output file
java.io.IOException
public void read(Graph graph, java.lang.String name) throws java.io.IOException
name
- The name of the file to be read.
java.io.IOException
public void read(Graph graph, java.net.URL url) throws java.io.IOException
url
- The url of the resource to be read.
java.io.IOException
protected GraphElementFactory createGraphElementFactory(GraphMLParser parser, Graph graph)
GraphElementFactory
instance that creates the graph elements for the
graph
instance.
parser
- The parser to use.graph
- The graph that is populated.
GraphElementFactory
instance that is configured for the given parameters.public DataProvider getIdDataProvider()
setIdDataProvider(y.base.DataProvider)
setIdDataProvider(y.base.DataProvider)
public void setIdDataProvider(DataProvider idDataProvider)
DataProvider
instance that provides graphml element ids for each element.
GraphMLWriter
will be used.setGraphIdProvider(y.base.DataProvider)
idDataProvider
- public DataProvider getGraphIdProvider()
setGraphIdProvider(y.base.DataProvider)
setGraphIdProvider(y.base.DataProvider)
public void setGraphIdProvider(DataProvider graphIdProvider)
DataProvider
instance that provides graphml element ids for each graph itself.
This should provide a graph id for each group node in hierarchic graphs.
GraphMLWriter
will be used.
graphIdProvider
- public DataAcceptor getIdDataAcceptor()
setIdDataAcceptor(y.base.DataAcceptor)
setIdDataAcceptor(y.base.DataAcceptor)
public void setIdDataAcceptor(DataAcceptor idDataAcceptor)
DataAcceptor
instance that stores graphml element ids.
This stores a graphml element id for each graph element, except for nested graphs (see setGraphIdAcceptor(y.base.DataAcceptor)
idDataAcceptor
- public DataAcceptor getGraphIdAcceptor()
setGraphIdAcceptor(y.base.DataAcceptor)
setGraphIdAcceptor(y.base.DataAcceptor)
public void setGraphIdAcceptor(DataAcceptor graphIdAcceptor)
DataAcceptor
instance that stores graphml graph element ids for each graph itself.
This stores a graph id for each group node in hierarchic graphs.
graphIdAcceptor
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |