|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.yworks.yfiles.server.tiles.servlet.BaseServlet
com.yworks.yfiles.server.tiles.servlet.LayoutServlet
This servlet handles layout requests for server side graphs. You can customize this servlet
by overriding createLayouter(HttpServletRequest, Graph2D, boolean, Object)
in a
subclass.
Field Summary |
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 | |
LayoutServlet()
|
Method Summary | |
protected Layouter |
createLayouter(javax.servlet.http.HttpServletRequest request,
Graph2D graph,
boolean hasGroups,
Object selectionKey)
returns a layouter to do the layout of the given graph as specified by the request. |
protected void |
doLayout(Graph2D graph,
Layouter layouter)
does the actual layout. |
protected void |
handlePostRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
handles "layout" requests. |
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, handleGetRequest, 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 |
Constructor Detail |
public LayoutServlet()
Method Detail |
protected void handlePostRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
handlePostRequest
in class BaseServlet
request
- the requestresponse
- the response
javax.servlet.ServletException
IOException
protected Layouter createLayouter(javax.servlet.http.HttpServletRequest request, Graph2D graph, boolean hasGroups, Object selectionKey)
returns a layouter to do the layout of the given graph as specified by the request. The layout is performed by
the calling code using the layouter returned by this method. If this method returns null
, then the
calling code leaves the graph unchanged and returns a 404 response to the client. Subclasses can override this
method to achieve custom layouts.
Parameters for the layout can be transferred from the client via the request object if necessary.
The calling code takes care of setting up the grouping keys for the graph using a GroupLayoutConfigurator if necessary. A custom implementation of this method does not have to care about this. However, you may want to choose a specialized layouter for graphs with group nodes, since some Layouters do not support graphs with group nodes (e.g. OrthogonalLayouter ignores grouping information, so this method uses OrthogonalGroupLayouter for an orthogonal layout, if the graph contains group nodes).
The calling code sets up a data provider containing all labels, which are not internal node labels. These are
the labels which normally need to be laid out. It is up to the needs of a custom implementation in a subclass,
whether the data provider is used (e.g. labeling.setSelection(selectionKey)
) or not.
This implementation uses the "type" parameter of the request to either do an orthogonal, organic or hierarchic layout with generic settings. If the graph has groups, this is taken into account. It also honors the data provider for labels.
request
- the layout requestgraph
- the graph to be laid outhasGroups
- is true, if the graph has groupsselectionKey
- is the key of a data provider for the labels to be laid out
null
protected void doLayout(Graph2D graph, Layouter layouter)
graph
- the graphlayouter
- the layouter to be used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |