com.yworks.yfiles.server.tiles.servlet.action
Class ClientControl

java.lang.Object
  extended bycom.yworks.yfiles.server.tiles.servlet.action.ClientControl

public class ClientControl
extends Object

This class provides facilities for controlling the client side post-processing after a server side custom action has been performed.


Constructor Summary
ClientControl(ActionContext context)
          creates a new instance from the given context.
 
Method Summary
 String createJSONResponse()
          constructs a JSON string from the current settings and returns it.
 String getCustomResponse()
          returns the custom response to be sent to the client.
 EdgeList getEdges()
          returns the set of edges, for which the corresponding ids will be sent to the client.
 Graph2D getGraph()
          returns the graph.
 String getGraphName()
          returns the graph name.
 int getHitTypes()
          returns the event types mask for the client side hit test.
 NodeList getNodes()
          returns the set of nodes, for which the corresponding ids will be sent to the client.
 javax.servlet.http.HttpSession getSession()
          returns the session of the request that triggered the action.
 ViewPort getViewPort()
          returns the view port to be sent to the client.
 boolean isRefreshCanvas()
          returns whether the client canvas should be refreshed after the performing the server side action.
 boolean isUpdateHierarchy()
          returns whether the client side hierarchy data should be updated after the performing the server side action.
 boolean isUpdateHitTest()
          returns whether the client side hit test data should be updated after the performing the server side action
 boolean isUpdateSelection()
          returns whether the client side selection should be updated after the performing the server side action.
 boolean isUpdateWorldBounds()
          returns whether the client side world bounds should be updated after the performing the server side action.
 void setCustomResponse(String response)
          sets the custom response to be sent to the client.
 void setEdges(EdgeList edges)
          sets the set of edges, for which the corresponding ids will be sent to the client.
 void setGraph(Graph2D graph)
          sets the graph.
 void setHitTypes(int hitTypes)
          sets the event types mask for the client side hit test.
 void setNodes(NodeList nodes)
          sets the set of nodes, for which the corresponding ids will be sent to the client.
 void setRefreshCanvas(boolean refreshCanvas)
          sets whether the client canvas should be refreshed after the performing the server side action.
 void setSession(javax.servlet.http.HttpSession session)
          sets the session.
 void setUpdateHierarchy(boolean updateHierarchy)
          sets whether the client side hierarchy data should be updated after the performing the server side action.
 void setUpdateHitTest(boolean updateHitTest)
          sets whether the client side hit test data should be updated after the performing the server side action.
 void setUpdateSelection(boolean updateSelection)
          sets whether the client side selection should be updated after the performing the server side action.
 void setUpdateWorldBounds(boolean updateWorldBounds)
          sets whether the client side world bounds should be updated after the performing the server side action.
 void setViewPort(ViewPort viewPort)
          sets the view port to be sent to the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientControl

public ClientControl(ActionContext context)
creates a new instance from the given context.

Parameters:
context - the context of an action
Method Detail

getSession

public javax.servlet.http.HttpSession getSession()
returns the session of the request that triggered the action.

Returns:
a session

setSession

public void setSession(javax.servlet.http.HttpSession session)
sets the session.

Parameters:
session - a session

getGraphName

public String getGraphName()
returns the graph name.

Returns:
the graph name or null

getGraph

public Graph2D getGraph()
returns the graph.

Returns:
the graph

setGraph

public void setGraph(Graph2D graph)
sets the graph.

Parameters:
graph - a graph

isUpdateHierarchy

public boolean isUpdateHierarchy()
returns whether the client side hierarchy data should be updated after the performing the server side action.

Returns:
whether the client side hierarchy data should be updated after the performing the server side action

setUpdateHierarchy

public void setUpdateHierarchy(boolean updateHierarchy)
sets whether the client side hierarchy data should be updated after the performing the server side action.

Parameters:
updateHierarchy - whether the client side hierarchy data should be updated after the performing the server side action

isUpdateHitTest

public boolean isUpdateHitTest()
returns whether the client side hit test data should be updated after the performing the server side action

Returns:
whether the client side hit test data should be updated after the performing the server side action.

setUpdateHitTest

public void setUpdateHitTest(boolean updateHitTest)
sets whether the client side hit test data should be updated after the performing the server side action.

Parameters:
updateHitTest - whether the client side hit test data should be updated after the performing the server side action

getHitTypes

public int getHitTypes()
returns the event types mask for the client side hit test.

Returns:
the event types mask for the client side hit test

setHitTypes

public void setHitTypes(int hitTypes)
sets the event types mask for the client side hit test.

Parameters:
hitTypes - the event types mask for the client side hit test

isUpdateWorldBounds

public boolean isUpdateWorldBounds()
returns whether the client side world bounds should be updated after the performing the server side action.

Returns:
whether the client side world bounds should be updated after the performing the server side action

setUpdateWorldBounds

public void setUpdateWorldBounds(boolean updateWorldBounds)
sets whether the client side world bounds should be updated after the performing the server side action.

Parameters:
updateWorldBounds - whether the client side world bounds should be updated after the performing the server side action

isUpdateSelection

public boolean isUpdateSelection()
returns whether the client side selection should be updated after the performing the server side action.

Returns:
whether the client side selection should be updated after the performing the server side action

setUpdateSelection

public void setUpdateSelection(boolean updateSelection)
sets whether the client side selection should be updated after the performing the server side action.

Parameters:
updateSelection - whether the client side selection should be updated after the performing the server side action

isRefreshCanvas

public boolean isRefreshCanvas()
returns whether the client canvas should be refreshed after the performing the server side action.

Returns:
whether the client canvas should be refreshed after the performing the server side action

setRefreshCanvas

public void setRefreshCanvas(boolean refreshCanvas)
sets whether the client canvas should be refreshed after the performing the server side action.

Parameters:
refreshCanvas - whether the client canvas should be refreshed after the performing the server side action

getEdges

public EdgeList getEdges()
returns the set of edges, for which the corresponding ids will be sent to the client.

Returns:
the set of edges, for which the corresponding ids will be sent to the client

setEdges

public void setEdges(EdgeList edges)
sets the set of edges, for which the corresponding ids will be sent to the client. The graph should be set and the edges should belong to this graph.

Parameters:
edges - the set of edges, for which the corresponding ids will be sent to the client

getNodes

public NodeList getNodes()
returns the set of nodes, for which the corresponding ids will be sent to the client.

Returns:
the set of nodes, for which the corresponding ids will be sent to the client

setNodes

public void setNodes(NodeList nodes)
sets the set of nodes, for which the corresponding ids will be sent to the client. The graph should be set and the nodes should belong to this graph.

Parameters:
nodes - the set of nodes, for which the corresponding ids will be sent to the client

getCustomResponse

public String getCustomResponse()
returns the custom response to be sent to the client.

Returns:
the custom response to be sent to the client

setCustomResponse

public void setCustomResponse(String response)
sets the custom response to be sent to the client.

Parameters:
response - the custom response to be sent to the client

getViewPort

public ViewPort getViewPort()
returns the view port to be sent to the client. The client will change the canvas accordingly, if it is available.

Returns:
the view port to be sent to the client

setViewPort

public void setViewPort(ViewPort viewPort)
sets the view port to be sent to the client. The client will change the canvas accordingly, if it is available.

Parameters:
viewPort - the view port to be sent to the client.

createJSONResponse

public String createJSONResponse()
constructs a JSON string from the current settings and returns it.

Returns:
a JSON string


Copyright © 2006-2013 yWorks GmbH. All rights reserved