com.yworks.yfiles.server.tiles.demos
Class GroupedGraphServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.yworks.yfiles.server.tiles.servlet.BaseServlet
              extended by com.yworks.yfiles.server.tiles.servlet.UpdateServlet
                  extended by com.yworks.yfiles.server.tiles.demos.GroupedGraphServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class GroupedGraphServlet
extends UpdateServlet

A demo servlet which incrementally adapts the layout of a grouped graph during group navigation.

See Also:
Serialized Form

Constructor Summary
GroupedGraphServlet()
           
 
Method Summary
protected  void closeGroup(Graph2D graph, Node groupNode)
          Collape a group node.
 void init(ServletConfig servletConfig)
           
protected  void openFolder(Graph2D graph, Node folderNode)
          Expand a folder node.
protected  void switchToSubgraph(HttpSession session, String graphName, Graph2D newGraph, Graph2D oldGraph)
          calls the super method and then does a new layout from scratch.
 
Methods inherited from class com.yworks.yfiles.server.tiles.servlet.UpdateServlet
createEdge, createFolderName, createFolderNode, createGroupName, createGroupNode, createNode, getDefaultEdgeRealizer, getDefaultFolderNodeRealizer, getDefaultGroupNodeRealizer, getDefaultNodeRealizer, handleGetRequest, handlePostRequest, moveNodes, moveToSubgraph, removeEdge, removeEdgeLabel, removeNode, removeNodeLabel, setDefaultEdgeRealizer, setDefaultFolderNodeRealizer, setDefaultGroupNodeRealizer, setDefaultNodeRealizer, setLabelText, setText, writeRealizerImage, writeRealizers
 
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 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, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupedGraphServlet

public GroupedGraphServlet()
Method Detail

init

public void init(ServletConfig servletConfig)
          throws ServletException
Specified by:
init in interface Servlet
Overrides:
init in class UpdateServlet
Throws:
ServletException

openFolder

protected void openFolder(Graph2D graph,
                          Node folderNode)
Expand a folder node. After expanding the folder node, an incremental layout is automatically triggered. For this, the expanded node and all of its decendants will be treated as incremental elements.

Overrides:
openFolder in class UpdateServlet
Parameters:
graph - the current subgraph
folderNode - the folder to be opened

closeGroup

protected void closeGroup(Graph2D graph,
                          Node groupNode)
Collape a group node. After collapsing the group node, an incremental layout is automatically triggered. For this, the collapsed node and its adjacent edges are treated as incremental elements.

Overrides:
closeGroup in class UpdateServlet
Parameters:
graph - the current subgraph.
groupNode - the group to be closed

switchToSubgraph

protected void switchToSubgraph(HttpSession session,
                                String graphName,
                                Graph2D newGraph,
                                Graph2D oldGraph)
calls the super method and then does a new layout from scratch.

Overrides:
switchToSubgraph in class UpdateServlet
Parameters:
session - the session for the request
graphName - the symbolic name of the whole hierarchically organized graph
newGraph - the subgraph to switch to
oldGraph - the subgraph before serving the request


Copyright © 2006-2008 yWorks GmbH. All rights reserved