com.yworks.yfiles.server.tiles.servlet
Class TileServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.yworks.yfiles.server.tiles.servlet.BaseServlet
              extended bycom.yworks.yfiles.server.tiles.servlet.TileServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.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

Field Summary
static double DEFAULT_PAINT_DETAIL_THRESHOLD
          The default value used if no parameter for "paintDetailThreshold" was submitted.
 
Fields inherited from class com.yworks.yfiles.server.tiles.servlet.BaseServlet
EDGE_DESCRIPTION_KEY, EDGE_URL_KEY, NODE_DESCRIPTION_KEY, NODE_URL_KEY
 
Constructor Summary
TileServlet()
           
 
Method Summary
protected  void handleGetRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          answers "GET" requests of kind "getWorldBounds", "getElementBounds" and "getImage".
protected  void handlePostRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          calls handleGetRequest(HttpServletRequest, HttpServletResponse).
 
Methods inherited from class com.yworks.yfiles.server.tiles.servlet.BaseServlet
addViewConfigurator, cachedGraphs, cacheGraph, doGet, doPost, getEdgeDescription, getEdgeURL, getForId, getGraph, getGraphBounds, getGraphContentBounds, getId, getId, getId, getId, getNodeDescription, getNodeURL, getReadWriteLock, getSessionMonitor, getViewConfigurators, getWriter, hasDescriptions, hasURLs, init, initialize, isUseJSONPrefixing, lookupId, lookupId, lookupId, lookupId, newGraph, readLock, registerLicense, removeViewConfigurator, setEdgeDescription, setEdgeURL, setNodeDescription, setNodeURL, uncacheGraph, unlockRead, unlockWrite, updateEdgePaths, validateIds, writeContentBounds, writeLock, writeWorldBounds
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PAINT_DETAIL_THRESHOLD

public static final double DEFAULT_PAINT_DETAIL_THRESHOLD
The default value used if no parameter for "paintDetailThreshold" was submitted.

See Also:
Graph2DView.setPaintDetailThreshold(double), Constant Field Values
Constructor Detail

TileServlet

public TileServlet()
Method Detail

handleGetRequest

protected void handleGetRequest(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws javax.servlet.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".

"getElementBounds" uses the mandatory parameters "x", "y", "width", "height" and "types".

Overrides:
handleGetRequest in class BaseServlet
Parameters:
request - the current request
response - the answer to the client
Throws:
javax.servlet.ServletException
IOException

handlePostRequest

protected void handlePostRequest(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws javax.servlet.ServletException,
                                 IOException
calls handleGetRequest(HttpServletRequest, HttpServletResponse).

Overrides:
handlePostRequest in class BaseServlet
Parameters:
request - the current request
response - response the answer to the client
Throws:
javax.servlet.ServletException
IOException


Copyright © 2006-2013 yWorks GmbH. All rights reserved