Properties
Methods
removes all shapes from a group/surface
Parameter | Type | Description |
---|
dispose | boolean | :
Indicates whether the graph contents should be disposed. The default
value is true. |
The description defined in the template parameter must specify which shape
in the template defines the link path by means of the dojoAttachPoint attribute set to 'path'.
In addition, the optional start and end arrow shapes can be defined in the template
object and in this case must be declared using the corresponding 'startArrow' and '_endArrow'
dojoAttachPoint's.
Parameter | Type | Description |
---|
template | String | The template of the new link. If not specified, the default link template is used. |
context | | |
Creates a new node in this Graph.
Parameter | Type | Description |
---|
template | String | The template of the new node. If not specified, the default node template is used.
If null, then an empty node is created. |
context | | |
Creates a new subgraph in this Graph.
Parameter | Type | Description |
---|
template | String | The template of the new subgraph. If not specified or null, the default subgraph template is used. |
context | | |
Creates a new swim lane in this Graph.
Parameter | Type | Description |
---|
template | String | The template of the new swim lane. If not specified or null, the default swim lane template is used. |
context | | |
Changes the transform of this Graph so that the whole graph is visible in its parent surface.
Parameter | Type | Description |
---|
margin | number: | A margin (in pixels) to leave around the graph contents. |
zoomOutOnly | boolean: | If true, the graph will only be zoomed out, that is, if its contents are smaller than the surface,
the graph will only be centered and not zoomed in.
If false, the graph will be zoomed in or out to fit the size of the parent surface. |
getFitToContentsTransform dojox.gfx.matrix.Matrix2D:
The transform to apply to the graph. If the parent of the graph is not a GFX Surface,
the identity matrix is returned.
Computes the transform to apply to this Graph so that the whole graph is visible in its parent surface.
Parameter | Type | Description |
---|
margin | number: | A margin (in pixels) to leave around the graph contents. |
zoomOutOnly | boolean: | If true, the graph will only be zoomed out, that is, if its contents are smaller than the surface,
the graph will only be centered and not zoomed in.
If false, the graph will be zoomed in or out to fit the size of the parent surface. |
ibm_ilog.graphlayout.GraphLayout:
The link layout algorithm that will be executed on the contents of this graph
when performGraphLayout is called.
Gets the link layout algorithm that will be executed on the contents of this graph
when performGraphLayout is called.
Returns Array
Returns the links (that is, instances of ibm_ilog.diagram.Link) contained in this Graph.
Rectangle
A rectangle (x/y/width/height) that specifies the region where nodes
are allowed to be moved. If null, node moves are not limited.
The default is null (no limit).
ibm_ilog.graphlayout.GraphLayout:
The graph layout algorithm that will be executed on the contents of this graph
when performGraphLayout is called.
Gets the graph layout algorithm that will be executed on the contents of this graph
when performGraphLayout is called.
Returns Array
Returns the nodes (that is, instances of ibm_ilog.diagram.Node) contained in this Graph.
Returns the selection object, if selection is enabled in the graph (isSelect == true).
Returns Array
Returns the subgraphs (that is, instances of ibm_ilog.diagram.Subgraph) contained in this Graph.
returns text direction of the graph
Parameter | Type | Description |
---|
p | | |
tolerance | | |
boolean:
True if graph layout is animated, false otherwise.
Returns the flags that determines if an animation must be displayed after a graph layout has been performed.
boolean:
True if fitToContents() is automatically called to show all the graph after a graph layout is performed.
Returne the boolean that determines if fitToContents is called after a graph layout is performed.
Returns the flag specifying if the link layout must be executed automatically
whenever the graph changes.
returns Boolean:
True if the link layout will be executed automatically whenever the graph changes.
False if the link layout is executed only by calling performGraphLayout explicitly.
Boolean
True if the graph layout will be executed automatically whenever the graph changes.
False if the graph layout is executed only by calling performGraphLayout explicitly.
Returns the flag specifying if the graph layout must be executed automatically
whenever the graph changes.
boolean:
True if the link layout is active, false otherwise.
Returns true if the link layout is active, or false otherwise.
Returns true if move is enabled, or false if move is disabled.
boolean:
True if the graph layout is active, false otherwise.
Returns true if the graph layout is active, or false otherwise.
Returns Boolean
Returns true if selection is enabled, or false if selection is disabled.
If a non-null graph layout has been specified by calling setNodeLayout(),
and if the graph layout is active (that is, unless setNodeLayoutActive(false) has been called),
then the graph layout algorithm is performed on the contents of this graph.
Then, if a non-null link layout has been specified by calling setLinkLayout(),
and if the link layout is active (that is, unless setLinkLayoutActive(false) has been called),
then the link layout algorithm is performed on the contents of this graph.
Parameter | Type | Description |
---|
recursive | boolean | boolean: If true, the graph layout is executed recursively on all Subgraphs contained in this Graph.
If false, the graph layout is executed only on this Graph. |
Determines if an animation must be displayed after a graph layout has been performed.
Parameter | Type | Description |
---|
animated | boolean: | If true, an animation moves the nodes and reshapes the links from their position/shape
before the layout to their position/shape after the layout. |
Determines if fitToContents is called after a graph layout is performed.
Parameter | Type | Description |
---|
autoFit | boolean: | If true, fitToContents() is automatically called to show all the graph after a graph layout is performed. |
Determines if the link layout must be executed automatically
whenever the graph changes.
Parameter | Type | Description |
---|
automatic | boolean: | If true, the link layout will be executed automatically whenever the graph changes.
If false, the link layout must be executed by calling performGraphLayout explicitly. |
Determines if the graph layout must be executed automatically
whenever the graph changes.
Parameter | Type | Description |
---|
automatic | boolean: | If true, the graph layout will be executed automatically whenever the graph changes.
If false, the graph layout must be executed by calling performGraphLayout explicitly. |
Sets the link layout algorithm that will be executed on the contents of this graph
when performGraphLayout is called.
Parameter | Type | Description |
---|
layout | ibm_ilog.graphlayout.GraphLayout | ibm_ilog.graphlayout.GraphLayout: The link layout algorithm that will be executed on the contents of this graph
when performGraphLayout is called. |
If the link layout is active, it will be performed when performGraphLayout() is called.
For example, you can call setLinkLayoutActive(false) if you want to perform only a graph layout.
Parameter | Type | Description |
---|
active | boolean: | True to activate the link layout, false to deactivate it. |
Enables or disables interactive move on this Graph.
Note that enabling move also enables select automatically.
select: Boolean
If true, the user will be able to move nodes by dragging them.
If false, move will be disabled.
Parameter | Type | Description |
---|
move | | |
This method lets you limit interactive node moves to a given rectangle in the Graph.
Parameter | Type | Description |
---|
rect | Rectangle | A rectangle (x/y/width/height) that specifies the region where nodes
are allowed to be moved. If null, node moves are not limited. |
Sets the graph layout algorithm that will be executed on the contents of this graph
when performGraphLayout is called.
Parameter | Type | Description |
---|
layout | ibm_ilog.graphlayout.GraphLayout | ibm_ilog.graphlayout.GraphLayout: The graph layout algorithm that will be executed on the contents of this graph
when performGraphLayout is called. |
If the graph layout is active, it will be performed when performGraphLayout() is called.
For example, you can call setNodeLayoutActive(false) if you want to perform only a link layout.
Parameter | Type | Description |
---|
active | boolean: | True to activate the graph layout, false to deactivate it. |
Enables or disables interactive selection on this Graph.
Parameter | Type | Description |
---|
select | Boolean | If true, the user will be able to select nodes by clicking on them.
If false, selection will be disabled. |
set text direction to graph, propagate a new text direction to children (subgraphs, nodes, links)
Parameter | Type | Description |
---|
textdir | String | String, text direction |
Events
This event is called to signal that the contents of the graph have changed.
This event lets a Graph forbid or limit node moves.
The event handler can modify the delta argument:
if delta.x or delta.y are modified, the move is limited to the new delta
(and other objects moved together with the specified element will also be limited accordingly).
The default implementation checks the limits set by setMoveLimits(rect) (null by default -> no limit).
Parameter | Type | Description |
---|
element | ibm_ilog.diagram.GraphElement | The element being moved |
transform | dojox.gfx.matrix.Matrix2D | The original transform of the element. |
delta | Point | An object with x and y properties specifying the move delta.
This argument can be modified by event handlers to forbid of limit the move. |
Called on each step of the graph layout animation, if isAnimatedGraphLayout() is true.
Parameter | Type | Description |
---|
v | number: | A value between 0 and 100 specifying the progress of the animation. |
Called when the graph layout animation ends, if isAnimatedGraphLayout() is true.
Called when the graph layout animation starts, if isAnimatedGraphLayout() is true.