Properties
defaultEditableRegionStyle style to be used for the editable region
Methods
The entity being annotated
Parameter | Type | Description |
---|
ge | ibm_ilog.diagram.GraphElement | The entity being annotated |
kwArgs | | |
this method is called after any graph element is disposed
Parameter | Type | Description |
---|
graphElement | | |
evaluates if the link between two nodes can be created, based on the allowCreateLinkFunction
Parameter | Type | Description |
---|
startNode | ibm_ilog.diagram.Node | the possible link start node
enNode: ibm_ilog.diagram.Node
the possible link end node |
endNode | | |
evaluates if the nodes can be created, based on the allowCreateLinkFunction
Parameter | Type | Description |
---|
parent | ibm_ilog.diagram.Node | the possible parent of the node |
child | ibm_ilog.diagram.Node | the created node |
Parameter | Type | Description |
---|
itemOrGraphElement | | |
Parameter | Type | Description |
---|
iid | | |
assignments | | |
beforeGraphElementDispose this method is called before any graph element is disposed
Parameter | Type | Description |
---|
graphElement | | |
Centers the viewport on an object of the graph. Does not change the zoom level.
Parameter | Type | Description |
---|
nodeOrLink | Node|Link | |
options | {animate} | |
Parameter | Type | Description |
---|
focus | | |
newFocus | | |
possibleCursors | | |
mustchangeAdornersFocus | | |
Connects the specified nodes.
This method creates a ibm_ilog.diagram.Link instance invoking the createLink() method
and connects its extremities to the specified nodes. Optionally, one may specify
the linksStore item associated with this link.
Parameter | Type | Description |
---|
start | ibm_ilog.diagram.Node | : the link start node. |
end | ibm_ilog.diagram.Node | ibm_ilog.diagram.Node: the link end node. |
template | String||Object | Object or String : the template to use. Optional. |
linkItem | dojo.data.Item | dojo.data.Item: the data item corresponding to this link, if any. Optional. |
Parameter | Type | Description |
---|
clazz | | |
templates | | |
rootId | | |
a ibm_ilog.diagram.Link instance.
This method only creates the Link instance and does not connect the nodes. Caller may invoke
the Diagram.connectNodes() method instead, which invokes this method and perfom the connection.
Parameter | Type | Description |
---|
start | ibm_ilog.diagram.Node | the link start node. |
end | ibm_ilog.diagram.Node | the link end node. |
template | Object | or String
the template to use. Optional. |
linkItem | dojo.data.Item | the data item corresponding to this link, if any. Optional.
nodeType: Function
The type of the node instance. Optional. |
linkType | Function | Optional. |
An optional function that creates the ibm_ilog.diagram.Link instance for a given data
item.
The function receives the following parameters:
linkItem : the link data item, if any.
startNode: the link start node.
endNode: the link end node.
templateObj : the template object.
graph : the parent graph of the link.
diagram : a reference to this diagram widget.
A ibm_ilog.diagram.Node instance.
Creates a Node that represents the specified data item.
Parameter | Type | Description |
---|
template | Object | or String
The template to use for this node. Optional. |
item | dojo.data.api.Item | a data item associated with this node. Optional. |
onGraph | ibm_ilog.diagram.Graph | The parent graph of the node. If null, the top-level graph is used. Optional. |
nodeType | Function | Optional. The type of the node instance. Optional. |
An optional function that creates the ibm_ilog.diagram.Node instance for a given data
item.
The function receives the following parameters:
item : the data item associated with this node.
templateObj : A template object.
graph : the target graph to create the node from.
diagram : a reference to this diagram widget.
A ibm_ilog.diagram.Subgraph instance.
Creates a Subgraph that represents the specified data item.
Parameter | Type | Description |
---|
template | Object | or String The template to use for this subgraph. Optional. |
item | dojo.data.api.Item | a data item associated with this subgraph. Optional. |
onGraph | ibm_ilog.diagram.Graph | The parent graph of the subgraph. If null, the top-level graph is used. Optional. |
nodeType | Function | Optional. The type of the node instance. Optional. |
An optional function that creates the ibm_ilog.diagram.Subgraph instance for a given data
item.
The function receives the following parameters:
item : associated with this node.
templateObj : the template object.
graph : the target graph to create the subgraph from.
diagram : a reference to this diagram widget.
This method creates an instance of the specified type and populates it with the specified template.
If the template defines bindings to the shape or the data item (if any), bindings are resolved.
Parameter | Type | Description |
---|
shapeType | Function | The type of the instance. |
template | String||Object | Optional. a template defining the shape contents. If no template is specified, the default Subgraph template will be used. Optional. |
onGraph | ibm_ilog.diagram.Graph | Optional. the parent graph. Optional.
store : dojo.data.api.Read
a data store. Optional. |
style | Object | Optional. |
store | dojo.data.api.Read | Optional. |
item | Object | Optional. dojo.data.api.Item: a data item associated with this shape. Optional. |
Returns Boolean: true if the deletion could be performed, false otherwise.
This method should be invoked to delete the specified elements from the diagram and handles the
interface with the undo manager. The way the delete operation
itself is performed may be customized by setting the doDeleteFunction property to a custom implementation. The
default implementation removes and disposes the graphical shapes from the diagram without any datastore-related
considerations. If you need to change this behavior, set this property so that it gets invoked instead of the default implementation.
Parameter | Type | Description |
---|
elements | ibm_ilog.diagram.GraphElement[] | The elements to delete. |
Parameter | Type | Description |
---|
a | | |
An optional function that handles delete operation and returns a corresponding Action
to be added to the undo manager (see ibm_ilog.diagram.editor.undo.Action). If no function
is specified, the default behavior is to remove and dispose the graphical shapes from the diagram
without any datastore-related considerations.
The function receives the following parameters:
diagram: ibm_ilog.diagram.widget.Diagram. The diagram containing the elements to remove.
elements: ibm_ilog.diagram.GraphElement. The graphical elements to delete.
The function must returns a ibm_ilog.diagram.editor.undo.Action instance that matches the function implementation (aka:
capable of undoing the deletion).
Parameter | Type | Description |
---|
enabled | | |
Parameter | Type | Description |
---|
enable | | |
enableMarqueePartialSelection Parameter | Type | Description |
---|
b | boolean | |
TODO TBD. Probably to be renamed also
Parameter | Type | Description |
---|
margin | | |
zoomOutOnly | | |
This method is deprecated from 1.1. Use dojo.get('allowFreeLinks') instead.
true, if the diagram allow free links (links with no end or start node)
A dojox.collections.ArrayList with the annotations created for the graph element.
note:
Creates an empty list if none is registered yet.
Parameter | Type | Description |
---|
ge | | |
getAssociatedLinkAdornersFunction Parameter | Type | Description |
---|
ge | | |
getAssociatedNodeAdornersFunction Parameter | Type | Description |
---|
ge | | |
getAssociatedSubgraphAdornersFunction Returns the data item, if any, associated with the specified node or link.
Parameter | Type | Description |
---|
nodeOrLink | ibm_ilog.diagram.Node | || ibm_ilog.diagram.Link || ibm_ilog.diagram.Subgraph:
the node, link or subgraph instance. |
return the private instance of ibm_ilog.diagram.editor.Clipboard
return the drop interactor
The set of the editable attachpoint belonging to a graph element.
Return the editable attachpoints of a graph element
Parameter | Type | Description |
---|
ge | ibm_diargram.GraphElement | |
Parameter | Type | Description |
---|
ge | | |
An ibm_ilog.diagram.Graph instance.
Returns the ibm_ilog.diagram.Graph instance that displays the graph.
getGraphElementFromDataItem Gets the GFX object, for the given Data Item.
Parameter | Type | Description |
---|
item | | |
getGraphToClientTransform Returns dojox.gfx.matrix.Matrix2D: A dojox.gfx.matrix.Matrix2D instance.
Returns the matrix used to transform coordinates of objects contained
in this diagram's graph (returned by <code>getGraph()</code>) to coordinates
relative to the client browser's page.
getGraphToDiagramTransform Returns dojox.gfx.matrix.Matrix2D: A dojox.gfx.matrix.Matrix2D instance.
Returns the matrix used to transform coordinates of objects contained
in this diagram's graph (returned by <code>getGraph()</code>) to coordinates
relative to this Diagram object.
A dojox.gfx.matrix.Matrix2D instance that represents the current graph transform.
Returns the graph transform.
returns the inline editor registered with the given id
Parameter | Type | Description |
---|
id | | |
Parameter | Type | Description |
---|
id | | |
Returns the current link adorners focus.
Returns the current node adorners focus.
Returns Object: An object with x, y, width and height properties.
This method computes the bounding rectangle of a node contained in this Diagram widget.
The returned rectangle is either relative to the whole browser page (if inClient is true or omitted),
or relative to the bounds of the Diagram widget (if inClient is false).
Parameter | Type | Description |
---|
node | ibm_ilog.diagram.Node | A Node of the Graph displayed in this Diagram. |
inClient | Boolean | If true (the default), the returned rectangle is relative to the whole browser page.
If false, the returned rectangle is relative to the bounds of the Diagram widget. |
Returns the parent widget of this widget, assuming the parent
specifies isContainer
Return the selection object
A dojox.gfx.Surface instance.
Returns the dojox.gfx.Surface object displaying the graph.
return the private instance of ibm_ilog.diagram.editor.undo.UndoManager
Gets the Viewport instance.
Hides the dijit master tooltip, if currently in use by the Diagram.
scan the attachpoints of graph element ge in search for editable
fields initialize the corresponding infrastructure to allow editing.
Parameter | Type | Description |
---|
ge | the | graph element |
This function is an optional callback to configure how the MoveInteractor tests movability of elements
function(graphElement) {
// summary:
// Return true if the given graph element is allowed to move
// graphElement:
// The graph element to test.
}
an optional function that computes the link template dynamically based on the item.
The function receives the following parameters:
linkItem : the link data item, if any.
startNode: the link start node.
endNode: the link end node.
diagram : a reference to this diagram widget.
loads the data stores and creates the diagram.
This function is an optional callback to configure how the MoveInteractor applies the movement deltas on entities.
function(graphElement,originalTransform,delta) {
// summary:
// Concrete the movement to a graph element.
// graphElement:
// The graph element to move.
// originalTransform:
// The matrix representing the location from which the delta is computed.
// delta:
// The ammount to translate the entity from its original location.
},
Parameter | Type | Description |
---|
graphElement | | |
point | | |
margin | | |
outOfBounds | | |
an optional function that computes the node template based on the item.
The function receives the following parameters:
item : the data item to create node from
diagram : a reference to this diagram widget.
Open the inline editor associated with a graph element editable attachpoint.
Parameter | Type | Description |
---|
editable | ge:,attach:,base:} | The editable attachpoint belonging to a graph element. |
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.
Hook executed just after Diagram postCreate. Used by DiagramEditor subclass.
Registers a new inline editor with a certain id.
Parameter | Type | Description |
---|
id | string | The associated id for referencing the editor from editable attachpoints at graph element templates. |
editor | ibm_ilog.diagram.editor.adorners.TextEditAdorner | The adorner used as editor. |
Parameter | Type | Description |
---|
annotation | | |
Parameter | Type | Description |
---|
info | | |
Returns the link template to represent the specified relationship.
Parameter | Type | Description |
---|
linkItem | dojo.data.Item | dojo.data.Item: the data item corresponding to this link, if any. |
start | ibm_ilog.diagram.Node | : the link start node. |
end | ibm_ilog.diagram.Node | ibm_ilog.diagram.Node: the link end node. |
Returns the template to represent the specified node item.
Parameter | Type | Description |
---|
item | dojo.data.Item: | the node data item. |
Returns the template to represent the specified subgraph item.
Parameter | Type | Description |
---|
item | | |
Sets the accepted types to be dropped.
Parameter | Type | Description |
---|
types | | |
This method is deprecated from 1.1. Use dojo.set('allowFreeLinks', value) instead.
Sets if the diagram allow free links (links with no end or start node)
Parameter | Type | Description |
---|
allowFreeLinks | boolean | true, if the diagram allow free links (links with no end or start node) |
Parameter | Type | Description |
---|
ge | | |
Sets the link adorners focus on a graph element. Used by the adorners focus interactor;
Parameter | Type | Description |
---|
ge | | |
Parameter | Type | Description |
---|
b | int | |
Sets the node adorners focus on a graph element. Used by the adorners focus interactor;
Parameter | Type | Description |
---|
ge | | |
Opens a tooltip for a graph element. The content is get using the
getTooltipContentFunction function. Optionally,
the content can be overriden using the 'innerHTML' argument.
Parameter | Type | Description |
---|
ge | ibm_ilog.diagram.GraphElement | the graph element |
innerHTML | String | Optional. optional argument that overrides the content of the tooltip. |
dontHideOnChange | boolean | option to disable auto-hiding of the tooltip then the element reports changes |
an optional function that computes the subgraph template based on the item.
The function receives the following parameters:
item : the data item to create subgraph from.
diagram : a reference to this diagram widget.
Export the graph as an SVG string. This features requires Dojo 1.4.x or greater.
Parameter | Type | Description |
---|
onComplete | Function | The callback that receives the resulting SVG. |
onError | Function | The function called when the generation fails. |
all | Boolean | Indicates whether the whole graph should be visible in the resulting svg. If false, only the visible area is displayed. The default value is false. |
Makes the bounds of a graph object visible, givin it an extra air between the
area and the borders of the viewport if possible. The view may be zoomed out
if required, but it is never zoomed in.
Parameter | Type | Description |
---|
graphic | Node|Link|Subgraph | The object to make visible |
options | {expandCurrent:false,airFactor} | Viewport options kwArgs |
Events
Parameter | Type | Description |
---|
oldValue | | |
newValue | | |
onLinkAdornersFocusChanged event that occurs when the link adorners focus has changed.
Parameter | Type | Description |
---|
oldValue | | |
newValue | | |
Parameter | Type | Description |
---|
l | | |
e | | |
Invoked when the specified link has been created.
Parameter | Type | Description |
---|
link | ibm_ilog.diagram.Link | ibm_ilog.diagram.Link: the new link instance. |
start | ibm_ilog.diagram.Node | ibm_ilog.diagram.Node: the link start node, if any. |
end | ibm_ilog.diagram.Node | ibm_ilog.diagram.Node: the link end node, if any. |
diagram | ibm_ilog.diagram.widget.Diagram | ibm_ilog.diagram.widget.Diagram: the diagram instance that fired the event. |
Parameter | Type | Description |
---|
ge | | |
event | | |
Parameter | Type | Description |
---|
ge | | |
event | | |
Parameter | Type | Description |
---|
ge | | |
event | | |
this is the DiagramEditor instance.
Parameter | Type | Description |
---|
diagram | ibm_ilog.diagram.editor.DiagramEditor | this is the DiagramEditor instance. |
link | ibm_ilog.diagram.Link | the updated link. |
isNew | boolean | identify if the link is recently created (true) or just modified (false). |
undoAction | ibm_ilog.diagram.editor.undo.Action | the Action that take place in this edition |
Invoked when the diagram has loaded the data.
onNodeAdornersFocusChanged event that occurs when the adorners focus has changed.
Parameter | Type | Description |
---|
oldValue | | |
newValue | | |
Parameter | Type | Description |
---|
n | | |
e | | |
Invoked when the specified node has been created.
Parameter | Type | Description |
---|
node | ibm_ilog.diagram.Node: | the new node instance. |
diagram | ibm_ilog.diagram.widget.Diagram: | the diagram instance that fired the event. |
Parameter | Type | Description |
---|
ge | | |
event | | |
Parameter | Type | Description |
---|
ge | | |
event | | |
Parameter | Type | Description |
---|
ge | | |
event | | |
An extension point invoked when a property has changed.
Parameter | Type | Description |
---|
name | String | String: the property name. |
oldValue | Object | Object: the old property value. |
newValue | Object | Object: the new property value. |
Parameter | Type | Description |
---|
s | | |
e | | |
Invoked when the specified subgraph object has been created and initialized.
The default implementation does nothing.
Parameter | Type | Description |
---|
subgraph | ibm_ilog.diagram.Subgraph | ibm_ilog.diagram.Subgraph: the new subgraph instance. |
diagram | ibm_ilog.diagram.widget.Diagram | ibm_ilog.diagram.widget.Diagram: the diagram instance that fired the event. |
Parameter | Type | Description |
---|
ge | | |
event | | |
Parameter | Type | Description |
---|
ge | | |
event | | |
Parameter | Type | Description |
---|
ge | | |
event | | |