|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.yworks.yfiles.server.graphml.support.AbstractGraphRoundtripSupport
com.yworks.yfiles.server.graphml.support.Graph2DRoundtripSupport
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 NodeRealizerSerializers and EdgeRealizerSerializers.
| Field Summary |
| Fields inherited from class com.yworks.yfiles.server.graphml.support.AbstractGraphRoundtripSupport |
EDGE_2_ID_DPKEY, mappers, NODE_2_ID_DPKEY, PARAM_GRAPH, RESPONSE_DOCUMENT_TAG |
| Constructor Summary | |
Graph2DRoundtripSupport()
|
|
| Method Summary | |
protected void |
configureHandler(GraphMLIOHandler handler)
Configures the provided handler. |
protected void |
configureRoundtripGraph(LayoutGraph layoutGraph)
Configure the layout graph. |
protected GraphMLIOHandler |
createHandler()
Creates the handler that will be used for the IO. |
LayoutGraph |
createRoundtripGraph()
Creates a Graph2D instance and calls configureRoundtripGraph. |
boolean |
isHierarchyEnabled()
Gets whether the roundtrip graph should be configured with hierarchy support. |
boolean |
readGraph(javax.servlet.http.HttpServletRequest request,
Graph graph)
If the request contains the AbstractGraphRoundtripSupport.PARAM_GRAPH parameter, the parameter value is used for updating the graph
instance currently stored in the session.
|
void |
readGraph(InputStream is,
Graph graph)
Reads the graph from the given stream using the current handler. |
void |
readGraph(URL url,
Graph graph)
Reads the graph from the given url using the current handler. |
void |
sendGraph(Graph graph,
javax.servlet.http.HttpServletResponse response)
Send the current graph to the client in GraphML format using UTF-8 encoding. |
void |
sendGraph(Graph graph,
OutputStream os,
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 com.yworks.yfiles.server.graphml.support.AbstractGraphRoundtripSupport |
addMapper, createXmlWriter, getGraphDecoder, sendError, sendError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Graph2DRoundtripSupport()
| Method Detail |
protected void configureHandler(GraphMLIOHandler handler)
createHandler() after the creation of the
handler instance.
The default implementation adds input and output handlers for custom mapper attributes.
handler - The io handler to be configured.public boolean isHierarchyEnabled()
public void setHierarchyEnabled(boolean hierarchyEnabled)
public void readGraph(InputStream is,
Graph graph)
throws IOException
AbstractGraphRoundtripSupport
readGraph in class AbstractGraphRoundtripSupportis - the stream to use - the encoding should be UTF-8graph - the graph to read the result in.
IOException - if an io exception occured.protected GraphMLIOHandler createHandler()
node ids and edge ids This implementation creates the instance and
calls configureHandler(GraphMLIOHandler)
createRoundtripGraph().
public boolean readGraph(javax.servlet.http.HttpServletRequest request,
Graph graph)
throws IOException
AbstractGraphRoundtripSupportAbstractGraphRoundtripSupport.PARAM_GRAPH parameter, the parameter value is used for updating the graph
instance currently stored in the session.
To decide whether the value of the AbstractGraphRoundtripSupport.PARAM_GRAPH parameter has to be decoded and decompressed,
the "graphEncoding" parameter is used. For example, to indicate base64-encoded, zlib-compressed and URI-encoded
data, the value has to be "base64/deflate/encodeURIComponent".
readGraph in class AbstractGraphRoundtripSupportrequest - The servlet request
IOException - If parsing goes wrong.
public void readGraph(URL url,
Graph graph)
throws IOException
AbstractGraphRoundtripSupport
readGraph in class AbstractGraphRoundtripSupporturl - the URL to usegraph - the graph to read the result in.
IOException - if an io exception occured.
public void sendGraph(Graph graph,
javax.servlet.http.HttpServletResponse response)
throws IOException
AbstractGraphRoundtripSupportUTF-8 encoding. This method will close
the response stream.
The response content type is set to "text/xml".
sendGraph in class AbstractGraphRoundtripSupportgraph - The current graph.response - The response that will be sent to the client.
IOException - If something goes wrong during GraphML export.
public void sendGraph(Graph graph,
OutputStream os,
String outputEncoding)
throws IOException
AbstractGraphRoundtripSupport
sendGraph in class AbstractGraphRoundtripSupportgraph - The current graph.os - The stream to write the graph to.
IOException - If something goes wrong during GraphML export.public LayoutGraph createRoundtripGraph()
Graph2D instance and calls configureRoundtripGraph.
createRoundtripGraph in class AbstractGraphRoundtripSupportprotected void configureRoundtripGraph(LayoutGraph layoutGraph)
AbstractGraphRoundtripSupport
The default implementation adds the data providers that are required for
client-server roundtripping and the data providers for any custom mappers
that were added using AbstractGraphRoundtripSupport.addMapper(Object, String, int, int).
configureRoundtripGraph in class AbstractGraphRoundtripSupportlayoutGraph - the layout graph instance that is used for roundtripping.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||