This class executes a layout algorithm on a server.
operation:
A ServerSideLayout object is constructed with the Graph object and the
URL where the layout service is located.
To execute a layout, the user must select the algorithm with the standard
client-side GraphLayout API:
graph.setNodeLayout(x);
graph.setLinkLayout(y);
After this, the ServerSideLayout object can be used to execute these
algorithms on the server by calling:
serverSideLayout.layout();
This will obtain the currently configured layouts on the graph object,
including optional settings for laying out internal subgraphs, gather
their configured parameters and requesting the equivalent layout on the
server.
Each time a layout is requested, the graph and the layout settings are
serialized into a JSON object sent in the request.
The layout() method returns a dojo.Deferred which is signaled after the
execution is complete.
ibm_ilog.diagram.graphlayout._AsynchronousLayout
Method Summary
constructor(graph, url)Creates and configures a ServerSideLayout object.
getTimeout() returns intReturns the current timeout for the request sent to the server.
getUrl() returns StringReturns the location of the layout service at the server.
isLocalParametersEnabled() returns BooleanReturns 'true' if the local (per node and per link) layout parameters are enabled.
isRunning()Returns true if the layout is currently running.
layout() returns dojo.DeferredRequests the layout and applies the results.
setLocalParametersEnabled(enabled)Sets whether the local (per node and per link) layout parameters
are sent to the server-side layout service or to the web worker.
enable: Boolean
'true' to enable the local parameters or 'false' to disable it.
setTimeout(msTimeout)Sets the timeout for the request sent to the server. The unit is milliseconds.
setUrl(url)Set the location of the layout service at the server.
Returns int: The timeout (in milliseconds) for the request sent to the server.
Returns the current timeout for the request sent to the server.
getUrl
Returns String: The location of the layout service at the server.
Returns the location of the layout service at the server.
isLocalParametersEnabled
Defined by ibm_ilog.diagram.graphlayout._AsynchronousLayout
Returns Boolean: 'true' if the local (per node and per link) layout parameters are enabled.
Returns 'true' if the local (per node and per link) layout parameters are enabled.
isRunning
Defined by ibm_ilog.diagram.graphlayout._AsynchronousLayout
Returns true if the layout is currently running.
layout
Defined by ibm_ilog.diagram.graphlayout._AsynchronousLayout
Returns dojo.Deferred: a dojo.Deferred to signal when the process finishes.
Requests the layout and applies the results.
setLocalParametersEnabled
Defined by ibm_ilog.diagram.graphlayout._AsynchronousLayout
Sets whether the local (per node and per link) layout parameters
are sent to the server-side layout service or to the web worker.
enable: Boolean
'true' to enable the local parameters or 'false' to disable it.
Parameter
Type
Description
enabled
setTimeout
Sets the timeout for the request sent to the server. The unit is milliseconds.
Parameter
Type
Description
msTimeout
int
The timeout (in milliseconds) for the request sent to the server.
setUrl
Set the location of the layout service at the server.
Parameter
Type
Description
url
String
The URL of the layout service at the server.
stop
Defined by ibm_ilog.diagram.graphlayout._AsynchronousLayout
If a graph layout is currently running, calling this method will stop
the graph layout execution.
No result is applied and the graph stays unchanged.