|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.yworks.yfiles.server.graphml.support.AbstractGraphRoundtripSupport com.yworks.yfiles.server.graphml.support.Graph2DRoundtripSupportBase
A RoundtripSupport for use with the y.view
package.
The io handler will be configured to parse and serialize NodeRealizer
and EdgeRealizer
instances by using NodeRealizerSerializer
s and EdgeRealizerSerializer
s.
Field Summary |
Fields inherited from class com.yworks.yfiles.server.graphml.support.AbstractGraphRoundtripSupport |
EDGE_2_ID_DPKEY, mappers, NODE_2_ID_DPKEY, objectMappers, PARAM_GRAPH, RESPONSE_DOCUMENT_TAG, USERTAGS_DPKEY |
Constructor Summary | |
Graph2DRoundtripSupportBase()
|
Method Summary | |
protected void |
configureHandler(Graph2DGraphMLHandler handler)
Configures the provided handler. |
protected void |
configureRoundtripGraph(LayoutGraph layoutGraph)
Configure the layout graph. |
protected Graph2DGraphMLHandler |
createHandler()
Creates the handler that will be used for the IO. |
LayoutGraph |
createRoundtripGraph()
Creates a Graph2D instance and calls configureRoundtripGraph(y.layout.LayoutGraph) . |
boolean |
isHierarchyEnabled()
Gets whether the roundtrip graph should be configured with hierarchy support. |
void |
readGraph(java.io.InputStream is,
Graph graph)
Reads the graph from the given stream using the current handler. |
void |
readGraph(java.net.URL url,
Graph graph)
Reads the graph from the given url using the current handler. |
void |
sendGraph(Graph graph,
java.io.OutputStream os,
java.lang.String outputEncoding)
Writes the current graph to the stream in GraphML format using the provided encoding. |
void |
setHierarchyEnabled(boolean hierarchyEnabled)
Sets whether the roundtrip graph should be configured with hierarchy support. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Graph2DRoundtripSupportBase()
Method Detail |
protected void configureHandler(Graph2DGraphMLHandler handler)
createHandler()
after the creation of the
handler instance.
The default implementation adds input and output handlers for custom mapper attributes as well as for node and
edge ids stored in data providers using the keys AbstractGraphRoundtripSupport.NODE_2_ID_DPKEY
and AbstractGraphRoundtripSupport.EDGE_2_ID_DPKEY
.
handler
- The io handler to be configured.public boolean isHierarchyEnabled()
public void setHierarchyEnabled(boolean hierarchyEnabled)
public void readGraph(java.io.InputStream is, Graph graph) throws java.io.IOException
RoundtripSupport
is
- the stream to use - the encoding should be UTF-8graph
- the graph to read the result in.
java.io.IOException
- if an io exception occurred.protected Graph2DGraphMLHandler createHandler()
configureHandler(y.io.graphml.graph2d.Graph2DGraphMLHandler)
which adds IO support for the node ids
and
edge ids
as well as for custom mappers.
createRoundtripGraph()
.public void readGraph(java.net.URL url, Graph graph) throws java.io.IOException
RoundtripSupport
url
- the URL to usegraph
- the graph to read the result in.
java.io.IOException
- if an io exception occurred.public void sendGraph(Graph graph, java.io.OutputStream os, java.lang.String outputEncoding) throws java.io.IOException
RoundtripSupport
graph
- The current graph.os
- The stream to write the graph to.
java.io.IOException
- If something goes wrong during GraphML export.public LayoutGraph createRoundtripGraph()
Graph2D
instance and calls configureRoundtripGraph(y.layout.LayoutGraph)
.
protected void configureRoundtripGraph(LayoutGraph layoutGraph)
AbstractGraphRoundtripSupport
The default implementation adds the data providers that are required for client-server round tripping and the data
providers for any custom mappers that were added using
AbstractGraphRoundtripSupport.addMapper(Object, String,y.io.graphml.KeyType,y.io.graphml.KeyScope)
and
AbstractGraphRoundtripSupport.addObjectMapper(Object, y.io.graphml.KeyScope, y.io.graphml.output.SerializationHandler, y.io.graphml.input.DeserializationHandler)
.
configureRoundtripGraph
in class AbstractGraphRoundtripSupport
layoutGraph
- The layout graph instance that is used for round tripping.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |