com.yworks.yfiles.server.tiles.servlet
Class TileServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.yworks.yfiles.server.tiles.servlet.BaseServlet
com.yworks.yfiles.server.tiles.servlet.TileServlet
- All Implemented Interfaces:
- Serializable, Servlet, ServletConfig
public class TileServlet
- extends BaseServlet
This servlet serves information for displaying and interacting with a graph.
A graph tile is an image of a part of the graph. The image of a tile is a quadratic PNG. Its magnification with
respect to the world coordinates of the graph is controlled by the zoom factor. For a fixed graph and a fixed
zoom factor, all tiles form a grid covering the plane containing the graph. One of those tiles is specified
by its column and row.
For interacting with a graph, information on the bounds of the graph elements can be requested, which enables
client side hit tests.
- See Also:
- Serialized Form
| Methods inherited from class com.yworks.yfiles.server.tiles.servlet.BaseServlet |
cachedGraphs, cacheGraph, doGet, doPost, getEdgeDescription, getEdgeURL, getForId, getGraph, getGraphBounds, getId, getId, getId, getId, getNodeDescription, getNodeURL, getWriter, hasDescriptions, hasURLs, init, initialize, newGraph, setEdgeDescription, setEdgeURL, setNodeDescription, setNodeURL, uncacheGraph, writeWorldBounds |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TileServlet
public TileServlet()
handleGetRequest
protected void handleGetRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
- answers "GET" requests of kind "getWorldBounds", "getElementBounds" and "getImage".
"getWorldBounds" returns the world bounds as an enclosing rectangle for a given graph in JSON format.
"getElementBounds" returns hit test information for a given graph in JSON format.
"getImage" returns a PNG image for a part of the graph.
All kinds of requests have a mandatory parameter "path" describing the graph for the request.
"getWorldBounds" has no further parameters.
"getImage" uses the mandatory parameters "zoom", "row", "col" and "size".
- "zoom" is a double specifying the magnification factor of view units with respect to world units
- "size" is the width and height of the image of a tile in view units
- "col" specifies the x coordinate range of a tile, a tile at column c starts at c*size
view units and extends over size view units
- "row" specifies the y coordinate range of a tile, a tile at row r starts at r*size
view units and extends over size view units
"getElementBounds" uses the mandatory parameters "x", "y", "width", "height" and "types".
- "x" and "y" are doubles specifying the upper left corner of the rectangular area for which to obtain
element bounds in world units
- "width" and "height" are doubles specifying the width and height of the rectangular area for which to obtain
element bounds in world units
- "types" is an integer specifying the kinds of elements for which to get information. Nodes are specified
by 1, edges by 2, node labels by 4 and edge labels by 8. Combinations are specified by ORing these values
together.
- Overrides:
handleGetRequest in class BaseServlet
- Parameters:
request - the current requestresponse - the answer to the client
- Throws:
ServletException
IOException
handlePostRequest
protected void handlePostRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
- calls
handleGetRequest(HttpServletRequest, HttpServletResponse).
- Overrides:
handlePostRequest in class BaseServlet
- Parameters:
request - the current requestresponse - response the answer to the client
- Throws:
ServletException
IOException
Copyright © 2006-2008 yWorks GmbH. All rights reserved