From 65afd8b3fd2880ef4efd168f5079afbb7d0efee4 Mon Sep 17 00:00:00 2001
From: Lukas Hollaender
Date: Mon, 25 Jan 2016 11:43:39 +0100
Subject: [PATCH] yFiles.d.ts and yfiles-tests.ts
---
yfiles/yfiles-tests.ts | 146 +
yfiles/yfiles.d.ts | 134491 ++++++++++++++++++++++++++++++++++++++
2 files changed, 134637 insertions(+)
create mode 100644 yfiles/yfiles-tests.ts
create mode 100644 yfiles/yfiles.d.ts
diff --git a/yfiles/yfiles-tests.ts b/yfiles/yfiles-tests.ts
new file mode 100644
index 0000000000..0bc89557bb
--- /dev/null
+++ b/yfiles/yfiles-tests.ts
@@ -0,0 +1,146 @@
+///
+
+module yfilesTest {
+
+ export class BasicTest {
+ private graphControl:yfiles.canvas.GraphControl;
+
+ constructor() {
+ this.graphControl = new yfiles.canvas.GraphControl.ForId("graphControl");
+
+ var graphEditorInputMode = new yfiles.input.GraphEditorInputMode();
+
+ // Modify the MyHitTestable class to be usable with our class framework
+ yfiles.lang.Class.injectInterfaces(MyHitTestable.prototype, [yfiles.drawing.IHitTestable]);
+ var myHitTestable = new MyHitTestable();
+
+ if (yfiles.drawing.IHitTestable.isInstance(myHitTestable)) {
+ // If myHitTestable is recognized as instance of yfiles.drawing.IHitTestable by the yFiles class
+ // framework, set it as hit testable to prevent clicking any item.
+ // If you cannot click-select the nodes in the GraphControl, this worked correctly.
+ graphEditorInputMode.clickInputMode.validClickHitTestable = myHitTestable;
+ }
+
+ this.graphControl.inputMode = graphEditorInputMode;
+
+ this.graphControl.graph.nodeDefaults.style = new yfiles.drawing.ShinyPlateNodeStyle.WithBrush(yfiles.system.Brushes.ORANGE);
+
+ this.graphControl.graph.createNodeWithBoundsAndStyle(new yfiles.geometry.RectD(0, 0, 10, 10), new MyNodeStyle());
+
+ this.layout();
+ }
+
+ start() {
+ for (var i = 0; i < 5; i++) {
+ for (var j = 0; j < 5; j++) {
+ this.graphControl.graph.createNodeWithCenter(new yfiles.geometry.PointD(100 * i, 100 * j));
+ }
+ }
+ this.graphControl.graph.nodes.forEach((node) => this.graphControl.graph.addLabel(node, "Label"));
+ this.graphControl.fitGraphBounds();
+ }
+
+
+ /**
+ * Runs a layout algorithm and animates the transition to the new layout.
+ */
+ layout() {
+ var layouter = new yfiles.hierarchic.IncrementalHierarchicLayouter();
+ var layoutExecutor = new yfiles.graph.LayoutExecutor.FromControlAndLayouter(this.graphControl,
+ new yfiles.layout.MinNodeSizeStage(layouter));
+
+ layoutExecutor.duration = yfiles.system.TimeSpan.fromSeconds(1);
+ layoutExecutor.animateViewport = true;
+ layoutExecutor.updateContentRect = true;
+ layoutExecutor.finishHandler = function (s, args) {
+ if (args instanceof yfiles.graph.LayoutExceptionEventArgs && typeof(window.console) !== "undefined") {
+ var exception = args.exception;
+ console.log(exception.message);
+ }
+ };
+ layoutExecutor.start();
+ }
+
+ /**
+ * Runs a shortest path analysis.
+ */
+ analyze() {
+ var graph = this.graphControl.graph;
+
+ // Create the graph model adapter to get a proper analysis graph structure.
+ var graphAdapter = new yfiles.graph.YGraphAdapter(graph);
+
+ // Create an array the size of the edge set with costs for each edge.
+ var cost = new Array(graph.edges.count);
+ for (var i = 0; i < graph.edges.count; i++) {
+ cost[i] = Math.random();
+ }
+
+ var pred:yfiles.algorithms.Edge[] = null;
+
+ // Suppose the first node from the graph is the node named "Start."
+ var startNode = graphAdapter.getCopiedNode(graph.nodes.getFirstElement());
+ // Suppose the last node from the graph is the node named "Destination."
+ var destinationNode = graphAdapter.getCopiedNode(graph.nodes.getLastElement());
+
+ // Run the single-source single-sink algorithm on the graph.
+ var result = yfiles.algorithms.ShortestPaths.singleSourceSingleSinkToArray(graphAdapter.yGraph, startNode,
+ destinationNode, true, cost, pred);
+ // Transfer back the result.
+ var predIGraph = new Array(pred.length);
+ for (var i = 0; i < pred.length; i++) {
+ predIGraph[i] = graphAdapter.getOriginalEdge(pred[i]);
+ }
+ }
+
+ coreLib() {
+ new yfiles.AttributeDefinition(() => { return {} });
+ new yfiles.ClassDefinition(() => { return {} });
+ new yfiles.EnumDefinition(() => { return {} });
+ new yfiles.StructDefinition(() => { return {} });
+ }
+
+ namespacesExist() {
+ new yfiles.algorithms.AbortHandler();
+ new yfiles.binding.AdjacentEdgesGraphSource();
+ new yfiles.canvas.CanvasContainer();
+ new yfiles.circular.CircularLayouter();
+ new yfiles.collections.HashSet();
+ new yfiles.drawing.ArcEdgeStyle();
+ new yfiles.genealogy.FamilyTreeLayouter();
+ new yfiles.geometry.Matrix2D();
+ new yfiles.graph.YGraphAdapter(this.graphControl.graph);
+ var a:yfiles.graphml.ChildParseContext;
+ new yfiles.hierarchic.AsIsLayerer();
+ new yfiles.labeling.GreedyMISLabeling();
+ var b:yfiles.lang.Abstract;
+ new yfiles.layout.BendConverter();
+ new yfiles.markup.ArrayExtension();
+ new yfiles.model.BridgeManager();
+ var c:yfiles.multipage.IEdgeInfo;
+ var d:yfiles.objectcollections.ICollection;
+ new yfiles.organic.GroupedShuffleLayouter();
+ new yfiles.orthogonal.CompactOrthogonalLayouter();
+ var e = yfiles.partial.ComponentAssignmentStrategy.CLUSTERING;
+ var f = yfiles.radial.CenterNodesPolicy.CENTRALITY;
+ new yfiles.random.RandomLayouter();
+ var g:yfiles.router.BusDescriptor;
+ new yfiles.seriesparallel.SeriesParallelLayouter();
+ var h:yfiles.support.AbstractContextLookupChainLink;
+ new yfiles.system.ApplicationException();
+ new yfiles.tree.ARTreeLayouter();
+ }
+ }
+
+ class MyHitTestable implements yfiles.drawing.IHitTestable {
+ isHit(p:yfiles.geometry.PointD, ctx:yfiles.canvas.ICanvasContext):boolean {
+ return false;
+ }
+ }
+
+ class MyNodeStyle extends yfiles.drawing.SimpleAbstractNodeStyle {
+ createVisual(node:yfiles.graph.INode, renderContext:yfiles.drawing.IRenderContext):yfiles.drawing.RectVisual {
+ return new yfiles.drawing.RectVisual.FromRectangle(new yfiles.geometry.Rectangle(0, 0, 10, 10));
+ }
+ }
+}
diff --git a/yfiles/yfiles.d.ts b/yfiles/yfiles.d.ts
new file mode 100644
index 0000000000..b258fc3733
--- /dev/null
+++ b/yfiles/yfiles.d.ts
@@ -0,0 +1,134491 @@
+// Type definitions for yFiles for HTML 1.3+
+// Project: http://www.yworks.com/products/yfiles-for-html
+// Definitions by: yWorks GmbH
+// Definitions: https://github.com/yWorks/DefinitelyTyped
+
+/****************************************************************************
+ **
+ ** This file is part of yFiles for HTML 1.3.
+ **
+ ** yWorks proprietary/confidential. Use is subject to license terms.
+ **
+ ** Copyright (c) 2015 by yWorks GmbH, Vor dem Kreuzberg 28,
+ ** 72070 Tuebingen, Germany. All rights reserved.
+ **
+ ***************************************************************************/
+declare module system{
+}
+declare module yfiles{
+ /**
+ * A lazy interface type which delays the creation of the interface until it is used.
+ */
+ export interface InterfaceDefinition extends Object{
+ }
+ var InterfaceDefinition:{
+ $class:yfiles.lang.Class;
+ /**
+ * A lazy interface type which delays the creation of the interface until it is used.
+ * @param {function():Object} callback Returns the interface definition as required by {@link yfiles.lang.Trait}.
+ */
+ new (callback:()=>Object):yfiles.InterfaceDefinition;
+ };
+ /**
+ * A lazy class type which delays the creation of the class until it is used.
+ */
+ export interface ClassDefinition extends Object{
+ }
+ var ClassDefinition:{
+ $class:yfiles.lang.Class;
+ /**
+ * A lazy class type which delays the creation of the class until it is used.
+ * @param {function():Object} callback Returns the class definition as required by {@link yfiles.lang.Class}.
+ */
+ new (callback:()=>Object):yfiles.ClassDefinition;
+ };
+ /**
+ * A lazy struct type which delays the creation of the struct until it is used.
+ */
+ export interface StructDefinition extends Object{
+ }
+ var StructDefinition:{
+ $class:yfiles.lang.Class;
+ /**
+ * A lazy struct type which delays the creation of the struct until it is used.
+ * @param {function():Object} callback Returns the struct definition as required by {@link yfiles.lang.Struct}.
+ */
+ new (callback:()=>Object):yfiles.StructDefinition;
+ };
+ /**
+ * A lazy attribute definition which delays the creation of the attribute until it is used.
+ */
+ export interface AttributeDefinition extends Object{
+ }
+ var AttributeDefinition:{
+ $class:yfiles.lang.Class;
+ /**
+ * A lazy attribute definition which delays the creation of the attribute until it is used.
+ * @param {function():Object} callback Returns the attribute definition as required by {@link yfiles.lang.Attribute}.
+ */
+ new (callback:()=>Object):yfiles.AttributeDefinition;
+ };
+ /**
+ * A lazy enum type which delays the creation of the enum until it is used.
+ */
+ export interface EnumDefinition extends Object{
+ }
+ var EnumDefinition:{
+ $class:yfiles.lang.Class;
+ /**
+ * A lazy enum type which delays the creation of the enum until it is used.
+ * @param {function():Object} callback Returns the enum definition as required by {@link yfiles.lang.Enum}.
+ */
+ new (callback:()=>Object):yfiles.EnumDefinition;
+ };
+ export module algorithms{
+ /**
+ * Specialized list implementation for instances of type {@link yfiles.algorithms.Node}.
+ */
+ export interface NodeList extends yfiles.algorithms.YList{
+ /**
+ * Returns a node cursor for this node list.
+ * @return {yfiles.algorithms.INodeCursor} A node cursor granting access to the nodes within this list.
+ */
+ nodes():yfiles.algorithms.INodeCursor;
+ /**
+ * Returns the first node in this list, or null when the list is
+ * empty.
+ * @return {yfiles.algorithms.Node} The first node in the list.
+ */
+ firstNode():yfiles.algorithms.Node;
+ /**
+ * Returns the last node in this list, or null when the list is empty.
+ * @return {yfiles.algorithms.Node} The last node in the list.
+ */
+ lastNode():yfiles.algorithms.Node;
+ /**
+ * Removes the first node from this list and returns it.
+ * @return {yfiles.algorithms.Node} The first node from the list.
+ */
+ popNode():yfiles.algorithms.Node;
+ /**
+ * Returns a node array containing all elements of this list in the canonical
+ * order.
+ */
+ toNodeArray():yfiles.algorithms.Node[];
+ getEnumerator():yfiles.collections.IEnumerator;
+ }
+ var NodeList:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates an empty node list.
+ */
+ new ():yfiles.algorithms.NodeList;
+ /**
+ * Creates a list that is initialized with the nodes provided by the given NodeCursor
+ * object.
+ */
+ WithNodes:{
+ new (c:yfiles.algorithms.INodeCursor):yfiles.algorithms.NodeList;
+ };
+ /**
+ * Creates a list that is initialized with those nodes from the given NodeCursor
+ * object for which the given data provider returns true upon
+ * calling its {@link yfiles.algorithms.IDataProvider#getBool getBool} method.
+ * @param {yfiles.algorithms.INodeCursor} nc A node cursor providing nodes that should be added to this list.
+ * @param {yfiles.algorithms.IDataProvider} predicate
+ * A data provider that acts as a inclusion predicate for each node accessible
+ * by the given node cursor.
+ */
+ WithFilteredNodes:{
+ new (nc:yfiles.algorithms.INodeCursor,predicate:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList;
+ };
+ /**
+ * Creates a list that is initialized with the elements provided by the given
+ * Iterator object.
+ */
+ WithIterator:{
+ new (it:yfiles.algorithms.IIterator):yfiles.algorithms.NodeList;
+ };
+ /**
+ * Creates a list that is initialized with the nodes provided by the given array
+ * of nodes.
+ */
+ WithNodeArray:{
+ new (a:yfiles.algorithms.Node[]):yfiles.algorithms.NodeList;
+ };
+ /**
+ * Creates a list that is initialized with a single node provided.
+ */
+ WithNode:{
+ new (v:yfiles.algorithms.Node):yfiles.algorithms.NodeList;
+ };
+ /**
+ * Creates a list that is initialized with the entries of the given list.
+ * @param {yfiles.algorithms.NodeList} list the values are added to the new list
+ */
+ WithNodeList:{
+ new (list:yfiles.algorithms.NodeList):yfiles.algorithms.NodeList;
+ };
+ };
+ /**
+ * Provides sophisticated algorithms for solving classical network flow problems
+ * like MinCostFlow or MaxFlow.
+ */
+ export interface NetworkFlows extends Object{
+ }
+ var NetworkFlows:{
+ $class:yfiles.lang.Class;
+ /**
+ * Solves a minimum cost flow problem with a capacity scaling algorithm.
+ * (see Ahuja,Magnanti,Orlin: Network flows, Prentice Hall, 1993, pp.360-362).
+ * This algorithm is a variant of the successive shortest path algorithm.
+ * (see Ahuja,Magnanti,Orlin: Network flows, Prentice Hall, 1993, pp.320-324).
+ * It has the pseudo-polynomial running time O(m*log U*(m+n log n)) where n is the
+ * number of nodes in the network, m the number of edges and U the maximal edge
+ * capacity.
+ * Edges may have infinite capacity, which is denoted by
+ * the value Integer.MAX_VALUE.
+ * There are no restriction for the costs, especially they
+ * can be negative.
+ * Solves a min-cost flow optimization problem.
+ * @param {yfiles.algorithms.Graph} graph the network.
+ * @param {yfiles.algorithms.IDataProvider} lCapDP
+ * the lower bound on the arc flow.
+ * May be null.
+ * @param {yfiles.algorithms.IDataProvider} uCapDP
+ * the capacity of the arcs.
+ * Infinite capacity is denoted by
+ * Integer.MAX_VALUE
+ * @param {yfiles.algorithms.IDataProvider} cost0DP the costs of the arcs.
+ * @param {yfiles.algorithms.IDataProvider} supplyDP
+ * the supply/demand of the nodes.
+ * Supply is denoted by a positive value, demand by a
+ * negative value.
+ * @param {yfiles.algorithms.IEdgeMap} flowEM here the resulting flow is stored.
+ * @param {yfiles.algorithms.INodeMap} dualsNM
+ * here the resulting dual values are stored.
+ * Dual values are also referred as potentials.
+ * May be null.
+ * @return {number} the cost of the flow.
+ */
+ minCostFlowWithLowerBound(graph:yfiles.algorithms.Graph,lCapDP:yfiles.algorithms.IDataProvider,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,supplyDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number;
+ /**
+ * Solves a min-cost flow optimization problem.
+ * @param {yfiles.algorithms.Graph} graph the network.
+ * @param {yfiles.algorithms.IDataProvider} uCapDP
+ * the capacity of the arcs.
+ * Infinite capacity is denoted by
+ * Integer.MAX_VALUE
+ * @param {yfiles.algorithms.IDataProvider} cost0DP the costs of the arcs.
+ * @param {yfiles.algorithms.IDataProvider} supplyDP
+ * the supply/demand of the nodes.
+ * Supply is denoted by a positive value, demand by a
+ * negative value.
+ * @param {yfiles.algorithms.IEdgeMap} flowEM here the resulting flow is stored.
+ * @param {yfiles.algorithms.INodeMap} dualsNM
+ * here the resulting dual values are stored.
+ * Dual values are also referred as potentials.
+ * @return {number} the cost of the flow.
+ */
+ minCostFlow(graph:yfiles.algorithms.Graph,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,supplyDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number;
+ /**
+ * Solves a min-cost max-flow optimization problem.
+ * @param {yfiles.algorithms.Graph} graph the network.
+ * @param {yfiles.algorithms.Node} s source of the network.
+ * @param {yfiles.algorithms.Node} t sink of the network.
+ * @param {yfiles.algorithms.IDataProvider} uCapDP
+ * the capacity of the arcs.
+ * Infinite capacity is denoted by
+ * Integer.MAX_VALUE
+ * @param {yfiles.algorithms.IDataProvider} cost0DP the costs of the arcs.
+ * @param {yfiles.algorithms.IEdgeMap} flowEM here the resulting flow is stored.
+ * @param {yfiles.algorithms.INodeMap} dualsNM
+ * here the resulting dual values are stored.
+ * Dual values are also referred as potentials.
+ * @return {number} the cost of the flow.
+ */
+ minCostFlowBetweenSourceAndSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number;
+ /**
+ * Solves a maximum flow problem using the preflow-push method.
+ * (see Mehlhorn, Naeher: LEDA: a platform for combinatorial and geometric computing,
+ * Cambridge University Press, 2000, pp. 443-488)
+ * The worst case running time is O(mdeg * n^2 * m^(1/2)), where n is the number of
+ * nodes in the network, m the number of edges and mdeg the maximal degree of any node.
+ * Edges may have infinite capacity, which is denoted by
+ * the value Integer.MAX_VALUE.
+ * @param {yfiles.algorithms.Graph} graph the network.
+ * @param {yfiles.algorithms.Node} source the source of the network.
+ * @param {yfiles.algorithms.Node} sink the sink of the network.
+ * @param {yfiles.algorithms.IDataProvider} eCapDP
+ * the capacity of the arcs.
+ * Infinite capacity is denoted by
+ * Integer.MAX_VALUE
+ * @param {yfiles.algorithms.IEdgeMap} flowEM here the resulting flow is stored.
+ * @return {number} the maximum flow value.
+ */
+ calcMaxFlow(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,sink:yfiles.algorithms.Node,eCapDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap):number;
+ /**
+ * Like {@link yfiles.algorithms.NetworkFlows#calcMaxFlow} this method
+ * solves a maximum flow problem.
+ * Additionally, this method marks all nodes
+ * that belong to the minimum cut set that is associated with the
+ * source of the network.
+ * @param {yfiles.algorithms.INodeMap} sourceCutNM
+ * return value. This map will provide a boolean value for each node
+ * that indicates whether or not a node belongs to the cut set associated
+ * with the source of the network.
+ * @return {number}
+ * the maximum flow value which also corresponds to the capacity
+ * of all edges that cross from the cut set associated with the network source
+ * to the cut set associated with the network sink.
+ */
+ calcMaxFlowMinCut(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,sink:yfiles.algorithms.Node,eCapDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,sourceCutNM:yfiles.algorithms.INodeMap):number;
+ };
+ /**
+ * Represents a so-called node in the directed graph data type {@link yfiles.algorithms.Graph}.
+ * Most notably, a node provides access to its adjacent edges (represented by instances
+ * of class {@link yfiles.algorithms.Edge}).
+ * These can be distinguished into the sets of incoming and outgoing edges.
+ * Iteration over all three sets of edges is provided by means of bidirectional
+ * cursors that present a read-only view of the respective set ({@link yfiles.algorithms.Node#getEdgeCursor},
+ * {@link yfiles.algorithms.Node#getInEdgeCursor}, {@link yfiles.algorithms.Node#getOutEdgeCursor}).
+ * Also supported is iteration over all nodes at opposite ends of either incoming
+ * edges or outgoing edges ({@link yfiles.algorithms.Node#getPredecessorCursor}, {@link yfiles.algorithms.Node#getSuccessorCursor}).
+ * The number of overall edges at a node is called its degree ({@link yfiles.algorithms.Node#degree}),
+ * which is the sum of incoming and outgoing edges ({@link yfiles.algorithms.Node#inDegree},
+ * {@link yfiles.algorithms.Node#outDegree}).
+ * Important:
+ * Class Graph is the single authority for any structural changes to the graph data
+ * type.
+ * Specifically, this means that there is no way to create or delete a node or an
+ * edge without using an actual Graph instance.
+ */
+ export interface Node extends yfiles.algorithms.GraphObject{
+ /**
+ * Creates a copy of this node that will be inserted into the given graph.
+ * @param {yfiles.algorithms.Graph} g The graph that the created node will belong to.
+ * @return {yfiles.algorithms.Node} The newly created Node object.
+ */
+ createCopy(g:yfiles.algorithms.Graph):yfiles.algorithms.Node;
+ /**
+ * The overall number of incoming and outgoing edges at this node.
+ * Note that self-loops are counted twice.
+ * @see {@link yfiles.algorithms.Edge}
+ * @see {@link yfiles.algorithms.Node#inDegree}
+ * @see {@link yfiles.algorithms.Node#outDegree}
+ */
+ degree:number;
+ /**
+ * The number of incoming edges at this node.
+ * @see {@link yfiles.algorithms.Node#degree}
+ * @see {@link yfiles.algorithms.Node#outDegree}
+ */
+ inDegree:number;
+ /**
+ * The number of outgoing edges at this node.
+ * @see {@link yfiles.algorithms.Node#degree}
+ * @see {@link yfiles.algorithms.Node#inDegree}
+ */
+ outDegree:number;
+ /**
+ * The index of this node within its graph G.
+ * Node indices represent the ordering of standard node iteration on G.
+ * The value of an index is >= 0 and < G.nodeCount().
+ * Note that indices are subject to change whenever the sequence of nodes in a
+ * graph is modified by either removing, hiding, reinserting, or unhiding a node,
+ * or by explicitly changing its position in the sequence.
+ * Precondition: This node must belong to some graph.
+ * @see {@link yfiles.algorithms.Graph#removeNode}
+ * @see {@link yfiles.algorithms.Graph#hideNode}
+ * @see {@link yfiles.algorithms.Graph#reInsertNode}
+ * @see {@link yfiles.algorithms.Graph#unhideNode}
+ * @see {@link yfiles.algorithms.Graph#moveToFirstNode}
+ * @see {@link yfiles.algorithms.Graph#moveToLastNode}
+ */
+ index:number;
+ /**
+ * The graph this node belongs to.
+ * If the node does not belong to a graph, because it was removed or hidden from
+ * it, this method returns null.
+ */
+ graph:yfiles.algorithms.Graph;
+ /**
+ * The first outgoing edge at this node, or null if it does
+ * not exist.
+ * @see {@link yfiles.algorithms.Node#firstInEdge}
+ * @see {@link yfiles.algorithms.Node#lastOutEdge}
+ */
+ firstOutEdge:yfiles.algorithms.Edge;
+ /**
+ * The first incoming edge at this node, or null if it does
+ * not exist.
+ * @see {@link yfiles.algorithms.Node#firstOutEdge}
+ * @see {@link yfiles.algorithms.Node#lastInEdge}
+ */
+ firstInEdge:yfiles.algorithms.Edge;
+ /**
+ * The last outgoing edge at this node, or null if it does
+ * not exist.
+ * @see {@link yfiles.algorithms.Node#firstOutEdge}
+ * @see {@link yfiles.algorithms.Node#lastInEdge}
+ */
+ lastOutEdge:yfiles.algorithms.Edge;
+ /**
+ * The last incoming edge at this node, or null if it does
+ * not exist.
+ * @see {@link yfiles.algorithms.Node#firstInEdge}
+ * @see {@link yfiles.algorithms.Node#lastOutEdge}
+ */
+ lastInEdge:yfiles.algorithms.Edge;
+ /**
+ * Returns an edge cursor for all incoming and outgoing edges at this node.
+ * @see {@link yfiles.algorithms.Node#getInEdgeCursor}
+ * @see {@link yfiles.algorithms.Node#getOutEdgeCursor}
+ */
+ getEdgeCursor():yfiles.algorithms.IEdgeCursor;
+ /**
+ * Returns an edge cursor for all incoming edges at this node.
+ * @see {@link yfiles.algorithms.Node#getEdgeCursor}
+ * @see {@link yfiles.algorithms.Node#getOutEdgeCursor}
+ */
+ getInEdgeCursor():yfiles.algorithms.IEdgeCursor;
+ /**
+ * Returns an edge cursor for incoming edges at this node.
+ * The cursor starts at the given edge, and the cyclic sequence order is the same
+ * as returned by {@link yfiles.algorithms.Node#getInEdgeCursor}.
+ * Precondition:startEdge is an incoming edge at this node.
+ * @param {yfiles.algorithms.Edge} startEdge The first edge being accessed by the returned cursor.
+ * @see {@link yfiles.algorithms.Node#getOutEdgeCursorFromStartEdge}
+ */
+ getInEdgeCursorFromStartEdge(startEdge:yfiles.algorithms.Edge):yfiles.algorithms.IEdgeCursor;
+ /**
+ * Returns an edge cursor for all outgoing edges at this node.
+ * @see {@link yfiles.algorithms.Node#getEdgeCursor}
+ * @see {@link yfiles.algorithms.Node#getInEdgeCursor}
+ */
+ getOutEdgeCursor():yfiles.algorithms.IEdgeCursor;
+ /**
+ * Returns an edge cursor for outgoing edges at this node.
+ * The cursor starts at the given edge, and the cyclic sequence order is the same
+ * as returned by {@link yfiles.algorithms.Node#getOutEdgeCursor}.
+ * Precondition:startEdge is an outgoing edge at this node.
+ * @param {yfiles.algorithms.Edge} startEdge The first edge being accessed by the returned cursor.
+ * @see {@link yfiles.algorithms.Node#getInEdgeCursorFromStartEdge}
+ */
+ getOutEdgeCursorFromStartEdge(startEdge:yfiles.algorithms.Edge):yfiles.algorithms.IEdgeCursor;
+ /**
+ * Returns a node cursor for all neighbor nodes of this node.
+ * Neighbor nodes are those at the opposite ends of both incoming and outgoing
+ * edges.
+ * @see {@link yfiles.algorithms.Node#getPredecessorCursor}
+ * @see {@link yfiles.algorithms.Node#getSuccessorCursor}
+ */
+ getNeighborCursor():yfiles.algorithms.INodeCursor;
+ /**
+ * Returns a node cursor for all predecessor nodes of this node.
+ * Predecessor nodes are those at the opposite ends of incoming edges.
+ * @see {@link yfiles.algorithms.Node#getSuccessorCursor}
+ */
+ getPredecessorCursor():yfiles.algorithms.INodeCursor;
+ /**
+ * Returns a node cursor for all successor nodes of this node.
+ * Successor nodes are those at the opposite ends of outgoing edges.
+ * @see {@link yfiles.algorithms.Node#getPredecessorCursor}
+ */
+ getSuccessorCursor():yfiles.algorithms.INodeCursor;
+ /**
+ * Returns an outgoing edge that connects this node with the given node, if such
+ * an edge exists.
+ * Otherwise null is returned.
+ * @see {@link yfiles.algorithms.Node#getEdge}
+ * @see {@link yfiles.algorithms.Node#getEdgeFrom}
+ */
+ getEdgeTo(target:yfiles.algorithms.Node):yfiles.algorithms.Edge;
+ /**
+ * Returns an incoming edge that connects the given node with this node, if such
+ * an edge exists.
+ * Otherwise null is returned.
+ * @see {@link yfiles.algorithms.Node#getEdge}
+ * @see {@link yfiles.algorithms.Node#getEdgeTo}
+ */
+ getEdgeFrom(source:yfiles.algorithms.Node):yfiles.algorithms.Edge;
+ /**
+ * Returns an edge that connects this node with the given node, if such an edge
+ * exists.
+ * Otherwise null is returned.
+ * Note that the first matching edge is returned, and that outgoing edges are
+ * tested prior to incoming edges.
+ * @see {@link yfiles.algorithms.Node#getEdgeFrom}
+ * @see {@link yfiles.algorithms.Node#getEdgeTo}
+ */
+ getEdge(opposite:yfiles.algorithms.Node):yfiles.algorithms.Edge;
+ /**
+ * Sorts incoming edges at this node according to the given comparator.
+ * @see {@link yfiles.algorithms.Node#sortOutEdges}
+ */
+ sortInEdges(c:yfiles.objectcollections.IComparer):void;
+ /**
+ * Sorts outgoing edges at this node according to the given comparator.
+ * @see {@link yfiles.algorithms.Node#sortInEdges}
+ */
+ sortOutEdges(c:yfiles.objectcollections.IComparer):void;
+ /**
+ * Returns a String representation of this node.
+ */
+ toString():string;
+ /**
+ * Yields a dynamic {@link yfiles.collections.IEnumerable}
+ * for {@link yfiles.algorithms.Edge}s that can be used to iterate over outgoing edges at this instance.
+ * This is a live enumerable and will thus reflect the current state of the node's adjacency.
+ * Note that changes to the graph structure during the traversal should be carried out with great care.
+ * Note that self-loop edges are reported, too.
+ */
+ outEdges:yfiles.collections.IEnumerable;
+ /**
+ * Yields a dynamic {@link yfiles.collections.IEnumerable}
+ * for {@link yfiles.algorithms.Edge}s that can be used to iterate over ingoing edges at this instance.
+ * This is a live enumerable and will thus reflect the current state of the node's adjacency.
+ * Note that changes to the graph structure during the traversal should be carried out with great care.
+ * Note that self-loop edges are reported, too.
+ */
+ inEdges:yfiles.collections.IEnumerable;
+ /**
+ * Yields a dynamic {@link yfiles.collections.IEnumerable}
+ * for {@link yfiles.algorithms.Edge}s that can be used to iterate over the adjacent edges at this instance.
+ * This is a live enumerable and will thus reflect the current state of the node's adjacency.
+ * Note that changes to the graph structure during the traversal should be carried out with great care.
+ * Note that self-loop edges are reported twice (as in edge and as out edge).
+ */
+ edges:yfiles.collections.IEnumerable;
+ /**
+ * Yields a dynamic {@link yfiles.collections.IEnumerable}
+ * for {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent outgoing edges at this instance.
+ * This is a live enumerable and will thus reflect the current state of the node's adjacency.
+ * Note that changes to the graph structure during the traversal should be carried out with great care.
+ * Note that for self-loop edges this node itself will be reported as a successor.
+ */
+ successors:yfiles.collections.IEnumerable;
+ /**
+ * Yields a dynamic {@link yfiles.collections.IEnumerable}
+ * for {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent incoming edges at this instance.
+ * This is a live enumerable and will thus reflect the current state of the node's adjacency.
+ * Note that changes to the graph structure during the traversal should be carried out with great care.
+ * Note that for self-loop edges this node itself will be reported as a predecessor.
+ */
+ predecessors:yfiles.collections.IEnumerable;
+ /**
+ * Yields a dynamic {@link yfiles.collections.IEnumerable}
+ * for {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent adjacent edges at this instance.
+ * This is a live enumerable and will thus reflect the current state of the node's adjacency.
+ * Note that changes to the graph structure during the traversal should be carried out with great care.
+ * Note that for self-loop edges this node itself will be reported as a neighbor, twice.
+ */
+ neighbors:yfiles.collections.IEnumerable;
+ }
+ var Node:{
+ $class:yfiles.lang.Class;
+ /**
+ * Instantiates a new Node object that will be part of the given graph.
+ * @param {yfiles.algorithms.Graph} g The graph that the created node will belong to.
+ */
+ new (g:yfiles.algorithms.Graph):yfiles.algorithms.Node;
+ };
+ /**
+ * Provides algorithms for solving the rank assignment problem.
+ * Let G=(V,E) be a directed acyclic graph. Let length(e) denote
+ * the minimal length and weight(e) the weight of an
+ * edge e.
+ * The rank assignment problem is to find values x(v) for all
+ * v in V, such that x(v) - x(w) >= length(v,w) for all (v,w) in E,
+ * and that the sum weight(v,w)*(x(v)-x(w)) over all (v,w) in E
+ * is minimal.
+ */
+ export interface RankAssignments extends Object{
+ }
+ var RankAssignments:{
+ $class:yfiles.lang.Class;
+ /**
+ * Solves the rank assignment problem using the simplex method.
+ * This method assigns a minimal rank to the nodes in a acyclic graph.
+ * Although its time complexity has not been proven polynomial, in practice
+ * it takes few iterations and runs quickly.
+ * The algorithm is based on:
+ * E.R. Gansner et al, A Technique for Drawing Directed Graphs,
+ * IEEE Transactions on Software Engineering, Vol.19, No.3,
+ * March 1993,
+ * Precondition: GraphChecker.isAcyclic(graph)
+ * Precondition: minLength.getInt(e) defined for each edge in graph.
+ * @param {yfiles.algorithms.Graph} g the graph for which the layers are determined.
+ * @param {yfiles.algorithms.INodeMap} layer here the ranking is stored.
+ * @param {yfiles.algorithms.IDataProvider} w here the weight of an edge is stored.
+ * @param {yfiles.algorithms.IDataProvider} minLength here the minimal length of an edge is stored.
+ * @return {number} the number of layers
+ */
+ simplex(g:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider):number;
+ /**
+ * Solves the rank assignment problem using the simplex method.
+ * This method assigns a minimal rank to the nodes in a acyclic graph.
+ * Although its time complexity has not been proven polynomial, in practice
+ * it takes few iterations and runs quickly.
+ * The algorithm is based on:
+ * E.R. Gansner et al, A Technique for Drawing Directed Graphs,
+ * IEEE Transactions on Software Engineering, Vol.19, No.3,
+ * March 1993,
+ *
+ * Note: if the algorithm exceeds the maximal duration, the result may not be optimal.
+ *
+ * Precondition: GraphChecker.isAcyclic(graph)
+ * Precondition: minLength.getInt(e) defined for each edge in graph.
+ * @param {yfiles.algorithms.Graph} g the graph for which the layers are determined.
+ * @param {yfiles.algorithms.INodeMap} layer here the ranking is stored.
+ * @param {yfiles.algorithms.IDataProvider} w here the weight of an edge is stored.
+ * @param {yfiles.algorithms.IDataProvider} minLength here the minimal length of an edge is stored.
+ * @param {number} maximalDuration a preferred time limit for the algorithm in milliseconds.
+ * @return {number} the number of layers
+ */
+ simplexWithMaximalDuration(g:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider,maximalDuration:number):number;
+ /**
+ * Similar to {@link yfiles.algorithms.RankAssignments#simplex}.
+ * Additionally
+ * it is possible to provide a valid initial tree solution for the problem.
+ * @param {yfiles.algorithms.Graph} g the graph for which the layers are determined.
+ * @param {yfiles.algorithms.INodeMap} layer here the ranking is stored.
+ * @param {yfiles.algorithms.IDataProvider} w here the weight of an edge is stored.
+ * @param {yfiles.algorithms.IDataProvider} minLength here the minimal length of an edge is stored.
+ * @param {boolean} validRanking
+ * if true, the argument
+ * layer contains a valid ranking.
+ * @param {yfiles.algorithms.IEdgeMap} tree may contain a valid tree solution.
+ * @param {yfiles.algorithms.Node} _root the root of the tree solution.
+ * @return {number} the number of layers
+ */
+ simplexWithRankingValidity(g:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider,tree:yfiles.algorithms.IEdgeMap,_root:yfiles.algorithms.Node,validRanking:boolean):number;
+ /**
+ * Similar to {@link yfiles.algorithms.RankAssignments#simplex}.
+ * Additionally
+ * it is possible to provide a valid initial tree solution for the problem.
+ *
+ * Note: if the algorithm exceeds the maximal duration, the result may not be optimal.
+ *
+ * @param {yfiles.algorithms.Graph} g the graph for which the layers are determined.
+ * @param {yfiles.algorithms.INodeMap} layer here the ranking is stored.
+ * @param {yfiles.algorithms.IDataProvider} w here the weight of an edge is stored.
+ * @param {yfiles.algorithms.IDataProvider} minLength here the minimal length of an edge is stored.
+ * @param {boolean} validRanking
+ * if true, the argument
+ * layer contains a valid ranking.
+ * @param {yfiles.algorithms.IEdgeMap} tree may contain a valid tree solution.
+ * @param {yfiles.algorithms.Node} _root the root of the tree solution.
+ * @param {number} maximalDuration a preferred time limit for the algorithm in milliseconds.
+ * @return {number} the number of layers
+ */
+ simplexWithRankingValidityAndMaximalDuration(g:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider,tree:yfiles.algorithms.IEdgeMap,_root:yfiles.algorithms.Node,validRanking:boolean,maximalDuration:number):number;
+ /**
+ * This method quickly calculates a tight tree
+ * using a highly optimized version of Gansner's algorithm .
+ * @param {yfiles.algorithms.Graph} g
+ * the graph, where all the edges have directions, such that
+ * rank[source] < rank[target] and rank[target] - rank[source] >= minlength[edge]
+ * @param {yfiles.algorithms.INodeMap} rank the initial ranking
+ * @param {yfiles.algorithms.IEdgeMap} minLength
+ * the minimal (tight) lengths for each edge. Values must be
+ * non-negative.
+ * @return {number} the number of layers.
+ */
+ simple(g:yfiles.algorithms.Graph,rank:yfiles.algorithms.INodeMap,minLength:yfiles.algorithms.IEdgeMap):number;
+ /**
+ * This method quickly calculates a tight tree
+ * using a highly optimized version of Gansner's algorithm .
+ *
+ * Note: if the algorithm exceeds the maximal duration, the result may be invalid (not a valid ranking).
+ *
+ * @param {yfiles.algorithms.Graph} g
+ * the graph, where all the edges have directions, such that
+ * rank[source] < rank[target] and rank[target] - rank[source] >= minlength[edge]
+ * @param {yfiles.algorithms.INodeMap} rank the initial ranking
+ * @param {yfiles.algorithms.IEdgeMap} minLength
+ * the minimal (tight) lengths for each edge. Values must be
+ * non-negative.
+ * @param {number} maximalDuration a preferred time limit for the algorithm in milliseconds.
+ * @return {number} the number of layers.
+ */
+ simpleWithMaximumDuration(g:yfiles.algorithms.Graph,rank:yfiles.algorithms.INodeMap,minLength:yfiles.algorithms.IEdgeMap,maximalDuration:number):number;
+ /**
+ * This method quickly calculates a tight tree
+ * using a highly optimized version of Gansner's algorithm .
+ * @param {yfiles.algorithms.Graph} g
+ * the graph, where all the edges have directions, such that
+ * rank[source] < rank[target] and rank[target] - rank[source] >= minlength[edge]
+ * @param {number[]} rank the initial ranking
+ * @param {number[]} minLength
+ * the minimal (tight) lengths for each edge. Values must be
+ * non-negative.
+ * @return {number} the number of layers.
+ */
+ simpleFromArray(g:yfiles.algorithms.Graph,rank:number[],minLength:number[]):number;
+ /**
+ * This method quickly calculates a tight tree
+ * using a highly optimized version of Gansner's algorithm .
+ *
+ * Note: if the algorithm exceeds the maximal duration, the result may be invalid (not a valid ranking).
+ *
+ * @param {yfiles.algorithms.Graph} g
+ * the graph, where all the edges have directions, such that
+ * rank[source] < rank[target] and rank[target] - rank[source] >= minlength[edge]
+ * @param {number[]} rank the initial ranking
+ * @param {number[]} minLength
+ * the minimal (tight) lengths for each edge. Values must be
+ * non-negative.
+ * @param {number} maximalDuration a preferred time limit for the algorithm in milliseconds.
+ * @return {number} the number of layers.
+ */
+ simpleFromArrayWithMaximalDuration(g:yfiles.algorithms.Graph,rank:number[],minLength:number[],maximalDuration:number):number;
+ };
+ /**
+ * Responsible for finding paths within a graph that have
+ * certain properties.
+ */
+ export interface Paths extends Object{
+ }
+ var Paths:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns an edge list that contains the edges of a path
+ * from the given start node to the given end node,
+ * if such a path exists.
+ * The edges are returned in the
+ * order they appear in the found path.
+ * If the returned path is empty then no path between the
+ * given nodes was found.
+ * Precondition: startNode != endNode
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.Node} startNode the first node of the path
+ * @param {yfiles.algorithms.Node} endNode the last node of the path
+ * @param {boolean} directed whether to search for a directed or undirected path
+ */
+ findPath(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.EdgeList;
+ /**
+ * Returns an edge list that contains the edges of a
+ * undirected simple path within the given graph.
+ * The edges are returned in the order they appear in the found path.
+ * A heuristic is used to find a path that is long.
+ * It is not guaranteed though that the returned path is
+ * actually the longest path within the given graph, since that is
+ * a well known hard to solve problem.
+ * Complexity: O(graph.N() + graph.E())
+ * Precondition: GraphChecker.isSimple(graph);
+ */
+ findLongPath(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList;
+ /**
+ * Calculates the longest path from one vertex to all other vertices
+ * in a given acyclic graph.
+ * Precondition: GraphCheckers.isAcyclic(g)
+ * @param {yfiles.algorithms.Graph} g a directed acyclic graph.
+ * @param {yfiles.algorithms.Node} startNode the node, for which the distances are calculated.
+ * @param {yfiles.algorithms.IEdgeMap} dist the distances for the edges.
+ * @param {yfiles.algorithms.INodeMap} maxDist here the result will be stored.
+ * @param {yfiles.algorithms.IEdgeMap} predicate only edges for which predicate is true are considered.
+ */
+ findLongestPaths(g:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,dist:yfiles.algorithms.IEdgeMap,maxDist:yfiles.algorithms.INodeMap,predicate:yfiles.algorithms.IEdgeMap):void;
+ /**
+ * Returns the longest directed path within the given acyclic graph.
+ * Precondition: GraphChecker.isAcyclic(g)
+ * @param {yfiles.algorithms.Graph} g a directed acyclic graph
+ * @return {yfiles.algorithms.EdgeList}
+ * an edge list representing the longest directed path within
+ * the given graph
+ */
+ findLongestPath(g:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList;
+ /**
+ * Returns the longest directed path within a given acyclic weighted
+ * graph.
+ * All edges of the graph have an integral length associated
+ * with them. The longest path is defined as one of all
+ * directed paths within the graph for which the edge lengths
+ * of all contained edges sum up to a maximum.
+ * Precondition: GraphChecker.isAcyclic(g)
+ * Precondition: edgeLength.getInt(e) > 0 for all edges e of g
+ * @param {yfiles.algorithms.Graph} g a directed acyclic graph
+ * @param {yfiles.algorithms.IDataProvider} edgeLength
+ * a data provider that must provide the length of each
+ * edge as an int value
+ * @return {yfiles.algorithms.EdgeList}
+ * an edge list representing the longest directed path within
+ * the given graph
+ */
+ findLongestPathWithEdgeLength(g:yfiles.algorithms.Graph,edgeLength:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList;
+ /**
+ * Constructs a node path from a given edge path.
+ * The returned node path
+ * has length path.size()+1, if the given path is not empty.
+ * Otherwise the returned path will be empty. The i-th node in the
+ * returned path will be either source or target node of the i-th edge
+ * in the given path.
+ */
+ constructNodePath(path:yfiles.algorithms.EdgeList):yfiles.algorithms.NodeList;
+ /**
+ * Returns whether or not there is a directed path from one node to another node
+ * in an acyclic graph.
+ * Precondition: GraphChecker.isAcyclic(g)
+ * @param {yfiles.algorithms.Graph} g the acyclic graph which contains the two nodes.
+ * @param {yfiles.algorithms.NodeList} topSort a topological sorting of the nodes of the graph.
+ * @param {yfiles.algorithms.IEdgeMap} predicate only edges for which predicate is true are considered.
+ */
+ findPathFiltered(g:yfiles.algorithms.Graph,topSort:yfiles.algorithms.NodeList,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,predicate:yfiles.algorithms.IEdgeMap):boolean;
+ /**
+ * Marks all edges that belong to a directed path from start to end node.
+ * Complexity: O(g.N()+g.E())
+ * @param {yfiles.algorithms.Graph} g the input graph
+ * @param {yfiles.algorithms.Node} start the start node
+ * @param {yfiles.algorithms.Node} end the end node
+ * @param {yfiles.algorithms.IEdgeMap} pathEdges
+ * the result. For each edge a boolean value will indicate whether or not
+ * it belongs to a path connecting the two nodes.
+ */
+ findAllPathsToEdgeMap(g:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,pathEdges:yfiles.algorithms.IEdgeMap):void;
+ /**
+ * Returns all chains present in the given graph.
+ * A chain in a graph is
+ * a paths of maximal length, where each internal node on the path has degree 2.
+ * The internal nodes on directed chains all have in-degree 1 and out-degree 1.
+ * Complexity: O(g.N()+g.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @return {yfiles.algorithms.EdgeList[]}
+ * an array of EdgeList objects, each of which has at least length 2.
+ * An edge list contains the edges that make up a chain. Method
+ * {@link yfiles.algorithms.Paths#constructNodePath} can be used to convert an edge path
+ * to a node path.
+ */
+ findAllChains(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList[];
+ /**
+ * Returns all simple directed or undirected paths that connect start with end node.
+ * One should note that the number of different paths connecting two nodes can be exponential
+ * in number of nodes and edges of a given graph. This said, even for small graphs the runtime and memory
+ * consumption of the algorithm can be excessive. To significantly lower memory consumption use
+ * {@link yfiles.algorithms.Paths#findAllPathsCursor} instead.
+ * Complexity: O(2^(g.N()+g.E()))
+ * Precondition: graph, startNode, and endNode may not be null.
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.Node} startNode the start node
+ * @param {yfiles.algorithms.Node} endNode the end node
+ * @param {boolean} directed whether or not to consider the edges in the graph to be directed or not.
+ * @return {yfiles.algorithms.EdgeList[]} an array of EdgeLists each representing a path between start and end node.
+ */
+ findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.EdgeList[];
+ /**
+ * A variant of {@link yfiles.algorithms.Paths#findAllPaths}
+ * that returns its result not as a list but as a special cursor that calculates
+ * the next path in the sequence only when needed.
+ * The returned cursor only supports the operation {@link yfiles.algorithms.ICursor#ok},
+ * {@link yfiles.algorithms.ICursor#current}, {@link yfiles.algorithms.ICursor#size} and {@link yfiles.algorithms.ICursor#next}.
+ */
+ findAllPathsCursor(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.ICursor;
+ /**
+ * A variant of {@link yfiles.algorithms.Paths#findAllPaths}
+ * that additionally allows to specify a filter for the paths to be returned.
+ * @param {function(yfiles.algorithms.EdgeList):boolean} filter a filter that tests for each found EdgeList if it should make it to the result list.
+ */
+ findAllPathsFiltered(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean,filter:(obj:yfiles.algorithms.EdgeList)=>boolean):yfiles.algorithms.EdgeList[];
+ };
+ /**
+ * Provides graph algorithms that order the nodes of a graph
+ * by a specific criterion.
+ */
+ export interface NodeOrders extends Object{
+ }
+ var NodeOrders:{
+ $class:yfiles.lang.Class;
+ /**
+ * Assigns a topological order to the nodes of an acyclic graph.
+ * If the given graph is not acyclic then this method returns false
+ * leaving the contents of result topOrder unspecified.
+ * A topological node order of an acyclic graph has the property that for
+ * each node v all of its successors have a higher rank in the order
+ * than v itself.
+ * Precondition: order.length == graph.N()
+ * Complexity: O(graph.N()+graph.E())
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {number[]} order
+ * result value that holds for each node v the
+ * zero-based index within the calculated order,
+ * i.e topOrder[v.index()] == 5
+ * means that v is the 6-th node within the order.
+ */
+ topologicalWithOrder(graph:yfiles.algorithms.Graph,order:number[]):boolean;
+ /**
+ * Returns a topological node order of an acyclic graph.
+ * Precondition: GraphChecker.isAcyclic(graph)
+ * Complexity: O(graph.N()+graph.E())
+ */
+ topological(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList;
+ /**
+ * This method calculates a node order that is identical with
+ * the order of node completion events in a depth first search.
+ * This order is a reversed topological order in case the input graph
+ * is acyclic.
+ * Complexity: O(graph.N()+graph.E())
+ * @see {@link yfiles.algorithms.NodeOrders#topologicalWithOrder}
+ */
+ dfsCompletionWithOrder(graph:yfiles.algorithms.Graph,order:number[]):void;
+ /**
+ * Like {@link yfiles.algorithms.NodeOrders#dfsCompletionWithOrder} but the result is returned
+ * as a NodeList.
+ */
+ dfsCompletion(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList;
+ /**
+ * Assigns an ST-order to the nodes of a biconnected graph.
+ * An ST order (v_1,v_2,....,v_n) for a biconnected graph
+ * is a node order which guarantees that
+ *
+ *
the first node S and the last node T
+ * are connected by an edge.
+ *
For each node v_i in the order that
+ * are not S or T there are
+ * neighbors v_j and v_k with
+ * j < i and k > i.
+ *
+ * Precondition: tOrder.length == graph.N()
+ * Precondition: GraphChecker.isBiconnected(graph)
+ * Complexity: O(graph.N()+graph.E())
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {number[]} stOrder
+ * result value that holds for each node v the
+ * zero-based index within the calculated order,
+ * i.e stOrder[v.index()] == 5
+ * means that v is the 6-th node within the order.
+ */
+ stWithOrder(graph:yfiles.algorithms.Graph,stOrder:number[]):void;
+ /**
+ * Similar to {@link yfiles.algorithms.NodeOrders#stWithOrder}.
+ * Additionally, the edge between the first node S and
+ * the last node T of the returned ordering can be specified.
+ * @param {yfiles.algorithms.Edge} stEdge an edge that connects the first node of the ordering with the last node of the ordering.
+ */
+ stWithOrderAndEdge(graph:yfiles.algorithms.Graph,stOrder:number[],stEdge:yfiles.algorithms.Edge):void;
+ /**
+ * Like {@link yfiles.algorithms.NodeOrders#stWithOrder} but the result is returned as
+ * a NodeList.
+ */
+ st(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList;
+ /**
+ * Converts an array-based result yield by a method of this class
+ * to a NodeList that contains all nodes of the order in the
+ * correct sequence.
+ */
+ toNodeList(graph:yfiles.algorithms.Graph,order:number[]):yfiles.algorithms.NodeList;
+ /**
+ * Copies an array-based result yield by a method of this class
+ * to a NodeMap that will provide values of basic type int.
+ */
+ toNodeMapWithOrder(graph:yfiles.algorithms.Graph,order:number[],result:yfiles.algorithms.INodeMap):void;
+ /**
+ * Copies a list-based result yield by a method of this class
+ * to a NodeMap.
+ * The resulting NodeMap will provide for each node
+ * the index of the node within the given order. The index is of basic type
+ * int.
+ */
+ toNodeMap(order:yfiles.algorithms.NodeList,result:yfiles.algorithms.INodeMap):void;
+ };
+ /**
+ * An interface that describes the structural information of a graph and the data
+ * that is associated with its nodes and edges.
+ */
+ export interface IGraphInterface extends Object{
+ /**
+ * Returns an iterator that provides access to all nodes residing in the graph.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#nodeObjects}.
+ */
+ nodeObjects():yfiles.algorithms.IIterator;
+ /**
+ * Returns an iterator that provides access to all edges residing in the graph.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#edgeObjects}.
+ */
+ edgeObjects():yfiles.algorithms.IIterator;
+ /**
+ * Returns the source node associated with the given edge.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#getSource}.
+ */
+ getSource(edgeObject:Object):Object;
+ /**
+ * Returns the target node associated with the given edge.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#getTarget}.
+ */
+ getTarget(edgeObject:Object):Object;
+ /**
+ * Returns the data provider that is registered with the graph using the given
+ * look-up key.
+ * The look-up domain of a returned data provider normally consists of either
+ * the nodes of the graph, or its edges, or both.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#getDataProvider}.
+ */
+ getDataProvider(dataKey:Object):yfiles.algorithms.IDataProvider;
+ /**
+ * An array of all data provider look-up keys that are registered with
+ * the graph.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#dataProviderKeys}.
+ */
+ dataProviderKeys:Object[];
+ }
+ var IGraphInterface:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * The listener interface for receiving graph events.
+ * A class that is interested in processing a graph event implements this interface.
+ * The object created with that class is then registered with a graph.
+ * When the graph structure changes, the listener object's
+ * {@link yfiles.algorithms.IGraphListener#onGraphEvent onGraphEvent} method is invoked.
+ * The listener object's onGraphEvent method is also invoked on so-called PRE and
+ * POST events emitted by the graph.
+ * These events signal that a (possibly empty) sequence of graph events is about
+ * to be emitted (PRE event) or that the sequence is completed (POST event).
+ * For example, if a node is about to be removed from a graph, then the following
+ * sequence of graph events can be observed:
+ *
+ *
+ * a PRE event
+ *
+ *
+ * a (possibly empty) sequence of edge removal events
+ *
+ *
+ * the actual node removal event
+ *
+ *
+ * a POST event
+ *
+ *
+ * The POST event concludes the logically coherent sequence of structural graph
+ * changes that has been opened by the PRE event.
+ * PRE and POST events must constitute a well-formed bracket-structure, e.g.,
+ * ( ( () ) () ).
+ */
+ export interface IGraphListener extends Object{
+ /**
+ * Invoked when the structure of the graph has changed.
+ * The code written for this method performs the operations that need to occur
+ * when the graph changes.
+ * @see Specified by {@link yfiles.algorithms.IGraphListener#onGraphEvent}.
+ */
+ onGraphEvent(e:yfiles.algorithms.GraphEvent):void;
+ }
+ var IGraphListener:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * A general interface for data provision.
+ * A data provider grants access to data associated
+ * with one or more data holders. It constitutes a read-only
+ * view on particular data.
+ */
+ export interface IDataProvider extends Object{
+ /**
+ * Returns an object value associated with the given data holder.
+ * This method may throw an UnsupportedOperationException.
+ * @see Specified by {@link yfiles.algorithms.IDataProvider#get}.
+ */
+ get(dataHolder:Object):Object;
+ /**
+ * Returns an integer value associated with the given data holder.
+ * This method may throw an UnsupportedOperationException.
+ * @see Specified by {@link yfiles.algorithms.IDataProvider#getInt}.
+ */
+ getInt(dataHolder:Object):number;
+ /**
+ * Returns a double value associated with the given data holder.
+ * This method may throw an UnsupportedOperationException.
+ * @see Specified by {@link yfiles.algorithms.IDataProvider#getDouble}.
+ */
+ getDouble(dataHolder:Object):number;
+ /**
+ * Returns a boolean value associated with the given data holder.
+ * This method may throw an UnsupportedOperationException.
+ * @see Specified by {@link yfiles.algorithms.IDataProvider#getBool}.
+ */
+ getBool(dataHolder:Object):boolean;
+ }
+ var IDataProvider:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * A cursor interface for iterating over edges.
+ */
+ export interface IEdgeCursor extends Object,yfiles.algorithms.ICursor{
+ /**
+ * The edge at the current location of the cursor.
+ * This method is the typed variant of {@link yfiles.algorithms.ICursor#current}.
+ * @see Specified by {@link yfiles.algorithms.IEdgeCursor#edge}.
+ */
+ edge:yfiles.algorithms.Edge;
+ /**
+ * Moves the cursor to the cyclic next element of the underlying sequence.
+ * This is the next element if available, else it is the first element.
+ * @see Specified by {@link yfiles.algorithms.IEdgeCursor#cyclicNext}.
+ */
+ cyclicNext():void;
+ /**
+ * Moves the cursor to the cyclic previous element of the underlying sequence.
+ * This is the previous element if available, else it is the last element.
+ * @see Specified by {@link yfiles.algorithms.IEdgeCursor#cyclicPrev}.
+ */
+ cyclicPrev():void;
+ }
+ var IEdgeCursor:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * Provides access to data associated with an edge.
+ * An edge map can be considered as a map that allows
+ * only edges as keys. Edge keys of an edge map must belong
+ * to the same graph.
+ * There are data access methods defined for the most common typed
+ * values as well.
+ * The edge values are initialized with Java(TM) default values
+ * (null, 0, 0.0, false) upon initialization.
+ */
+ export interface IEdgeMap extends Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor,yfiles.algorithms.IDataMap{
+ /**
+ * Associates the given value to the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#set}.
+ */
+ set(edge:Object,value:Object):void;
+ /**
+ * Returns the value bound to the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#get}.
+ */
+ get(edge:Object):Object;
+ /**
+ * Associates the given boolean value to the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#setBool}.
+ */
+ setBool(edge:Object,value:boolean):void;
+ /**
+ * Returns the boolean value bound to the given edge.
+ * Precondition:
+ * The value must have been associated to the given edge by
+ * a call to {@link yfiles.algorithms.IEdgeMap#setBool setBool}.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#getBool}.
+ */
+ getBool(edge:Object):boolean;
+ /**
+ * Associates the given double value to the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#setDouble}.
+ */
+ setDouble(edge:Object,value:number):void;
+ /**
+ * Returns the double value bound to the given edge.
+ * Precondition:
+ * The value must have been associated to the given edge by
+ * a call to {@link yfiles.algorithms.IEdgeMap#setDouble setDouble}.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#getDouble}.
+ */
+ getDouble(edge:Object):number;
+ /**
+ * Associates the given integer value to the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#setInt}.
+ */
+ setInt(edge:Object,value:number):void;
+ /**
+ * Returns the integer value bound to the given edge.
+ * Precondition:
+ * The value must have been associated to the given edge by
+ * a call to {@link yfiles.algorithms.IEdgeMap#setInt setInt}.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#getInt}.
+ */
+ getInt(edge:Object):number;
+ }
+ var IEdgeMap:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * This class provides methods for calculating independent sets.
+ */
+ export interface IndependentSets extends Object{
+ }
+ var IndependentSets:{
+ $class:yfiles.lang.Class;
+ /**
+ * Partitions the vertex set of the given conflict graph into independent sets.
+ * Precondition: The input graph is simple, i.e. it contains neither multi-edges nor selfloops.
+ * @param {yfiles.algorithms.Graph} conflictGraph the input graph.
+ * @return {yfiles.algorithms.NodeList[]} a NodeList array where each entry contains an independent set of nodes.
+ * @see {@link yfiles.algorithms.IndependentSets#getIndependentSet}
+ */
+ getIndependentSets(conflictGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[];
+ /**
+ * Calculates an independent set for a given conflict graph (each pair of nodes of the independent set is non-adjacent
+ * in the conflict graph).
+ * We use a greedy heuristic which tries to find a large independent set.
+ * Precondition: The input graph is simple, i.e. it contains neither multi-edges nor selfloops.
+ * @param {yfiles.algorithms.Graph} conflictGraph the input graph.
+ * @return {yfiles.algorithms.NodeList} a NodeList containing an independent set of nodes
+ */
+ getIndependentSet(conflictGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList;
+ };
+ /**
+ * Exception thrown when a graph-structural precondition is violated.
+ * Some graph algorithms make only sense on specially structured graphs, like,
+ * e.g., trees, DAGs (short for directed acyclic graph), or planar graphs.
+ * Methods that detect graph-structural mismatch will throw this exception then.
+ */
+ export interface InvalidGraphStructureException extends yfiles.system.ArgumentException{
+ }
+ var InvalidGraphStructureException:{
+ $class:yfiles.lang.Class;
+ /**
+ * Constructs a WrongGraphStructure exception with the specified message.
+ */
+ new (msg:string):yfiles.algorithms.InvalidGraphStructureException;
+ };
+ /**
+ * Represents a so-called "cell" or "link" of the doubly linked list implementation
+ * {@link yfiles.algorithms.YList}.
+ * It may be used to perform fast access and remove operations on that type of list.
+ */
+ export interface ListCell extends Object{
+ /**
+ * Returns the successor cell of this cell.
+ * If there is no successor, then null is returned.
+ */
+ succ():yfiles.algorithms.ListCell;
+ /**
+ * Returns the predecessor cell of this cell.
+ * If there is no predecessor, then null is returned.
+ */
+ pred():yfiles.algorithms.ListCell;
+ /**
+ * The element stored in this cell.
+ */
+ info:Object;
+ }
+ var ListCell:{
+ $class:yfiles.lang.Class;
+ };
+ /**
+ * A cursor interface for iterating over nodes.
+ */
+ export interface INodeCursor extends Object,yfiles.algorithms.ICursor{
+ /**
+ * The node at the current location of the cursor.
+ * This method is the typed variant of {@link yfiles.algorithms.ICursor#current}.
+ * @see Specified by {@link yfiles.algorithms.INodeCursor#node}.
+ */
+ node:yfiles.algorithms.Node;
+ /**
+ * Moves the cursor to the cyclic next element of the underlying sequence.
+ * This is the next element if available, else it is the first element.
+ * @see Specified by {@link yfiles.algorithms.INodeCursor#cyclicNext}.
+ */
+ cyclicNext():void;
+ /**
+ * Moves the cursor to the cyclic previous element of the underlying sequence.
+ * This is the previous element if available, else it is the last element.
+ * @see Specified by {@link yfiles.algorithms.INodeCursor#cyclicPrev}.
+ */
+ cyclicPrev():void;
+ }
+ var INodeCursor:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * Provides access to data associated with a node.
+ * A node map can be considered as a map that allows
+ * only nodes as keys. Node keys of a node map must belong
+ * to the same graph.
+ * There are data access methods defined for the most common typed
+ * values as well.
+ * The node values are initialized with Java(TM) default values
+ * (null, 0, 0.0, false) upon initialization.
+ */
+ export interface INodeMap extends Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor,yfiles.algorithms.IDataMap{
+ /**
+ * Associates the given value to the given node.
+ * @see Specified by {@link yfiles.algorithms.INodeMap#set}.
+ */
+ set(node:Object,value:Object):void;
+ /**
+ * Returns the value bound to the given node.
+ * @see Specified by {@link yfiles.algorithms.INodeMap#get}.
+ */
+ get(node:Object):Object;
+ /**
+ * Associates the given boolean value to the given node.
+ * @see Specified by {@link yfiles.algorithms.INodeMap#setBool}.
+ */
+ setBool(node:Object,value:boolean):void;
+ /**
+ * Returns the boolean value bound to the given node.
+ * Precondition:
+ * The value must have been associated to the given node by
+ * a call to {@link yfiles.algorithms.INodeMap#setBool setBool}.
+ * @see Specified by {@link yfiles.algorithms.INodeMap#getBool}.
+ */
+ getBool(key:Object):boolean;
+ /**
+ * Associates the given double value to the given node.
+ * @see Specified by {@link yfiles.algorithms.INodeMap#setDouble}.
+ */
+ setDouble(node:Object,value:number):void;
+ /**
+ * Returns the double value bound to the given node.
+ * Precondition:
+ * The value must have been associated to the given node by
+ * a call to {@link yfiles.algorithms.INodeMap#setDouble setDouble}.
+ * @see Specified by {@link yfiles.algorithms.INodeMap#getDouble}.
+ */
+ getDouble(node:Object):number;
+ /**
+ * Associates the given integer value to the given node.
+ * @see Specified by {@link yfiles.algorithms.INodeMap#setInt}.
+ */
+ setInt(node:Object,value:number):void;
+ /**
+ * Returns the integer value bound to the given node.
+ * Precondition:
+ * The value must have been associated to the given node by
+ * a call to {@link yfiles.algorithms.INodeMap#setInt setInt}.
+ * @see Specified by {@link yfiles.algorithms.INodeMap#getInt}.
+ */
+ getInt(node:Object):number;
+ }
+ var INodeMap:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * Generic Interface for classes that provide an ordering
+ * for the nodes of a graph.
+ */
+ export interface INodeSequencer extends Object{
+ /**
+ * Returns a cursor that grants access to all nodes of the given
+ * graph in some order.
+ * @see Specified by {@link yfiles.algorithms.INodeSequencer#nodes}.
+ */
+ nodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.INodeCursor;
+ }
+ var INodeSequencer:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * Provides diverse algorithms and helper methods for solving the shortest path problem
+ * on weighted graphs.
+ */
+ export interface ShortestPaths extends Object{
+ }
+ var ShortestPaths:{
+ $class:yfiles.lang.Class;
+ /**
+ * This method solves the single-source shortest path problem for arbitrary graphs
+ * where each edge has a uniform cost of 1.0.
+ * This method yields the shortest distance from a given node s to all other nodes.
+ * Precondition: dist.length == graph.N()
+ * Complexity: O(graph.N()+graph.E())
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {yfiles.algorithms.Node} s the start node for the shortest path search
+ * @param {boolean} directed
+ * whether or not to consider the graph as directed. If the graph is
+ * to be considered undirected then each edge can be traversed in both directions and
+ * the returned shortest paths can thus be undirected.
+ * @param {number[]} dist
+ * return value that will hold the shortest distance from node s to
+ * all other nodes. The distance from s to v is
+ * dist[v.index()]. If there is no path from s to v
+ * then dist[v.index()] == Double.POSITIVE_INFINITY.
+ */
+ uniform(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:number[]):void;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#uniform} but additionally this method
+ * yields the path edges of each calculated shortest path.
+ * Precondition: pred.length == graph.N()
+ * @param {yfiles.algorithms.Edge[]} pred
+ * return value that holds for each node t the shortest
+ * path edge pred[t.index()] which is the last edge on the shortest
+ * path from s to t. If t == s or if there
+ * is no shortest path from s to t then
+ * pred[t.index()] == null.
+ * @see {@link yfiles.algorithms.ShortestPaths#constructNodePathFromArray}
+ * @see {@link yfiles.algorithms.ShortestPaths#constructEdgePathFromArray}
+ */
+ uniformToArray(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:number[],pred:yfiles.algorithms.Edge[]):void;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#uniformToArray} but uses NodeMaps instead of
+ * arrays.
+ * @param {yfiles.algorithms.INodeMap} dist return value. the map will provide a double value for each node.
+ * @param {yfiles.algorithms.INodeMap} pred return value. the map will provide an Edge for each node.
+ */
+ uniformToMap(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):void;
+ /**
+ * This method solves the single-source shortest path problem for acyclic directed graphs.
+ * Associated with each edge is an arbitrary double value that represents the cost of that edge.
+ * This method yields the shortest distance from a given node s to all other nodes.
+ * Precondition: GraphChecker.isAcyclic(graph)
+ * Precondition: cost.length == graph.E()
+ * Precondition: dist.length == graph.N()
+ * Complexity: O(graph.N()+graph.E())
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {yfiles.algorithms.Node} s the start node for the shortest path search
+ * @param {number[]} cost
+ * holds the costs for traversing each edge. Edge e
+ * has cost cost[e.index()].
+ * @param {number[]} dist
+ * return value that will hold the shortest distance from node s to
+ * all other nodes. The distance from s to v is
+ * dist[v.index()]. If there is no path from s to v
+ * then dist[v.index()] == Double.POSITIVE_INFINITY.
+ * @return {boolean} false if the input graph was not acyclic.
+ */
+ acyclic(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,cost:number[],dist:number[]):boolean;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#acyclic} but additionally this method
+ * yields the path edges of each calculated shortest path.
+ * Precondition: pred.length == graph.N()
+ * @param {yfiles.algorithms.Edge[]} pred
+ * return value that holds for each node t the shortest
+ * path edge pred[t.index()] which is the last edge on the shortest
+ * path from s to t. If t == s or if there
+ * is no shortest path from s to t then
+ * pred[t.index()] == null.
+ * @see {@link yfiles.algorithms.ShortestPaths#constructNodePathFromArray}
+ * @see {@link yfiles.algorithms.ShortestPaths#constructEdgePathFromArray}
+ */
+ acyclicToArray(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,cost:number[],dist:number[],pred:yfiles.algorithms.Edge[]):boolean;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#acyclicToArray}
+ * but uses NodeMaps and DataProviders instead of arrays.
+ * @param {yfiles.algorithms.IDataProvider} cost must provide a double value for each edge.
+ * @param {yfiles.algorithms.INodeMap} dist return value. the map will provide a double value for each node.
+ * @param {yfiles.algorithms.INodeMap} pred return value. the map will provide an Edge for each node.
+ */
+ acyclicToMap(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean;
+ /**
+ * This method solves the single-source shortest path problem for arbitrary graphs.
+ * Associated with each edge is a non-negative double value that represents
+ * the cost of that edge.
+ * This method yields the shortest distance from a given node s to all other nodes.
+ * Precondition: For each edge e: cost[e.index()] >= 0
+ * Precondition: cost.length == graph.E()
+ * Precondition: dist.length == graph.N()
+ * Complexity: O(graph.E()+graph.N()*log(graph.N())
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {yfiles.algorithms.Node} s the start node for the shortest path search
+ * @param {boolean} directed
+ * whether or not to consider the graph as directed. If the graph is
+ * to be considered undirected then each edge can be traversed in both directions and
+ * the returned shortest paths can thus be undirected.
+ * @param {number[]} cost
+ * holds the costs for traversing each edge. Edge e
+ * has cost cost[e.index()].
+ * @param {number[]} dist
+ * return value that will hold the shortest distance from node s to
+ * all other nodes. The distance from s to v is
+ * dist[v.index()]. If there is no path from s to v
+ * then dist[v.index()] == Double.POSITIVE_INFINITY.
+ */
+ dijkstra(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[]):void;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#dijkstra} but additionally this method
+ * yields the path edges of each calculated shortest path.
+ * Precondition: pred.length == graph.N()
+ * @param {yfiles.algorithms.Edge[]} pred
+ * return value that holds for each node t the shortest
+ * path edge pred[t.index()] which is the last edge on the shortest
+ * path from s to t. If t == s or if there
+ * is no shortest path from s to t then
+ * pred[t.index()] == null.
+ * @see {@link yfiles.algorithms.ShortestPaths#constructNodePathFromArray}
+ * @see {@link yfiles.algorithms.ShortestPaths#constructEdgePathFromArray}
+ */
+ dijkstraToArray(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred:yfiles.algorithms.Edge[]):void;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#dijkstraToArray}
+ * but uses NodeMaps and DataProviders instead of arrays.
+ * @param {yfiles.algorithms.IDataProvider} cost must provide a double value for each edge.
+ * @param {yfiles.algorithms.INodeMap} dist return value. the map will provide a double value for each node.
+ * @param {yfiles.algorithms.INodeMap} pred return value. the map will provide an Edge for each node.
+ */
+ dijkstraWithCostToMap(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):void;
+ /**
+ * This method solves the single-source single-sink shortest path problem
+ * for arbitrary graphs.
+ * Associated with each edge is a non-negative double value that represents
+ * the cost of that edge.
+ * This method returns the shortest distance from node s to node t.
+ * It also returns information to construct the actual path between these to nodes.
+ * Precondition: For each edge e: cost[e.index()] >= 0
+ * Precondition: cost.length == graph.E()
+ * Precondition: pred.length == graph.N()
+ * Complexity: O(graph.E()+graph.N()*log(graph.N())
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {yfiles.algorithms.Node} s the source node for the shortest path search
+ * @param {yfiles.algorithms.Node} t the sink node for the shortest path search
+ * @param {boolean} directed
+ * whether or not to consider the graph as directed. If the graph is
+ * to be considered undirected then each edge can be traversed in both directions and
+ * the returned shortest paths can thus be undirected.
+ * @param {number[]} cost
+ * holds the costs for traversing each edge. Edge e
+ * has cost cost[e.index()].
+ * @param {yfiles.algorithms.Edge[]} pred
+ * return value that holds for each node v on the
+ * the shortest the path from s to t an edge
+ * pred[v.index()] which is the last edge on
+ * the shortest path from s to v. If v == s or if there
+ * is no shortest path from s to v then
+ * pred[v.index()] == null.
+ * @return {number}
+ * the distance between s and t if a path between these two
+ * nodes exist and Double.POSITIVE_INFINITY otherwise.
+ * @see {@link yfiles.algorithms.ShortestPaths#constructNodePathFromArray}
+ * @see {@link yfiles.algorithms.ShortestPaths#constructEdgePathFromArray}
+ */
+ singleSourceSingleSinkToArray(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:number[],pred:yfiles.algorithms.Edge[]):number;
+ /**
+ * Similar to {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSinkToArray}
+ * but instead of returning the shortest distance between the source and sink
+ * the actual shortest edge path between these nodes will be returned.
+ * If the returned path is empty then there is no path between the nodes.
+ * @return {yfiles.algorithms.EdgeList} a shortest path between source and sink
+ */
+ singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:number[]):yfiles.algorithms.EdgeList;
+ /**
+ * Similar to {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSinkToMap}
+ * but instead of returning the shortest distance between the source and sink
+ * the actual shortest edge path between these nodes will be returned.
+ * If the returned path is empty then there is no path between the nodes.
+ * @return {yfiles.algorithms.EdgeList} a shortest path between source and sink
+ */
+ singleSourceSingleSinkWithCost(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSinkToArray}
+ * but uses NodeMaps and DataProviders instead of arrays.
+ * @param {yfiles.algorithms.IDataProvider} cost must provide a double value for each edge.
+ * @param {yfiles.algorithms.INodeMap} pred return value. the map will provide an Edge for each node.
+ */
+ singleSourceSingleSinkToMap(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,pred:yfiles.algorithms.INodeMap):number;
+ /**
+ * This method solves the single-source shortest path problem for arbitrary graphs.
+ * Associated with each edge is an arbitrary double value that represents
+ * the cost of that edge. In case the given weighted graph contains no negative cost cycles
+ * this method will yield the shortest distance from a given node s to all other nodes.
+ * If, on the other hand, the given graph contains negative-cost cycles this method will yield
+ * no reasonable result which will be indicated by the return value false.
+ * Precondition: cost.length == graph.E()
+ * Precondition: dist.length == graph.N()
+ * Complexity:
+ * O(graph.E()*min(D,graph.N())) where D is the maximal
+ * number of edges in any shortest path.
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {yfiles.algorithms.Node} s the start node for the shortest path search
+ * @param {boolean} directed
+ * whether or not to consider the graph as directed. If the graph is
+ * to be considered undirected then each edge can be traversed in both directions and
+ * the returned shortest paths can thus be undirected.
+ * @param {number[]} cost
+ * holds the costs for traversing each edge. Edge e
+ * has cost cost[e.index()].
+ * @param {number[]} dist
+ * return value that will hold the shortest distance from node s to
+ * all other nodes. The distance from s to v is
+ * dist[v.index()]. If there is no path from s to v
+ * then dist[v.index()] == Double.POSITIVE_INFINITY.
+ * @return {boolean}
+ * false if this weighted graph contains a negative cost cycle,
+ * true otherwise.
+ */
+ bellmanFord(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[]):boolean;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#bellmanFord} but additionally this method
+ * yields the path edges of each calculated shortest path.
+ * Precondition: pred.length == graph.N()
+ * @param {yfiles.algorithms.Edge[]} pred
+ * return value that holds for each node t the shortest
+ * path edge pred[t.index()] which is the last edge on the shortest
+ * path from s to t. If t == s or if there
+ * is no shortest path from s to t then
+ * pred[t.index()] == null.
+ * @see {@link yfiles.algorithms.ShortestPaths#constructNodePathFromArray}
+ * @see {@link yfiles.algorithms.ShortestPaths#constructEdgePathFromArray}
+ */
+ bellmanFordToArray(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred:yfiles.algorithms.Edge[]):boolean;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#bellmanFordToArray}
+ * but uses NodeMaps and DataProviders instead of arrays.
+ * @param {yfiles.algorithms.IDataProvider} cost must provide a double value for each edge.
+ * @param {yfiles.algorithms.INodeMap} dist return value. the map will provide a double value for each node.
+ * @param {yfiles.algorithms.INodeMap} pred return value. the map will provide an Edge for each node.
+ */
+ bellmanFordToMap(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean;
+ /**
+ * This method solves the single-source shortest path problem for arbitrary graphs.
+ * Depending on the structure of the given graph and the values of the given edge costs it
+ * delegates its job to the algorithm with the theoretically best running time.
+ * Please note that theory does not necessarily reflect practice.
+ * Precondition: cost.length == graph.E()
+ * Precondition: dist.length == graph.N()
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {yfiles.algorithms.Node} s the start node for the shortest path search
+ * @param {boolean} directed
+ * whether or not to consider the graph as directed. If the graph is
+ * to be considered undirected then each edge can be traversed in both directions and
+ * the returned shortest paths can thus be undirected.
+ * @param {number[]} cost
+ * holds the costs for traversing each edge. Edge e
+ * has cost cost[e.index()].
+ * @param {number[]} dist
+ * return value that will hold the shortest distance from node s to
+ * all other nodes. The distance from s to v is
+ * dist[v.index()]. If there is no path from s to v
+ * then dist[v.index()] == Double.POSITIVE_INFINITY.
+ * @return {boolean}
+ * false if this weighted graph contains a negative cost cycle,
+ * true otherwise.
+ */
+ singleSource(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[]):boolean;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#singleSource} but additionally this method
+ * yields the path edges of each calculated shortest path.
+ * Precondition: pred.length == graph.N()
+ * @param {yfiles.algorithms.Edge[]} pred
+ * return value that holds for each node t the shortest
+ * path edge pred[t.index()] which is the last edge on the shortest
+ * path from s to t. If t == s or if there
+ * is no shortest path from s to t then
+ * pred[t.index()] == null.
+ * @see {@link yfiles.algorithms.ShortestPaths#constructNodePathFromArray}
+ * @see {@link yfiles.algorithms.ShortestPaths#constructEdgePathFromArray}
+ */
+ singleSourceToArray(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred:yfiles.algorithms.Edge[]):boolean;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#singleSourceToArray}
+ * but uses NodeMaps and DataProviders instead of arrays.
+ * @param {yfiles.algorithms.IDataProvider} cost must provide a double value for each edge.
+ * @param {yfiles.algorithms.INodeMap} dist return value. the map will provide a double value for each node.
+ * @param {yfiles.algorithms.INodeMap} pred return value. the map will provide an Edge for each node.
+ */
+ singleSourceToMap(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean;
+ /**
+ * This method solves the all-pairs shortest path problem for graphs with arbitrary
+ * edge costs.
+ * If the given graph contains a negative cost cycle, then false is
+ * returned and the values returned in dist are left unspecified.
+ * Precondition: cost.length == graph.E();
+ * Precondition: dimension of dist: [graph.N()][graph.N()]]
+ * Complexity: O(graph.N())*O(singleSource)
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {boolean} directed
+ * whether or not to consider the graph as directed. If the graph is
+ * to be considered undirected then each edge can be traversed in both directions and
+ * the returned shortest paths can thus be undirected.
+ * @param {number[]} cost
+ * holds the costs for traversing each edge. Edge e
+ * has cost cost[e.index()].
+ * @param {number[][]} dist
+ * return value that will hold the shortest path distances from all pairs of
+ * nodes s and t in the graph.
+ * The distance from s to t is
+ * dist[s.index()][t.index()]. If there is no path from s to t
+ * then dist[s.index()][t.index()] == Double.POSITIVE_INFINITY.
+ * @return {boolean} whether or not the given graph contains a negative cost cycle.
+ */
+ allPairs(graph:yfiles.algorithms.Graph,directed:boolean,cost:number[],dist:number[][]):boolean;
+ /**
+ * Marks all edges that belong to a shortest path from start to end node.
+ * This method assumes that each edge of the input graph has a cost of 1.0.
+ * Complexity: O(g.N()+g.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.Node} start the start node
+ * @param {yfiles.algorithms.Node} end the end node
+ * @param {boolean} directed
+ * whether or not to consider the graph as directed. If the graph is
+ * to be considered undirected then each edge can be traversed in both directions and
+ * the returned shortest paths can thus be undirected.
+ * @param {yfiles.algorithms.IEdgeMap} pathMap
+ * the result. For each edge a boolean value will indicate whether or not
+ * it belongs to a shortest path connecting the two nodes.
+ */
+ findShortestUniformPaths(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,directed:boolean,pathMap:yfiles.algorithms.IEdgeMap):void;
+ /**
+ * This method finds the k shortest paths
+ * connecting a pair of nodes in a directed graph with non-negative edge costs.
+ * The result will be returned as a list of EdgeList objects.
+ * Note that the returned paths are not required to be simple, i.e. they may contain
+ * a node or an edge multiple times.
+ * Precondition: For each edge e: costDP.getDouble(e) >= 0
+ * Complexity: O(graph.E() + graph.N()*log(graph.N()) + k)
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {yfiles.algorithms.IDataProvider} costDP
+ * a data provider that provides a double-valued cost for each edge
+ * of the input graph.
+ * @param {yfiles.algorithms.Node} start start node of the shortest paths
+ * @param {yfiles.algorithms.Node} end the end node of the shortest paths
+ * @param {number} k
+ * @return {yfiles.algorithms.YList}
+ * a list of EdgeList objects each of which representing a path from
+ * start to end node. The i-th path in the
+ * list contains the i-th shortest path between start and end
+ * node. Note that the returned list may contain less than k paths in case
+ * there are fewer directed paths between start and end node.
+ */
+ kShortestPaths(graph:yfiles.algorithms.Graph,costDP:yfiles.algorithms.IDataProvider,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,k:number):yfiles.algorithms.YList;
+ /**
+ * A variant of {@link yfiles.algorithms.ShortestPaths#kShortestPaths}
+ * that returns its result not as a list but as a special cursor that calculates
+ * the next path in the sequence only when needed.
+ * The returned cursor only supports the operation {@link yfiles.algorithms.ICursor#ok},
+ * {@link yfiles.algorithms.ICursor#current} and {@link yfiles.algorithms.ICursor#next}.
+ */
+ kShortestPathsCursor(graph:yfiles.algorithms.Graph,costDP:yfiles.algorithms.IDataProvider,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,k:number):yfiles.algorithms.ICursor;
+ /**
+ * Convenience method that returns an array containing
+ * uniform edge costs of 1.0 for each edge
+ * of the given graph.
+ * @return {number[]}
+ * an array cost[] that contains uniform
+ * edge costs of 1.0 for each edge e: cost[e.index()] == 1.0.
+ */
+ uniformCost(graph:yfiles.algorithms.Graph):number[];
+ /**
+ * Convenience method that constructs an explicit node path from the
+ * result yielded by one of the shortest paths methods defined in this class.
+ * @param {yfiles.algorithms.Node} s
+ * the start node of the shortest path. This must be the
+ * same start node that was specified when pred was calculated.
+ * @param {yfiles.algorithms.Node} t the end node of the path
+ * @param {yfiles.algorithms.Edge[]} pred
+ * the shortest path edge result array returned by one of the
+ * shortest path edge methods defined in this class.
+ * @return {yfiles.algorithms.NodeList}
+ * a node list that holds the nodes on the shortest path
+ * from s to t in the correct order. If there
+ * is no path from s to t then an empty
+ * list is returned.
+ */
+ constructNodePathFromArray(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.Edge[]):yfiles.algorithms.NodeList;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#constructNodePathFromArray} with the difference that
+ * the path edges are given by a DataProvider.
+ * @param {yfiles.algorithms.IDataProvider} pred
+ * the shortest path edge result DataProvider returned by one of the
+ * shortest path edge methods defined in this class.
+ */
+ constructNodePathFromMap(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList;
+ /**
+ * Convenience method that constructs an explicit edge path from the
+ * result yielded by one of the shortest paths methods defined in this class.
+ * @param {yfiles.algorithms.Node} s
+ * the start node of the shortest path. This must be the
+ * same start node that was specified when pred was calculated.
+ * @param {yfiles.algorithms.Node} t the end node of the path
+ * @param {yfiles.algorithms.Edge[]} pred
+ * the shortest path edge result array returned by one of the
+ * shortest path edge methods defined in this class.
+ * @return {yfiles.algorithms.EdgeList}
+ * an edge list that holds the edges on the shortest path
+ * from s to t in the correct order. If there
+ * is no path from s to t then an empty
+ * list is returned.
+ */
+ constructEdgePathFromArray(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.Edge[]):yfiles.algorithms.EdgeList;
+ /**
+ * Like {@link yfiles.algorithms.ShortestPaths#constructEdgePathFromArray} with the difference that
+ * the path edges are given by a DataProvider.
+ * @param {yfiles.algorithms.IDataProvider} pred
+ * the shortest path edge result DataProvider returned by one of the
+ * shortest path edge methods defined in this class.
+ */
+ constructEdgePathToMap(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList;
+ /**
+ * Finds all nodes and edges that belong to a shortest path from start to a set of target nodes in the graph not
+ * farther away than a given distance.
+ * This method assumes that each edge of the input graph has a cost of 1.0.
+ * Complexity: O(g.N()+g.E())
+ * Complexity: O(graph.N()+graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.Node} start the start node
+ * @param {yfiles.algorithms.IDataProvider} targetMap
+ * a boolean data provider that marks the target nodes. If the data provider is null
+ * all nodes in the graph are assumed to be target nodes.
+ * @param {boolean} directed whether or not to work on directed edges
+ * @param {number} maxLength
+ * the maximum edge length of the shortest paths. Shortest paths
+ * that are longer than this value will not be considered.
+ * @param {yfiles.algorithms.EdgeList} pathEdges
+ * a return value. If this parameter is not null, this algorithm first clears the list and then adds
+ * all edges that belong to the detected shortest paths.
+ * @param {yfiles.algorithms.NodeList} pathNodes
+ * a return value. If this parameter is not null, this algorithm first clears the list and then adds
+ * all nodes that belong to the detected shortest paths.
+ */
+ findShortestUniformPathsFromMap(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,targetMap:yfiles.algorithms.IDataProvider,directed:boolean,maxLength:number,pathEdges:yfiles.algorithms.EdgeList,pathNodes:yfiles.algorithms.NodeList):void;
+ /**
+ * Returns two edge-disjoint paths from in a nonnegatively-weighted directed graph, so that both paths connect
+ * s and t and have minimum total length.
+ * @param {yfiles.algorithms.Graph} graph the graph being acted upon
+ * @param {yfiles.algorithms.Node} source source node of the shortest pair
+ * @param {yfiles.algorithms.Node} target end node of the shortest pair
+ * @param {boolean} directed whether or not to interpret the edges as directed or undirected
+ * @param {yfiles.algorithms.IDataProvider} costDP
+ * a data provider that provides a double-valued cost for each edge
+ * of the input graph.
+ * @return {yfiles.algorithms.EdgeList[]}
+ * a two-dimensional EdgeList array that holds the resulting edge-disjoint paths, or null if no such
+ * edge-disjoint paths exist.
+ */
+ shortestPair(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,directed:boolean,costDP:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList[];
+ };
+ /**
+ * An abstract adapter class for providing data.
+ * The data provision methods
+ * in this class throw a {@link yfiles.system.NotSupportedException} and
+ * {@link yfiles.algorithms.DataProviderAdapter#defined} always returns false.
+ *
+ * This class exists as a convenience for creating data provider objects.
+ *
+ * Extend this class to provide either typed or untyped data for a
+ * certain lookup domain.
+ *
+ */
+ export interface DataProviderAdapter extends Object,yfiles.algorithms.IDataProvider{
+ /**
+ * Subclasses may override this
+ * method to provide access to object values.
+ * @throws {yfiles.system.NotSupportedException} unless overwritten.
+ * @see Specified by {@link yfiles.algorithms.IDataProvider#get}.
+ */
+ get(dataHolder:Object):Object;
+ /**
+ * Subclasses may override this
+ * method to provide access to integer values.
+ * @throws {yfiles.system.NotSupportedException} unless overwritten.
+ * @see Specified by {@link yfiles.algorithms.IDataProvider#getInt}.
+ */
+ getInt(dataHolder:Object):number;
+ /**
+ * Subclasses may override this
+ * method to provide access to double values.
+ * @throws {yfiles.system.NotSupportedException} unless overwritten.
+ * @see Specified by {@link yfiles.algorithms.IDataProvider#getDouble}.
+ */
+ getDouble(dataHolder:Object):number;
+ /**
+ * Subclasses may override this
+ * method to provide access to boolean values.
+ * @throws {yfiles.system.NotSupportedException} unless overwritten.
+ * @see Specified by {@link yfiles.algorithms.IDataProvider#getBool}.
+ */
+ getBool(dataHolder:Object):boolean;
+ /**
+ * Returns false for all data holders.
+ * Subclasses
+ * should override this method to make clear for which data holders
+ * there is a value accessible via this data provider.
+ * @return {boolean} false.
+ */
+ defined(dataHolder:Object):boolean;
+ }
+ var DataProviderAdapter:{
+ $class:yfiles.lang.Class;
+ };
+ /**
+ * This class provides convenience and transformation services for DataProviders.
+ */
+ export interface DataProviders extends Object{
+ }
+ export module DataProviders{
+ /**
+ * This helper class can be used to overlay DataProviders registered at a graph
+ * with another DataProvider.
+ */
+ export interface DataProviderOverlayManager extends Object{
+ /**
+ * Adds the given DataProvider under the given key to the graph.
+ * Stores the previously set
+ * DataProvider instance so it can be restored at a later time using method {{@link yfiles.algorithms.DataProviders.DataProviderOverlayManager#restoreOriginalDataProviders}.
+ */
+ addDataProvider(dataProviderKey:Object,newDataProvider:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Restores all DataProvider bindings that have been changed using {{@link yfiles.algorithms.DataProviders.DataProviderOverlayManager#addDataProvider}.
+ * Calling this method resets the state its state.
+ */
+ restoreOriginalDataProviders():void;
+ }
+ }
+ var DataProviders:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns a DataProvider view of a double array defined for edges.
+ * The double value data[edge.index()] will be returned
+ * by the data provider upon the method call getDouble(edge).
+ * @param {number[]} data array data for each edge of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given array
+ */
+ createEdgeDataProviderDouble(data:number[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of an int array defined for edges.
+ * The int value data[edge.index()] will be returned
+ * by the data provider upon the method call getInt(edge).
+ * @param {number[]} data array data for each edge of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given array
+ */
+ createEdgeDataProviderInt(data:number[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of a boolean array defined for edges.
+ * The boolean value data[edge.index()] will be returned
+ * by the data provider upon the method call getBool(edge).
+ * @param {boolean[]} data array data for each edge of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given array
+ */
+ createEdgeDataProviderBoolean(data:boolean[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of an Object array defined for edges.
+ * The Object value data[edge.index()] will be returned
+ * by the data provider upon the method call get(edge).
+ * @param {Object[]} data array data for each edge of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given array
+ */
+ createEdgeDataProvider(data:Object[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of a double, int, boolean and Object
+ * array defined for edges.
+ * The double value doubleData[edge.index()] will be returned
+ * by the data provider upon the method call getDouble(edge).
+ * The int value intData[edge.index()] will be returned
+ * by the data provider upon the method call getInt(edge).
+ * The boolean value boolData[edge.index()] will be returned
+ * by the data provider upon the method call getBool(edge).
+ * The Object value objectData[edge.index()] will be returned
+ * by the data provider upon the method call get(edge).
+ * @param {number[]} doubleData double data for each edge of a static graph
+ * @param {number[]} intData int data for each edge of a static graph
+ * @param {boolean[]} boolData boolean data for each edge of a static graph
+ * @param {Object[]} objectData Object data for each edge of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given arrays
+ */
+ createEdgeDataProviderForArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:Object[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of a double array defined for nodes.
+ * The double value data[node.index()] will be returned
+ * by the data provider upon the method call getDouble(node).
+ * @param {number[]} data array data for each node of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given array
+ */
+ createNodeDataProviderDouble(data:number[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of an int array defined for nodes.
+ * The int value data[node.index()] will be returned
+ * by the data provider upon the method call getInt(node).
+ * @param {number[]} data array data for each node of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given array
+ */
+ createNodeDataProviderInt(data:number[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of a boolean array defined for nodes.
+ * The boolean value data[node.index()] will be returned
+ * by the data provider upon the method call getBool(node).
+ * @param {boolean[]} data array data for each node of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given array
+ */
+ createNodeDataProviderBoolean(data:boolean[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of an Object array defined for nodes.
+ * The Object value data[node.index()] will be returned
+ * by the data provider upon the method call get(node).
+ * @param {Object[]} data array data for each node of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given array
+ */
+ createNodeDataProvider(data:Object[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider view of a double, int, boolean and Object
+ * array defined for nodes.
+ * The double value doubleData[node.index()] will be returned
+ * by the data provider upon the method call getDouble(node).
+ * The int value intData[node.index()] will be returned
+ * by the data provider upon the method call getInt(node).
+ * The boolean value boolData[node.index()] will be returned
+ * by the data provider upon the method call getBool(node).
+ * The Object value objectData[node.index()] will be returned
+ * by the data provider upon the method call get(node).
+ * @param {number[]} doubleData double data for each node of a static graph
+ * @param {number[]} intData int data for each node of a static graph
+ * @param {boolean[]} boolData boolean data for each node of a static graph
+ * @param {Object[]} objectData Object data for each node of a static graph
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of the given arrays
+ */
+ createNodeDataProviderWithArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:Object[]):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider that returns the given value for each
+ * key.
+ * @param {Object} data constant Object data returned by the created data provider.
+ * @return {yfiles.algorithms.IDataProvider} a data provider view of a single value.
+ */
+ createConstantDataProvider(data:Object):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider for edges that return the data provider values
+ * bound to their source nodes.
+ */
+ createSourceDataProvider(nodeData:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider for edges that return the data provider values
+ * bound to their target nodes.
+ */
+ createTargetDataProvider(nodeData:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider;
+ /**
+ * Returns a DataProvider that returns the negated boolean values
+ * provided by another data provider.
+ */
+ createNegatedDataProvider(data:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider;
+ DataProviderOverlayManager:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a data provider overlay for the given graph instance.
+ */
+ new (graph:yfiles.algorithms.Graph):yfiles.algorithms.DataProviders;
+ };
+ };
+ /**
+ * An abstract adapter class for accepting data.
+ * The data accepting methods
+ * in this class throw a {@link yfiles.system.NotSupportedException} and
+ * {@link yfiles.algorithms.DataAcceptorAdapter#defined} always returns false.
+ *
+ * This class exists as a convenience for creating data acceptor objects.
+ *
+ * Extend this class to access either typed or untyped data for a
+ * certain lookup domain.
+ *
+ */
+ export interface DataAcceptorAdapter extends Object,yfiles.algorithms.IDataAcceptor{
+ /**
+ * Subclasses may override this
+ * method to set object values associated with a data holder.
+ * @throws {yfiles.system.NotSupportedException} unless overwritten.
+ * @see Specified by {@link yfiles.algorithms.IDataAcceptor#set}.
+ */
+ set(dataHolder:Object,value:Object):void;
+ /**
+ * Subclasses may override this
+ * method to set integer values associated with a data holder.
+ * @throws {yfiles.system.NotSupportedException} unless overwritten.
+ * @see Specified by {@link yfiles.algorithms.IDataAcceptor#setInt}.
+ */
+ setInt(dataHolder:Object,value:number):void;
+ /**
+ * Subclasses may override this
+ * method to set double values associated with a data holder.
+ * @throws {yfiles.system.NotSupportedException} unless overwritten.
+ * @see Specified by {@link yfiles.algorithms.IDataAcceptor#setDouble}.
+ */
+ setDouble(dataHolder:Object,value:number):void;
+ /**
+ * Subclasses may override this
+ * method to set boolean values associated with a data holder.
+ * @throws {yfiles.system.NotSupportedException} unless overwritten.
+ * @see Specified by {@link yfiles.algorithms.IDataAcceptor#setBool}.
+ */
+ setBool(dataHolder:Object,value:boolean):void;
+ /**
+ * Returns false for all data holders.
+ * Subclasses
+ * should override this method to make clear for which data holders
+ * there is a value accessible via this data provider.
+ * @return {boolean} false.
+ */
+ defined(dataHolder:Object):boolean;
+ }
+ var DataAcceptorAdapter:{
+ $class:yfiles.lang.Class;
+ };
+ /**
+ * This class provides access to some Comparator instances
+ * that are commonly used in yFiles.
+ */
+ export interface Comparators extends Object{
+ }
+ export module Comparators{
+ /**
+ * Tag interface to mark comparator or comparable implementations that do not
+ * define a total order but only a partial order. Implementations tagged with this
+ * interface use a special sorting algorithm that does not throw IllegalArgumentException
+ * if the specified comparator used for sorting does not define a total order.
+ * @see {@link yfiles.algorithms.Comparators#sort}
+ * @see {@link yfiles.algorithms.Comparators#sortListWithComparer}
+ * @see {@link yfiles.algorithms.Comparators#sortArrayPartWithComparer}
+ */
+ export interface IPartialOrder extends Object{
+ }
+ }
+ var Comparators:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns a comparator that compares objects of type
+ * {@link yfiles.algorithms.Edge}.
+ * Two edges are compared by comparing their
+ * source nodes. Each source node e.source() in turn
+ * is compared by the int value provided by the given data provider:
+ * dp.getInt(e.source()).
+ * @param {yfiles.algorithms.IDataProvider} dp
+ * a data provider that must return an int value for
+ * the source node of each edge being compared.
+ * @return {yfiles.objectcollections.IComparer} a comparator that compares edges.
+ */
+ createIntDataSourceComparator(dp:yfiles.algorithms.IDataProvider):yfiles.objectcollections.IComparer;
+ /**
+ * Returns a comparator that compares objects of type
+ * {@link yfiles.algorithms.Edge}.
+ * Two edges are compared by comparing their
+ * target nodes. Each target node e.target() in turn
+ * is compared by the int value provided by the given data provider:
+ * dp.getInt(e.target()).
+ * @param {yfiles.algorithms.IDataProvider} dp
+ * a data provider that must return an int value for
+ * the target node of each edge being compared.
+ * @return {yfiles.objectcollections.IComparer} a comparator that compares edges.
+ */
+ createIntDataTargetComparator(dp:yfiles.algorithms.IDataProvider):yfiles.objectcollections.IComparer;
+ /**
+ * Returns a comparator that compares objects of type
+ * {@link yfiles.algorithms.Edge}.
+ * Two edges are compared by comparing their
+ * source nodes. Each source node e.source() in turn
+ * is compared by the double value provided by the given data provider:
+ * dp.getDouble(e.source()).
+ * @param {yfiles.algorithms.IDataProvider} dp
+ * a data provider that must return a double value for
+ * the source node of each edge being compared.
+ * @return {yfiles.objectcollections.IComparer} a comparator that compares edges.
+ */
+ createDoubleDataSourceComparator(dp:yfiles.algorithms.IDataProvider):yfiles.objectcollections.IComparer;
+ /**
+ * Returns a comparator that compares objects of type
+ * {@link yfiles.algorithms.Edge}.
+ * Two edges are compared by comparing their
+ * target nodes. Each target node e.target() in turn
+ * is compared by the double value provided by the given data provider:
+ * dp.getDouble(e.target()).
+ * @param {yfiles.algorithms.IDataProvider} dp
+ * a data provider that must return a double value for
+ * the target node of each edge being compared.
+ * @return {yfiles.objectcollections.IComparer} a comparator that compares edges.
+ */
+ createDoubleDataTargetComparator(dp:yfiles.algorithms.IDataProvider):yfiles.objectcollections.IComparer;
+ /**
+ * Returns a comparator that compares objects of arbitrary type.
+ * Two objects are compared by comparing the int value the given
+ * data provider returns for each of these objects.
+ * @param {yfiles.algorithms.IDataProvider} dp
+ * a data provider that must return an int value for
+ * each object that is being compared by this comparator.
+ * @return {yfiles.objectcollections.IComparer} a comparator that compares arbitrary objects.
+ */
+ createIntDataComparator(dp:yfiles.algorithms.IDataProvider):yfiles.objectcollections.IComparer;
+ /**
+ * Returns a comparator that compares objects of arbitrary type.
+ * Two objects are compared by comparing the double value the given
+ * data provider returns for each of these objects.
+ * @param {yfiles.algorithms.IDataProvider} dp
+ * a data provider that must return a double value for
+ * each object that is being compared by this comparator.
+ * @return {yfiles.objectcollections.IComparer} a comparator that compares arbitrary objects.
+ */
+ createDoubleDataComparator(dp:yfiles.algorithms.IDataProvider):yfiles.objectcollections.IComparer;
+ /**
+ * Returns a comparator that compares to Objects of type
+ * Comparable.
+ */
+ createComparableComparator():yfiles.objectcollections.IComparer;
+ /**
+ * Returns a comparator that compares objects of arbitrary type.
+ * Two objects are compared by comparing the Comparable instances
+ * the given data provider returns for each of these objects.
+ * @param {yfiles.algorithms.IDataProvider} dp
+ * a data provider that must return a Comparable for
+ * each object that is being compared by this comparator.
+ * @return {yfiles.objectcollections.IComparer} a comparator that compares arbitrary objects.
+ */
+ createComparableDataComparator(dp:yfiles.algorithms.IDataProvider):yfiles.objectcollections.IComparer;
+ /**
+ * Compares the specified integral numbers.
+ * Returns a negative integer, zero, or a positive integer as the first
+ * argument is less than, equal to, or greater than the second.
+ * @param {number} i1 the first number to compare.
+ * @param {number} i2 the second number to compare.
+ * @return {number}
+ * a negative integer, zero, or a positive integer as the first
+ * argument is less than, equal to, or greater than the second.
+ * @see {@link yfiles.objectcollections.IComparer#compare}
+ */
+ compareInts(i1:number,i2:number):number;
+ /**
+ * Compares the specified integral numbers.
+ * Returns a negative integer, zero, or a positive integer as the first
+ * argument is less than, equal to, or greater than the second.
+ * @param {number} l1 the first number to compare.
+ * @param {number} l2 the second number to compare.
+ * @return {number}
+ * a negative integer, zero, or a positive integer as the first
+ * argument is less than, equal to, or greater than the second.
+ * @see {@link yfiles.objectcollections.IComparer#compare}
+ */
+ compareLongs(l1:number,l2:number):number;
+ /**
+ * Compares the specified floating point numbers.
+ * Returns a negative integer, zero, or a positive integer as the first
+ * argument is less than, equal to, or greater than the second.
+ *
+ * Warning: This method does not handle NaN!
+ * If you need NaN-safe comparison, use
+ * {@link yfiles.system.PrimitiveExtensions#compareNumbers} instead.
+ *
+ * @param {number} f1 the first number to compare.
+ * @param {number} f2 the second number to compare.
+ * @return {number}
+ * a negative integer, zero, or a positive integer as the first
+ * argument is less than, equal to, or greater than the second.
+ * @see {@link yfiles.objectcollections.IComparer#compare}
+ */
+ compareFloats(f1:number,f2:number):number;
+ /**
+ * Compares the specified floating point numbers.
+ * Returns a negative integer, zero, or a positive integer as the first
+ * argument is less than, equal to, or greater than the second.
+ *
+ * Warning: This method does not handle NaN!
+ * If you need NaN-safe comparison, use
+ * {@link yfiles.system.PrimitiveExtensions#compareNumbers} instead.
+ *
+ * @param {number} d1 the first number to compare.
+ * @param {number} d2 the second number to compare.
+ * @return {number}
+ * a negative integer, zero, or a positive integer as the first
+ * argument is less than, equal to, or greater than the second.
+ * @see {@link yfiles.objectcollections.IComparer#compare}
+ */
+ compareDoubles(d1:number,d2:number):number;
+ /**
+ * Sorts the specified list of objects according to the order induced by
+ * the specified comparator.
+ *
+ * This sort is guaranteed to be stable:
+ * Equal elements will not be reordered as a result of the sort.
+ *
+ * Implementation note:
+ * If the comparator is marked with the
+ * {@link yfiles.algorithms.Comparators.IPartialOrder}
+ * interface,
+ * this implementation does not throw IllegalArgumentException
+ * if the specified comparator used for sorting does not define a total order.
+ *
+ * @param {yfiles.algorithms.IList} data the list to be sorted.
+ * @param {yfiles.objectcollections.IComparer} c
+ * the comparator to determine the order of the list.
+ * A null value indicates that the elements'
+ * {@link yfiles.lang.IObjectComparable natural ordering} should be used.
+ * @see {@link yfiles.algorithms.Comparators.IPartialOrder}
+ */
+ sortListWithComparer(data:yfiles.algorithms.IList,c:yfiles.objectcollections.IComparer):void;
+ /**
+ * Sorts the specified array of objects according to the order induced by
+ * the specified comparator.
+ *
+ * This sort is guaranteed to be stable:
+ * Equal elements will not be reordered as a result of the sort.
+ *
+ * Implementation note:
+ * If the comparator is marked with the
+ * {@link yfiles.algorithms.Comparators.IPartialOrder}
+ * interface,
+ * this implementation does not throw IllegalArgumentException if the
+ * specified comparator used for sorting does not define a total order.
+ *
+ * @param {Object} data the array to be sorted.
+ * @param {yfiles.objectcollections.IComparer} c
+ * the comparator to determine the order of the array.
+ * A null value indicates that the elements'
+ * {@link yfiles.lang.IObjectComparable natural ordering} should be used.
+ * @see {@link yfiles.algorithms.Comparators.IPartialOrder}
+ */
+ sort(data:Object,c:yfiles.objectcollections.IComparer):void;
+ /**
+ * Sorts the specified array of objects according to the order induced by
+ * the specified comparator.
+ *
+ * This sort is guaranteed to be stable:
+ * Equal elements will not be reordered as a result of the sort.
+ *
+ * Implementation note:
+ * If the comparator is marked with the
+ * {@link yfiles.algorithms.Comparators.IPartialOrder}
+ * interface,
+ * this implementation does not throw IllegalArgumentException
+ * if the specified comparator used for sorting does not define a total order.
+ *
+ * @param {Object} data the array to be sorted.
+ * @param {number} fromIndex the index of the first element (inclusive) to be sorted.
+ * @param {number} toIndex the index of the last element (exclusive) to be sorted.
+ * @param {yfiles.objectcollections.IComparer} c
+ * the comparator to determine the order of the array.
+ * A null value indicates that the elements'
+ * {@link yfiles.lang.IObjectComparable natural ordering} should be used.
+ * @throws {yfiles.system.ArgumentException} if fromIndex > toIndex.
+ * @throws {yfiles.system.IndexOutOfRangeException}
+ * if fromIndex < 0 or
+ * toIndex > a.length.
+ * @see {@link yfiles.algorithms.Comparators.IPartialOrder}
+ */
+ sortArrayPartWithComparer(data:Object,fromIndex:number,toIndex:number,c:yfiles.objectcollections.IComparer):void;
+ };
+ /**
+ * Provides utility methods for working with {@link yfiles.algorithms.ICursor cursors}
+ * and {@link yfiles.algorithms.IIterator iterators}.
+ */
+ export interface Cursors extends Object{
+ }
+ var Cursors:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates or fills an array with the values provided by the cursor.
+ * @param {yfiles.algorithms.ICursor} cursor the cursor
+ * @param {Object[]} dest
+ * the array to fill with the values or null if the
+ * method should create the array itself
+ * @return {Object[]} dest or a newly created array filled with the values from cursor
+ */
+ toArray(cursor:yfiles.algorithms.ICursor,dest:Object[]):Object[];
+ /**
+ * Creates a YCursor view of the given collection.
+ * Note that the returned cursor does not support the
+ * {@link yfiles.algorithms.ICursor#prev prev} and {@link yfiles.algorithms.ICursor#toLast toLast}
+ * operations.
+ * @param {yfiles.algorithms.ICollection} c The collection.
+ * @return {yfiles.algorithms.ICursor} The cursor view of the given collection.
+ * @see {@link yfiles.algorithms.Cursors#createEdgeCursor}
+ * @see {@link yfiles.algorithms.Cursors#createNodeCursor}
+ */
+ createCursorFromCollection(c:yfiles.algorithms.ICollection):yfiles.algorithms.ICursor;
+ /**
+ * Creates a cursor view of the given collection.
+ * Creates an ICursor view of the given collection.
+ * Note that the returned cursor does not support the
+ * {@link yfiles.algorithms.ICursor#prev prev}
+ * and
+ * {@link yfiles.algorithms.ICursor#toLast toLast}
+ * operations.
+ * @param {yfiles.collections.ICollection.} c
+ * The collection.
+ * @return {yfiles.algorithms.ICursor}
+ * The cursor view of the given collection.
+ */
+ createCursor(c:yfiles.collections.ICollection):yfiles.algorithms.ICursor;
+ /**
+ * Creates a cursor view of the given collection.
+ *
+ * Note that the returned cursor does not support the operations
+ * {@link yfiles.algorithms.ICursor#prev prev},
+ * {@link yfiles.algorithms.ICursor#toLast toLast}, and
+ * {@link yfiles.algorithms.IEdgeCursor#cyclicPrev}.
+ *
+ * @param {yfiles.algorithms.ICollection} c The collection.
+ * @return {yfiles.algorithms.IEdgeCursor}
+ * an {@link yfiles.algorithms.IEdgeCursor} view of the given collection.
+ * @see {@link yfiles.algorithms.Cursors#createNodeCursor}
+ */
+ createEdgeCursor(c:yfiles.algorithms.ICollection):yfiles.algorithms.IEdgeCursor;
+ /**
+ * Creates a cursor view of the given collection.
+ *
+ * Note that the returned cursor does not support the operations
+ * {@link yfiles.algorithms.ICursor#prev prev},
+ * {@link yfiles.algorithms.ICursor#toLast toLast}, and
+ * {@link yfiles.algorithms.INodeCursor#cyclicPrev}.
+ *
+ * @param {yfiles.algorithms.ICollection} c The collection.
+ * @return {yfiles.algorithms.INodeCursor}
+ * an {@link yfiles.algorithms.INodeCursor} view of the given collection.
+ * @see {@link yfiles.algorithms.Cursors#createEdgeCursor}
+ */
+ createNodeCursor(c:yfiles.algorithms.ICollection):yfiles.algorithms.INodeCursor;
+ /**
+ * Creates a first-to-last Iterator view of the given cursor.
+ *
+ * Note that the returned iterator does not support the
+ * {@link yfiles.algorithms.IIterator#remove remove} operation.
+ *
+ * @param {yfiles.algorithms.ICursor} cursor The cursor.
+ * @return {yfiles.algorithms.IIterator} The iterator view of the given cursor.
+ */
+ createIterator(cursor:yfiles.algorithms.ICursor):yfiles.algorithms.IIterator;
+ /**
+ * Creates a last-to-first Iterator view of the given cursor.
+ *
+ * Note that the returned iterator does not support the
+ * {@link yfiles.algorithms.IIterator#remove remove} operation.
+ *
+ * @param {yfiles.algorithms.ICursor} cursor The cursor.
+ * @return {yfiles.algorithms.IIterator} The iterator view of the given cursor.
+ */
+ createReverseIterator(cursor:yfiles.algorithms.ICursor):yfiles.algorithms.IIterator;
+ /**
+ * Creates a new cursor that provides a logical view
+ * on the concatenation of the two given cursors.
+ * @param {yfiles.algorithms.ICursor} c1 - first concatenation argument
+ * @param {yfiles.algorithms.ICursor} c2 - second concatenation argument
+ */
+ concatenate(c1:yfiles.algorithms.ICursor,c2:yfiles.algorithms.ICursor):yfiles.algorithms.ICursor;
+ };
+ /**
+ * Provides functionality to hide and unhide partitions of nodes and their adjacent edges of a graph temporarily for algorithmic operations.
+ *
+ * This class can be used to temporarily hide away certain elements
+ * of a graph and to unhide that parts at a later time again.
+ * Instances of this class keep track of graph elements that were
+ * hidden from a graph in order to make them visible again
+ * at a later time.
+ *
+ *
+ * Note that this class should not be used to hide elements from a Graph2D for pure hiding purposes.
+ * Since this class will by default prevent the graph instance from firing events, other code
+ * might cease to work correctly. Use this class for short term removal of nodes and edges, only.
+ *
+ */
+ export interface GraphPartitionManager extends Object{
+ /**
+ * Initializes internal data structures using the new DataProvider.
+ * This method must also be called whenever the content of the given
+ * DataProvider changes.
+ * @param {yfiles.algorithms.IDataProvider} partitionId
+ * the data provider that holds the partitionIds for all
+ * elements.
+ */
+ initPartitions(partitionId:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Hides nodes and adjacent edges that have the given partitionId associated.
+ * @param {Object} partitionId the id
+ */
+ hidePartition(partitionId:Object):void;
+ /**
+ * Unhides nodes that have the given partitionId associated.
+ * @param {Object} partitionId the id
+ */
+ unhidePartition(partitionId:Object):void;
+ /**
+ * Assures that only nodes are visible in the graph that are associated with
+ * the given partitionId.
+ * @param {Object} partitionId the partitionId for the nodes that will be made visible
+ */
+ displayPartition(partitionId:Object):void;
+ /**
+ * Specifies whether or not this partition manager should fire graph events.
+ * By default the partition manager does not fire graph events.
+ */
+ fireGraphEventsEnabled:boolean;
+ /**
+ * Hides all nodes and edges from this graph.
+ * The hidden elements will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideAll():void;
+ /**
+ * Hides all edges from this graph.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideEdges():void;
+ /**
+ * Hides all self-loop edges from this graph.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideSelfLoops():void;
+ /**
+ * Hides all self-loops and multiple edges from the graph.
+ * The overall effect of this method is that the minimum number of
+ * edges are hidden from the graph such that it contains no
+ * self-loops and no multiple edges anymore.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ simplifyGraph():void;
+ /**
+ * Hides multiple edges from the graph.
+ * If there are multiple edges connecting two nodes then
+ * all but one (representative) of these edges will be hidden.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideMultipleEdges():void;
+ /**
+ * Unhides all formerly hidden elements in the graph.
+ */
+ unhideAll():void;
+ /**
+ * Unhides all formerly hidden nodes in the graph.
+ * Note that this
+ * method does not unhide hidden edges.
+ */
+ unhideNodes():void;
+ /**
+ * Unhides all formerly hidden edges in the graph.
+ * Precondition:
+ * Both source or target node of all
+ * such edges must be contained in the graph.
+ */
+ unhideEdges():void;
+ /**
+ * Hides the given node and all it's adjacent edges from the graph.
+ * The hidden elements will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideNode(v:yfiles.algorithms.Node):void;
+ /**
+ * Hides the given edge from the graph.
+ * The hidden edge will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Hides the given list of edges from the graph.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideEdgeList(el:yfiles.algorithms.EdgeList):void;
+ /**
+ * Hides the given list of nodes from the graph.
+ * The hidden nodes and adjacent edges will be stored
+ * so that they can be unhidden
+ * again at a later time.
+ */
+ hideNodeList(nl:yfiles.algorithms.NodeList):void;
+ /**
+ * Hides the given edges from the graph.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideEdgeCursor(ec:yfiles.algorithms.IEdgeCursor):void;
+ /**
+ * Hides the given nodes from the graph.
+ * The hidden nodes and adjacent edges will be stored
+ * so that they can be unhidden
+ * again at a later time.
+ */
+ hideNodeCursor(nc:yfiles.algorithms.INodeCursor):void;
+ /**
+ * Hides the given elements from the graph.
+ * The hidden nodes and adjacent edges will be stored
+ * so that they can be unhidden
+ * again at a later time.
+ */
+ hideItemCursor(cursor:yfiles.algorithms.ICursor):void;
+ /**
+ * The Graph for which this partition manager was
+ * created.
+ */
+ graph:yfiles.algorithms.Graph;
+ /**
+ * This method will be called whenever the partition manager is requested to
+ * unhide the given edge from the graph.
+ */
+ unhideEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * This method will be called whenever the partition manager is requested to
+ * unhide the given node from the graph.
+ */
+ unhideNode(v:yfiles.algorithms.Node):void;
+ }
+ var GraphPartitionManager:{
+ $class:yfiles.lang.Class;
+ /**
+ * Instantiates a new GraphPartitionManager for the given graph.
+ * All non-static hiding and unhiding methods will refer
+ * to the given graph.
+ */
+ new (graph:yfiles.algorithms.Graph,partitionId:yfiles.algorithms.IDataProvider):yfiles.algorithms.GraphPartitionManager;
+ };
+ /**
+ * Provides functionality to hide and unhide nodes and edges of a graph temporarily for algorithmic operations.
+ *
+ * This class can be used to temporarily hide away certain elements
+ * of a graph and to unhide that parts at a later time again.
+ * Instances of this class keep track of graph elements that were
+ * hidden from a graph in order to make them visible again
+ * at a later time.
+ *
+ *
+ * Note that this class should not be used to hide elements from a Graph2D for pure hiding purposes.
+ * Since this class will by default prevent the graph instance from firing events, other code
+ * might cease to work correctly. Use this class for short term removal of nodes and edges, only.
+ *
+ */
+ export interface GraphHider extends Object{
+ /**
+ * holds the list of the hidden edges in stack order.
+ */
+ hiddenEdgesF:yfiles.algorithms.EdgeList;
+ /**
+ * holds the list of the hidden nodes in stack order.
+ */
+ hiddenNodesF:yfiles.algorithms.NodeList;
+ /**
+ * Specifies whether or not this hider should fire graph events.
+ * By default the hider does not fire graph events.
+ */
+ fireGraphEvents:boolean;
+ /**
+ * Hides all nodes and edges from this graph.
+ * The hidden elements will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideAll():void;
+ /**
+ * Hides all edges from this graph.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideEdges():void;
+ /**
+ * Hides all self-loop edges from this graph.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideSelfLoops():void;
+ /**
+ * Hides all self-loops and multiple edges from the graph.
+ * The overall effect of this method is that the minimum number of
+ * edges are hidden from the graph such that it contains no
+ * self-loops and no multiple edges anymore.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ simplifyGraph():void;
+ /**
+ * Hides multiple edges from the graph.
+ * If there are multiple edges connecting two nodes then
+ * all but one (representative) of these edges will be hidden.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideMultipleEdges():void;
+ /**
+ * Unhides all formerly hidden elements in the graph.
+ */
+ unhideAll():void;
+ /**
+ * Unhides all formerly hidden nodes in the graph.
+ * Note that this
+ * method does not unhide hidden edges.
+ */
+ unhideNodes():void;
+ /**
+ * Unhides all formerly hidden edges in the graph.
+ * Precondition:
+ * Both source or target node of all
+ * such edges must be contained in the graph.
+ */
+ unhideEdges():void;
+ /**
+ * Hides the given node and all it's adjacent edges from the graph.
+ * The hidden elements will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideNode(v:yfiles.algorithms.Node):void;
+ /**
+ * Hides the given edge from the graph.
+ * The hidden edge will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hide(e:yfiles.algorithms.Edge):void;
+ /**
+ * Hides the given list of edges from the graph.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideEdgeList(el:yfiles.algorithms.EdgeList):void;
+ /**
+ * Hides the given list of nodes from the graph.
+ * The hidden nodes and adjacent edges will be stored
+ * so that they can be unhidden
+ * again at a later time.
+ */
+ hideNodeList(nl:yfiles.algorithms.NodeList):void;
+ /**
+ * Hides the given edges from the graph.
+ * The hidden edges will be stored so that they can be unhidden
+ * again at a later time.
+ */
+ hideEdgeCursor(ec:yfiles.algorithms.IEdgeCursor):void;
+ /**
+ * Hides the given nodes from the graph.
+ * The hidden nodes and adjacent edges will be stored
+ * so that they can be unhidden
+ * again at a later time.
+ */
+ hideNodeCursor(nc:yfiles.algorithms.INodeCursor):void;
+ /**
+ * Hides the given elements from the graph.
+ * The hidden nodes and adjacent edges will be stored
+ * so that they can be unhidden
+ * again at a later time.
+ */
+ hideItemCursor(cursor:yfiles.algorithms.ICursor):void;
+ /**
+ * The Graph for which this GraphHider was
+ * created.
+ */
+ graph:yfiles.algorithms.Graph;
+ /**
+ * This method will be called whenever
+ * the hider is requested to unhide the given edge
+ * from the graph.
+ */
+ unhideOneEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Unhides the given edge.
+ * Also updates {@link yfiles.algorithms.GraphHider#hiddenEdgesF}.
+ * Complexity: O(hiddenEdges.size())
+ * @param {yfiles.algorithms.Edge} e the edge that will be unhidden
+ */
+ unhideEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Unhides the given edges.
+ * Also updates {@link yfiles.algorithms.GraphHider#hiddenEdgesF}.
+ * Complexity: O(hiddenEdges.size())
+ * @param {yfiles.algorithms.EdgeList} edges the edges that will be unhidden
+ */
+ unhideEdgeList(edges:yfiles.algorithms.EdgeList):void;
+ /**
+ * Unhides the given nodes and if requested its adjacent edges.
+ * Also updates {@link yfiles.algorithms.GraphHider#hiddenNodesF} and {@link yfiles.algorithms.GraphHider#hiddenEdgesF}.
+ * Complexity: O(hiddenNodes.size()+hiddenEdges.size())
+ * @param {yfiles.algorithms.NodeList} nodes the nodes that will be unhidden
+ * @param {boolean} unhideAdjacentEdges
+ * whether of not to unhide previously hidden edges connected at the given nodes whose other end point
+ * is not hidden, i.e. it is part of the graph.
+ */
+ unhideNodeList(nodes:yfiles.algorithms.NodeList,unhideAdjacentEdges:boolean):void;
+ /**
+ * Unhides the given node and if requested its adjacent edges.
+ * Also updates {@link yfiles.algorithms.GraphHider#hiddenNodesF} and {@link yfiles.algorithms.GraphHider#hiddenEdgesF}.
+ * Complexity: O(hiddenNodes.size()+hiddenEdges.size())
+ * @param {yfiles.algorithms.Node} v the node that will be unhidden
+ * @param {boolean} unhideAdjacentEdges
+ * whether of not to unhide previously hidden edges connected at v whose other end point
+ * is not hidden, i.e. it is part of the graph.
+ */
+ unhideNode(v:yfiles.algorithms.Node,unhideAdjacentEdges:boolean):void;
+ /**
+ * This method will be called whenever
+ * the hider is requested to unhide the given node
+ * from the graph.
+ */
+ unhideOneNode(v:yfiles.algorithms.Node):void;
+ /**
+ * The nodes that are currently hidden.
+ * @return {yfiles.algorithms.INodeCursor} a NodeList containing the currently hidden nodes
+ */
+ hiddenNodes():yfiles.algorithms.INodeCursor;
+ /**
+ * The edges that are currently hidden.
+ * @return {yfiles.algorithms.IEdgeCursor} an EdgeList containing the currently hidden edges
+ */
+ hiddenEdges():yfiles.algorithms.IEdgeCursor;
+ }
+ var GraphHider:{
+ $class:yfiles.lang.Class;
+ /**
+ * Instantiates a new GraphHider for the given graph.
+ * All non-static hiding and unhiding methods will refer
+ * to the given graph.
+ */
+ new (g:yfiles.algorithms.Graph):yfiles.algorithms.GraphHider;
+ /**
+ * Unhides the subgraph induced by the given edges in the given graph.
+ * The induced subgraph defined by the given edges consists
+ * of the given edges and all nodes that are either source
+ * or target of at least one of the given edges.
+ * Parts of the subgraph that are already contained in the given
+ * graph will not be unhidden and pose no problem to this method.
+ */
+ unhideSubgraph(graph:yfiles.algorithms.Graph,ec:yfiles.algorithms.IEdgeCursor):void;
+ /**
+ * Hides the subgraph induced by the given edges from the given graph.
+ * The induced subgraph defined by the given edges consists
+ * of the given edges and all nodes that are solely connected
+ * to the rest of the graph by the given edges.
+ */
+ hideSubgraph(graph:yfiles.algorithms.Graph,ec:yfiles.algorithms.IEdgeCursor):void;
+ };
+ /**
+ * This class implements a priority queue for objects whose priority
+ * values are of type double.
+ * The implementation is based on binary heaps.
+ */
+ export interface DoubleObjectPQ extends Object{
+ /**
+ * Adds the given object with given priority to this queue.
+ * Precondition: !contains(o)
+ * Complexity: O(log(size()))
+ */
+ add(o:Object,priority:number):void;
+ /**
+ * Decreases the priority value of the given object.
+ * Precondition: contains(o)
+ * Precondition: priority < getPriority(o)
+ * Complexity: O(log(size()))
+ */
+ decreasePriority(o:Object,priority:number):void;
+ /**
+ * Increases the priority value of the given object.
+ * Precondition: contains(o)
+ * Precondition: priority > getPriority(o)
+ * Complexity: O(log(size()))
+ */
+ increasePriority(o:Object,priority:number):void;
+ /**
+ * Changes the priority value of the given object.
+ * Precondition: contains(o)
+ * Complexity: O(log(size()))
+ */
+ changePriority(o:Object,priority:number):void;
+ /**
+ * Removes the object with smallest priority from this queue.
+ * Precondition: !isEmpty()
+ * Complexity: O(log(size()))
+ * @return {Object} the removed object with smallest priority
+ */
+ removeMin():Object;
+ /**
+ * The object with smallest priority in this queue.
+ * Precondition: !isEmpty()
+ */
+ min:Object;
+ /**
+ * The minimum priority value in this queue.
+ */
+ minPriority:number;
+ /**
+ * Returns whether or not the given object is contained.
+ * in this queue.
+ * Complexity: O(1)
+ */
+ contains(o:Object):boolean;
+ /**
+ * Specifies whether or not this queue is empty.
+ * Complexity: O(1)
+ */
+ empty:boolean;
+ /**
+ * Returns the number of nodes currently in this queue.
+ * Complexity: O(1)
+ */
+ size():number;
+ /**
+ * Returns the current priority of the given object.
+ * Precondition: contains(o)
+ */
+ getPriority(o:Object):number;
+ /**
+ * Removes the given object from this queue.
+ * Precondition: contains(o)
+ * Complexity: O(log(size()))
+ */
+ remove(o:Object):void;
+ /**
+ * Makes this queue the empty queue.
+ * Complexity: O(size())
+ */
+ clear():void;
+ /**
+ * Does nothing.
+ */
+ dispose():void;
+ }
+ var DoubleObjectPQ:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates an empty ObjectPQ using the given {@link yfiles.algorithms.IDataProvider} and
+ * {@link yfiles.algorithms.IDataAcceptor} to store and retrieve Object support information.
+ * The contents of the provider should be modified through the use of the
+ * acceptor, i.e. they should be based on the same initially empty backing store.
+ * Additionally this backing store should not be modified externally as long as
+ * this PQ is still in use.
+ */
+ new (initialSize:number,provider:yfiles.algorithms.IDataProvider,acceptor:yfiles.algorithms.IDataAcceptor):yfiles.algorithms.DoubleObjectPQ;
+ };
+ /**
+ * This class is an empty abstract implementation of the EdgeMap interface.
+ */
+ export interface EdgeMapAdapter extends Object,yfiles.algorithms.IEdgeMap{
+ /**
+ * Associates the given value to with the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#set}.
+ */
+ set(edge:Object,value:Object):void;
+ /**
+ * Returns the value bound to the given edge.
+ * @return {Object} null
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#get}.
+ */
+ get(edge:Object):Object;
+ /**
+ * Associates the given boolean value to with the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#setBool}.
+ */
+ setBool(edge:Object,value:boolean):void;
+ /**
+ * Returns the boolean value bound to the given edge.
+ * Precondition:
+ * The value must have been associated to the given edge by
+ * a call to setBool.
+ * @return {boolean} false
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#getBool}.
+ */
+ getBool(edge:Object):boolean;
+ /**
+ * Associates the given double value to with the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#setDouble}.
+ */
+ setDouble(edge:Object,value:number):void;
+ /**
+ * Returns the double value bound to the given edge.
+ * Precondition:
+ * The value must have been associated to the given edge by
+ * a call to setDouble.
+ * @return {number} 0.0d
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#getDouble}.
+ */
+ getDouble(edge:Object):number;
+ /**
+ * Associates the given integer value to with the given edge.
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#setInt}.
+ */
+ setInt(edge:Object,value:number):void;
+ /**
+ * Returns the integer value bound to the given edge.
+ * Precondition:
+ * The value must have been associated to the given edge by
+ * a call to setInt.
+ * @return {number} 0
+ * @see Specified by {@link yfiles.algorithms.IEdgeMap#getInt}.
+ */
+ getInt(edge:Object):number;
+ }
+ var EdgeMapAdapter:{
+ $class:yfiles.lang.Class;
+ };
+ /**
+ * A utility class that can be used to copy a graph's structure and possibly associated data to another instance.
+ * This
+ * class relies on implementations of {@link yfiles.algorithms.GraphCopier.ICopyFactory} that can either be any of the default
+ * implementations or any other implementation that can be associated with a {@link yfiles.algorithms.Graph}'s {@link yfiles.algorithms.Graph#graphCopyFactory copy factory property}.
+ * @see {@link yfiles.algorithms.GraphCopier.ICopyFactory}
+ * @see {@link yfiles.algorithms.GraphCopier#copy}
+ */
+ export interface GraphCopier extends Object{
+ /**
+ * Determines whether automatic copying of node map contents is enabled.
+ * The default is false. Copying
+ * will be done by reference on Object basis. To store these objects, new {@link yfiles.algorithms.INodeMap}s are created for the target
+ * graph.
+ * In order to access these NodeMaps it is necessary to store the number of NodeMaps in
+ * the target graph before creating the NodeMaps as they will be appended. After copying the graph a
+ * NodeMap can be found using this number as offset and add the index of the map in the original graph.
+ * Note: To be able to control and access NodeMaps more easily, it is recommended to use
+ * {@link yfiles.algorithms.IDataProvider}s instead and have them copied.
+ * @see {@link yfiles.algorithms.GraphCopier.NodeMapCopyFactory}
+ * @see {@link yfiles.algorithms.Graph#registeredNodeMaps}
+ * @see {@link yfiles.algorithms.GraphCopier#dataProviderContentCopying}
+ */
+ nodeMapCopying:boolean;
+ /**
+ * Determines whether automatic copying of edge map contents is enabled.
+ * The default is false. Copying
+ * will be done by reference on Object basis. To store these objects, new {@link yfiles.algorithms.IEdgeMap}s are created for the target
+ * graph.
+ * In order to access these EdgeMaps it is necessary to store the number of NodeMaps in
+ * the target graph before creating the EdgeMaps as they will be appended. After copying the graph a
+ * EdgeMap can be found using this number as offset and add the index of the map in the original graph.
+ * Note: To be able to control and access EdgeMaps more easily, it is recommended to use
+ * {@link yfiles.algorithms.IDataProvider}s instead and have them copied.
+ * @see {@link yfiles.algorithms.GraphCopier.EdgeMapCopyFactory}
+ * @see {@link yfiles.algorithms.Graph#registeredEdgeMaps}
+ * @see {@link yfiles.algorithms.GraphCopier#dataProviderContentCopying}
+ */
+ edgeMapCopying:boolean;
+ /**
+ * Determines whether automatic copying of edge map contents should be performed.
+ * The default is false.
+ * Copying will be done by reference on Object basis. The backing store for the content will be HashMap based.
+ * @see {@link yfiles.algorithms.GraphCopier.ItemDataProviderCopyFactory}
+ */
+ dataProviderContentCopying:boolean;
+ /**
+ * Copies the contents of the source graph to the target graph and returns the newly created nodes in the target
+ * graph.
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph to copy the contents from
+ * @param {yfiles.algorithms.Graph} targetGraph the target graph to copy the contents to, it will not be cleared prior to the copying
+ * @return {yfiles.algorithms.NodeList} the list of Nodes that have been copied to the target graph.
+ * @see {@link yfiles.algorithms.GraphCopier#copySubgraphNodes}
+ */
+ copyFromSourceToTargetGraph(sourceGraph:yfiles.algorithms.Graph,targetGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList;
+ /**
+ * Copies the contents of the source graph to a newly created target graph and returns the new graph.
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph to copy the contents from
+ * @return {yfiles.algorithms.Graph} the newly created graph
+ * @see {@link yfiles.algorithms.GraphCopier.ICopyFactory#createGraph}
+ */
+ copy(sourceGraph:yfiles.algorithms.Graph):yfiles.algorithms.Graph;
+ /**
+ * Copies the subgraph contained in graph induced by the source nodes to a newly created graph.
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph to copy
+ * @param {yfiles.algorithms.INodeCursor} sourceNodes the nodes in the sourceGraph to copy to the new graph
+ * @return {yfiles.algorithms.Graph} the newly created graph
+ * @see {@link yfiles.algorithms.GraphCopier.ICopyFactory#createGraph}
+ */
+ copyWithSourceGraphAndSourceNodes(sourceGraph:yfiles.algorithms.Graph,sourceNodes:yfiles.algorithms.INodeCursor):yfiles.algorithms.Graph;
+ /**
+ * The currently used copy factory.
+ */
+ copyFactory:yfiles.algorithms.GraphCopier.ICopyFactory;
+ /**
+ * Callback that uses the given factory to create a new graph.
+ * This method simply delegates to {@link yfiles.algorithms.GraphCopier.ICopyFactory#createGraph} and can be overwritten to change the behavior.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} factory the factory to use for the creation
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph that will be
+ * @return {yfiles.algorithms.Graph} the newly created graph
+ */
+ createGraph(factory:yfiles.algorithms.GraphCopier.ICopyFactory,sourceGraph:yfiles.algorithms.Graph):yfiles.algorithms.Graph;
+ /**
+ * Copies the subgraph contained in sourceGraph induced by the source nodes to the targetGraph.
+ * targetGraph is not
+ * cleared prior to the copy operation.
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph to copy
+ * @param {yfiles.algorithms.INodeCursor} sourceNodes the nodes in the sourceGraph to copy to the new graph
+ * @param {yfiles.algorithms.Graph} targetGraph the graph to copy the sourceGraph's contents to
+ * @return {yfiles.algorithms.NodeList} the list of the new nodes in targetGraph
+ */
+ copySubgraphNodes(sourceGraph:yfiles.algorithms.Graph,sourceNodes:yfiles.algorithms.INodeCursor,targetGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList;
+ /**
+ * Copies the subgraph contained in sourceGraph induced by the source nodes and the provided source edges to the targetGraph.
+ * targetGraph is not cleared prior to the copy operation.
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph to copy
+ * @param {yfiles.algorithms.INodeCursor} sourceNodes the nodes in the sourceGraph to copy to the new graph
+ * @param {yfiles.algorithms.Graph} targetGraph the graph to copy the sourceGraph's contents to
+ * @param {yfiles.algorithms.IEdgeCursor} sourceEdges the edges in the sourceGraph to copy to the new graph
+ * @return {yfiles.algorithms.NodeList} the list of the new nodes in targetGraph
+ */
+ copySubgraph(sourceGraph:yfiles.algorithms.Graph,sourceNodes:yfiles.algorithms.INodeCursor,sourceEdges:yfiles.algorithms.IEdgeCursor,targetGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList;
+ /**
+ * Callback that uses the given factory to perform the copy operation.
+ * This method simply delegates to {@link yfiles.algorithms.GraphCopier.ICopyFactory#preCopyGraphData} and can be overwritten to change
+ * the behavior.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} copyFactory the factory delegate the operation to
+ */
+ preCopyGraphData(copyFactory:yfiles.algorithms.GraphCopier.ICopyFactory,sourceGraph:yfiles.algorithms.Graph,targetGraph:yfiles.algorithms.Graph):void;
+ /**
+ * Callback that uses the given factory to perform the copy operation.
+ * This method simply delegates to {@link yfiles.algorithms.GraphCopier.ICopyFactory#postCopyGraphData} and can
+ * be overwritten to change the behavior.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} copyFactory the factory delegate the operation to
+ */
+ postCopyGraphData(copyFactory:yfiles.algorithms.GraphCopier.ICopyFactory,sourceGraph:yfiles.algorithms.Graph,targetGraph:yfiles.algorithms.Graph,nodeMap:yfiles.algorithms.IMap,edgeMap:yfiles.algorithms.IMap):void;
+ /**
+ * Callback that creates the Map that will hold the mapping from the edges in the old source graph to the newly
+ * created edges in the target graph.
+ * @return {yfiles.algorithms.IMap} A map that can be used to store the mapping.
+ */
+ createEdgeMap():yfiles.algorithms.IMap;
+ /**
+ * Callback that uses the given factory to perform the copy operation.
+ * This method simply delegates to {@link yfiles.algorithms.GraphCopier.ICopyFactory#copyEdge} and can be
+ * overwritten to change the behavior.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} copyFactory the factory delegate the operation to
+ */
+ copyEdge(copyFactory:yfiles.algorithms.GraphCopier.ICopyFactory,targetGraph:yfiles.algorithms.Graph,newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):yfiles.algorithms.Edge;
+ /**
+ * Determines the set of edge candidates from the source graph that should be copied.
+ * Note that if any of the source
+ * or target node is not present in the target graph the edge will not be copied. This implementation simply returns
+ * {@link yfiles.algorithms.Graph#getEdgeCursor}
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph to determine the edges to copy
+ * @return {yfiles.algorithms.IEdgeCursor} the edges to copy
+ */
+ getSourceEdges(sourceGraph:yfiles.algorithms.Graph):yfiles.algorithms.IEdgeCursor;
+ /**
+ * Callback that uses the given factory to perform the copy operation.
+ * This method simply delegates to {@link yfiles.algorithms.GraphCopier.ICopyFactory#copyNode}
+ * and can be overwritten to change the behavior.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} copyFactory the factory delegate the operation to
+ */
+ copyNode(copyFactory:yfiles.algorithms.GraphCopier.ICopyFactory,targetGraph:yfiles.algorithms.Graph,node:yfiles.algorithms.Node):yfiles.algorithms.Node;
+ /**
+ * Callback that creates the Map that will hold the mapping from the nodes in the old source graph to the newly
+ * created nodes in the target graph.
+ * @return {yfiles.algorithms.IMap} A map that can be used to store the mapping.
+ */
+ createNodeMap():yfiles.algorithms.IMap;
+ /**
+ * Determines the set of node candidates from the source graph that should be copied if
+ * no other nodes are specified by the user.
+ * This implementation simply returns
+ * {@link yfiles.algorithms.Graph#getNodeCursor}
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph to determine the nodes to copy
+ * @return {yfiles.algorithms.INodeCursor} the nodes to copy
+ */
+ getSourceNodes(sourceGraph:yfiles.algorithms.Graph):yfiles.algorithms.INodeCursor;
+ }
+ export module GraphCopier{
+ /**
+ * An abstract base implementation of a delegating CopyFactory that copies data for items being copied.
+ * The actual
+ * copying will be performed by the wrapped delegate. Instances of this class should be used to wrap existing copy
+ * factories. Subclasses should override any or all of the {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#copyNodeData}, {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#copyEdgeData}, {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#preCopyData}, and {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#postCopyData} methods.
+ */
+ export interface GraphDataCopyFactory extends Object,yfiles.algorithms.GraphCopier.ICopyFactory{
+ /**
+ * Calls {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#preCopyData} and then the delegate.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#preCopyGraphData}.
+ */
+ preCopyGraphData(srcGraph:yfiles.algorithms.Graph,newGraph:yfiles.algorithms.Graph):void;
+ /**
+ * Calls the delegate and then {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#postCopyData}.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#postCopyGraphData}.
+ */
+ postCopyGraphData(srcGraph:yfiles.algorithms.Graph,newGraph:yfiles.algorithms.Graph,nodeMap:yfiles.algorithms.IMap,edgeMap:yfiles.algorithms.IMap):void;
+ /**
+ * Delegates the copying of the data to {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#copyNodeData}.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#copyNode}.
+ */
+ copyNode(graph:yfiles.algorithms.Graph,hint:yfiles.algorithms.Node):yfiles.algorithms.Node;
+ /**
+ * Creates a new graph instance that will be the target graph of the copy operation.
+ * This method is called if no target graph is specified by the user.
+ * @return {yfiles.algorithms.Graph} the graph to use as the target graph
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#createGraph}.
+ */
+ createGraph():yfiles.algorithms.Graph;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ */
+ preCopyData(src:yfiles.algorithms.Graph,dst:yfiles.algorithms.Graph):void;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.IMap} nodeMap a Map that maps old node instances to their new copies
+ * @param {yfiles.algorithms.IMap} edgeMap a Map that maps old edge instances to their new copies
+ */
+ postCopyData(src:yfiles.algorithms.Graph,dst:yfiles.algorithms.Graph,nodeMap:yfiles.algorithms.IMap,edgeMap:yfiles.algorithms.IMap):void;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.Node} src the old entity
+ * @param {yfiles.algorithms.Node} dst the new entity
+ */
+ copyNodeData(src:yfiles.algorithms.Node,dst:yfiles.algorithms.Node):void;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.Edge} src the old entity
+ * @param {yfiles.algorithms.Edge} dst the new entity
+ */
+ copyEdgeData(src:yfiles.algorithms.Edge,dst:yfiles.algorithms.Edge):void;
+ /**
+ * Delegates the copying of the data to {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#copyEdgeData}.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#copyEdge}.
+ */
+ copyEdge(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,hint:yfiles.algorithms.Edge):yfiles.algorithms.Edge;
+ }
+ /**
+ * Abstract helper class that provides helper methods to copy DataProvider contents.
+ */
+ export interface DataProviderCopyFactory extends yfiles.algorithms.GraphCopier.GraphDataCopyFactory{
+ /**
+ * The DataProvider key.
+ */
+ dpKey:Object;
+ /**
+ * Calls {@link yfiles.algorithms.GraphCopier.DataProviderCopyFactory#createMap} and registers that map on the target graph if there is no {@link yfiles.algorithms.IDataMap} registered on the target graph yet.
+ * @see Overrides {@link yfiles.algorithms.GraphCopier.GraphDataCopyFactory#preCopyData}
+ */
+ preCopyData(src:yfiles.algorithms.Graph,dst:yfiles.algorithms.Graph):void;
+ /**
+ * Factory callback to create the backing storage.
+ */
+ createMap(dst:yfiles.algorithms.Graph):yfiles.algorithms.IDataMap;
+ /**
+ * Helper method that retrieves the map for the given graph instance.
+ * @param {yfiles.algorithms.Graph} graph Graph instance for which the map is retrieved
+ * @return {yfiles.algorithms.IDataMap} the map for the given graph instance
+ */
+ getMap(graph:yfiles.algorithms.Graph):yfiles.algorithms.IDataMap;
+ }
+ /**
+ * Helper class implementation of {@link yfiles.algorithms.GraphCopier.ICopyFactory} that can be used to copy the contents of a
+ * DataProvider registered with the source graph onto the target graph storing the values in newly created {@link yfiles.algorithms.Graph#createNodeMap node map}.
+ * @see {@link yfiles.algorithms.GraphCopier.NodeDataProviderCopyFactory#copyNodeDataToNode}
+ */
+ export interface NodeDataProviderCopyFactory extends yfiles.algorithms.GraphCopier.DataProviderCopyFactory{
+ /**
+ * Factory callback to create the backing storage.
+ */
+ createMap(dst:yfiles.algorithms.Graph):yfiles.algorithms.IDataMap;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.Node} src the old entity
+ * @param {yfiles.algorithms.Node} dst the new entity
+ */
+ copyNodeData(src:yfiles.algorithms.Node,dst:yfiles.algorithms.Node):void;
+ /**
+ * Callback method that performs the actual copying of the data.
+ * This implementation simply returns the reference.
+ */
+ copyNodeDataToNode(dpKey:Object,src:yfiles.algorithms.Node,dst:yfiles.algorithms.Node,value:Object):Object;
+ }
+ /**
+ * A helper wrapping implementation of the {@link yfiles.algorithms.GraphCopier.ICopyFactory} interface that copies the contents
+ * of the node maps from the source to the target graph.
+ * @see {@link yfiles.algorithms.GraphCopier.NodeMapCopyFactory#copy}
+ */
+ export interface NodeMapCopyFactory extends yfiles.algorithms.GraphCopier.GraphDataCopyFactory{
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ */
+ preCopyData(src:yfiles.algorithms.Graph,dst:yfiles.algorithms.Graph):void;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.Node} src the old entity
+ * @param {yfiles.algorithms.Node} dst the new entity
+ */
+ copyNodeData(src:yfiles.algorithms.Node,dst:yfiles.algorithms.Node):void;
+ /**
+ * Callback method that performs the actual copying of the data.
+ * This implementation simply returns the reference.
+ */
+ copy(src:yfiles.algorithms.Node,dst:yfiles.algorithms.Node,value:Object):Object;
+ }
+ /**
+ * A helper wrapping implementation of the {@link yfiles.algorithms.GraphCopier.ICopyFactory} interface that copies the contents
+ * of the edge maps from the source to the target graph.
+ * @see {@link yfiles.algorithms.GraphCopier.EdgeMapCopyFactory#copy}
+ */
+ export interface EdgeMapCopyFactory extends yfiles.algorithms.GraphCopier.GraphDataCopyFactory{
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ */
+ preCopyData(src:yfiles.algorithms.Graph,dst:yfiles.algorithms.Graph):void;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.Edge} src the old entity
+ * @param {yfiles.algorithms.Edge} dst the new entity
+ */
+ copyEdgeData(src:yfiles.algorithms.Edge,dst:yfiles.algorithms.Edge):void;
+ /**
+ * Callback method that performs the actual copying of the data.
+ * This implementation simply returns the reference.
+ */
+ copy(src:yfiles.algorithms.Edge,dst:yfiles.algorithms.Edge,value:Object):Object;
+ }
+ /**
+ * Helper class implementation of {@link yfiles.algorithms.GraphCopier.ICopyFactory} that can be used to copy the contents of a
+ * DataProvider registered with the source graph onto the target graph storing the values in newly created {@link yfiles.algorithms.HashMap} based {@link yfiles.algorithms.IDataMap}s.
+ * @see {@link yfiles.algorithms.GraphCopier.ItemDataProviderCopyFactory#copyNodeDataToNode}
+ * @see {@link yfiles.algorithms.GraphCopier.ItemDataProviderCopyFactory#copyEdgeDataToNode}
+ */
+ export interface ItemDataProviderCopyFactory extends yfiles.algorithms.GraphCopier.DataProviderCopyFactory{
+ /**
+ * Factory callback to create the backing storage.
+ */
+ createMap(dst:yfiles.algorithms.Graph):yfiles.algorithms.IDataMap;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.Node} src the old entity
+ * @param {yfiles.algorithms.Node} dst the new entity
+ */
+ copyNodeData(src:yfiles.algorithms.Node,dst:yfiles.algorithms.Node):void;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.Edge} src the old entity
+ * @param {yfiles.algorithms.Edge} dst the new entity
+ */
+ copyEdgeData(src:yfiles.algorithms.Edge,dst:yfiles.algorithms.Edge):void;
+ /**
+ * Callback method that performs the actual copying of the data.
+ * This implementation simply returns the reference.
+ */
+ copyNodeDataToNode(dpKey:Object,src:yfiles.algorithms.Node,dst:yfiles.algorithms.Node,value:Object):Object;
+ /**
+ * Callback method that performs the actual copying of the data.
+ * This implementation simply returns the reference.
+ */
+ copyEdgeDataToNode(dpKey:Object,src:yfiles.algorithms.Edge,dst:yfiles.algorithms.Edge,value:Object):Object;
+ }
+ /**
+ * Helper class implementation of {@link yfiles.algorithms.GraphCopier.ICopyFactory} that can be used to copy the contents of a
+ * DataProvider registered with the source graph onto the target graph storing the values in newly a created {@link yfiles.algorithms.Graph#createEdgeMap edge map}.
+ * @see {@link yfiles.algorithms.GraphCopier.EdgeDataProviderCopyFactory#copy}
+ */
+ export interface EdgeDataProviderCopyFactory extends yfiles.algorithms.GraphCopier.DataProviderCopyFactory{
+ /**
+ * Factory callback to create the backing storage.
+ */
+ createMap(dst:yfiles.algorithms.Graph):yfiles.algorithms.IDataMap;
+ /**
+ * Empty stub to be overwritten by subclass implementations.
+ * @param {yfiles.algorithms.Edge} src the old entity
+ * @param {yfiles.algorithms.Edge} dst the new entity
+ */
+ copyEdgeData(src:yfiles.algorithms.Edge,dst:yfiles.algorithms.Edge):void;
+ copy(dpKey:Object,src:yfiles.algorithms.Edge,dst:yfiles.algorithms.Edge,value:Object):Object;
+ }
+ /**
+ * The copy factory interface used by {@link yfiles.algorithms.GraphCopier} to delegate the actual work to.
+ */
+ export interface ICopyFactory extends Object{
+ /**
+ * Copies the originalNode from the source graph to the new targetGraph.
+ * @param {yfiles.algorithms.Graph} targetGraph the graph to create the new node in
+ * @param {yfiles.algorithms.Node} originalNode the original node from the source graph
+ * @return {yfiles.algorithms.Node} the newly created node
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#copyNode}.
+ */
+ copyNode(targetGraph:yfiles.algorithms.Graph,originalNode:yfiles.algorithms.Node):yfiles.algorithms.Node;
+ /**
+ * Copies the originalEdge from the source graph to the new targetGraph
+ * using the specified new source and target node in the target graph.
+ * @param {yfiles.algorithms.Graph} targetGraph the graph to create the new node in
+ * @param {yfiles.algorithms.Node} newSource the source node in the target graph to use for the newly created edge
+ * @param {yfiles.algorithms.Node} newTarget the target node in the target graph to use for the newly created edge
+ * @param {yfiles.algorithms.Edge} originalEdge the original edge from the source graph
+ * @return {yfiles.algorithms.Edge} the newly created edge
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#copyEdge}.
+ */
+ copyEdge(targetGraph:yfiles.algorithms.Graph,newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,originalEdge:yfiles.algorithms.Edge):yfiles.algorithms.Edge;
+ /**
+ * Creates a new graph instance that will be the target graph of the copy operation.
+ * This method is called if no target graph is specified by the user.
+ * @return {yfiles.algorithms.Graph} the graph to use as the target graph
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#createGraph}.
+ */
+ createGraph():yfiles.algorithms.Graph;
+ /**
+ * Callback that will be called before the copy operation takes place.
+ * At that point in time no entities have been copied to the new graph.
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph that will be used to copy the entities from.
+ * @param {yfiles.algorithms.Graph} targetGraph the graph that will be used to copy the entities to.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#preCopyGraphData}.
+ */
+ preCopyGraphData(sourceGraph:yfiles.algorithms.Graph,targetGraph:yfiles.algorithms.Graph):void;
+ /**
+ * Callback that will be called after the copy operation has completed.
+ * At that point in time all entities have been copied to the new graph.
+ * @param {yfiles.algorithms.Graph} sourceGraph the graph that was used to copy the entities from.
+ * @param {yfiles.algorithms.Graph} targetGraph the graph that was used to copy the entities to.
+ * @param {yfiles.algorithms.IMap} nodeMap
+ * a map that contains a mapping between the nodes in the source graph
+ * to their corresponding nodes in the new graph.
+ * @param {yfiles.algorithms.IMap} edgeMap
+ * a map that contains a mapping between the edges in the source graph
+ * to their corresponding edges in the new graph.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#postCopyGraphData}.
+ */
+ postCopyGraphData(sourceGraph:yfiles.algorithms.Graph,targetGraph:yfiles.algorithms.Graph,nodeMap:yfiles.algorithms.IMap,edgeMap:yfiles.algorithms.IMap):void;
+ }
+ }
+ var GraphCopier:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new instance that uses a {@link yfiles.algorithms.GraphCopyFactory} as the default factory.
+ */
+ new ():yfiles.algorithms.GraphCopier;
+ GraphDataCopyFactory:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new instance that delegates the actual copying process of the elements to the provided factory.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} delegatingFactory
+ */
+ new (delegatingFactory:yfiles.algorithms.GraphCopier.ICopyFactory):yfiles.algorithms.GraphCopier;
+ };
+ DataProviderCopyFactory:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new delegating instance that copies the data for the given data provider key.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} delegatingFactory the factory to delegate to.
+ * @param {Object} dpKey the data provider key
+ */
+ new (delegatingFactory:yfiles.algorithms.GraphCopier.ICopyFactory,dpKey:Object):yfiles.algorithms.GraphCopier;
+ };
+ NodeDataProviderCopyFactory:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new instance using the delegate for the given data provider key.
+ */
+ new (delegatingFactory:yfiles.algorithms.GraphCopier.ICopyFactory,dpKey:Object):yfiles.algorithms.GraphCopier;
+ };
+ NodeMapCopyFactory:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new instance that copies the node map contents.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} delegatingFactory the factory to delegate the copying of the entities to.
+ */
+ new (delegatingFactory:yfiles.algorithms.GraphCopier.ICopyFactory):yfiles.algorithms.GraphCopier;
+ };
+ EdgeMapCopyFactory:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new instance that copies the node map contents.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} delegatingFactory the factory to delegate the copying of the entities to.
+ */
+ new (delegatingFactory:yfiles.algorithms.GraphCopier.ICopyFactory):yfiles.algorithms.GraphCopier;
+ };
+ ItemDataProviderCopyFactory:{
+ $class:yfiles.lang.Class;
+ new (delegatingFactory:yfiles.algorithms.GraphCopier.ICopyFactory,dpKey:Object):yfiles.algorithms.GraphCopier;
+ };
+ EdgeDataProviderCopyFactory:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new instance using the delegate for the given data provider key.
+ */
+ new (delegatingFactory:yfiles.algorithms.GraphCopier.ICopyFactory,dpKey:Object):yfiles.algorithms.GraphCopier;
+ };
+ /**
+ * Creates a new instance that uses the specified factory to perform the actual copy operations.
+ * @param {yfiles.algorithms.GraphCopier.ICopyFactory} copyFactory the factory to use, must be non-null.
+ * @throws {yfiles.system.ArgumentNullException} if copyFactory is null
+ */
+ WithFactory:{
+ new (copyFactory:yfiles.algorithms.GraphCopier.ICopyFactory):yfiles.algorithms.GraphCopier;
+ };
+ };
+ /**
+ * Provides algorithms to compute reachability information for directed, acyclic
+ * graphs.
+ * The following algorithms are available:
+ *
+ *
transitive closure
+ *
transitive reduction
+ *
+ */
+ export interface Transitivity extends Object{
+ }
+ var Transitivity:{
+ $class:yfiles.lang.Class;
+ /**
+ * Calculates the transitive closure for a directed acyclic graph.
+ * The reflexive, transitive closure is defined as follows:
+ * Let G = (V,E) be an directed acyclic graph.
+ * The directed acyclic graph G* = (V,E*) is the reflexive,
+ * transitive closure of G,
+ * if (v,w) in E* iff there is a path from v to
+ * w in G.
+ * REMARK:
+ * Note, that this implementation produces the transitive closure and
+ * not the reflexive, transitive closure of the specified graph, since
+ * no self-loops are added to the specified graph.
+ * Precondition:GraphChecker.isAcyclic(graph)
+ * @param {yfiles.algorithms.Graph} graph input graph to which this method will add transitive edges if necessary.
+ */
+ transitiveClosure(graph:yfiles.algorithms.Graph):void;
+ /**
+ * Like {@link yfiles.algorithms.Transitivity#transitiveClosure}, additionally this method returns the edges
+ * that have been added to the graph.
+ * Precondition:GraphChecker.isAcyclic(graph)
+ * @param {yfiles.algorithms.Graph} graph input graph to which this method will add transitive edges if necessary.
+ * @param {yfiles.algorithms.EdgeList} addedEdges contains edges that have been added to the graph by this method.
+ */
+ transitiveClosureWithAddedEdges(graph:yfiles.algorithms.Graph,addedEdges:yfiles.algorithms.EdgeList):void;
+ /**
+ * Calculates the transitive reduction for a directed acyclic graph.
+ * The transitive edges
+ * in the graph will be removed by this method.
+ * The transitive reduction is defined as follows:
+ * Let G = (V,E) be an directed acyclic graph.
+ * The directed acyclic graph G* = (V,E*) is the transitive
+ * reduction of G,
+ * if (v,w) in E* iff there is no path from v to
+ * w in G of length 2 or more.
+ * WARNING:
+ * This implementation is costly in terms of memory, since a
+ * (n x n)-Matrix is allocated to store reach
+ * data.
+ * Complexity:
+ * O(n^3), where n is
+ * the node count of the specified graph
+ * Precondition:GraphChecker.isAcyclic(graph)
+ */
+ transitiveReduction(graph:yfiles.algorithms.Graph):void;
+ /**
+ * Like {@link yfiles.algorithms.Transitivity#transitiveReduction} this method calculates the transitive reduction
+ * of a graph.
+ * The transitive edges will not be removed from the graph. Instead they will be returned
+ * in an EdgeList.
+ * Complexity:
+ * O(n^3), where n is
+ * the node count of the specified graph
+ * Precondition:GraphChecker.isAcyclic(graph)
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.EdgeList} transitiveEdges
+ * returns the result. It will contain all transitive
+ * edges of the given graph. Removal of these edges will yield the transitive
+ * reduction of the graph.
+ */
+ transitiveReductionWithTransitiveEdges(graph:yfiles.algorithms.Graph,transitiveEdges:yfiles.algorithms.EdgeList):void;
+ };
+ /**
+ * Provides diverse algorithms and services for tree-structured graphs or subgraphs.
+ */
+ export interface Trees extends Object{
+ }
+ var Trees:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns an array of EdgeList objects each containing edges that belong to a
+ * maximal directed subtree of the given graph.
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {yfiles.algorithms.EdgeList[]}
+ * an array of {@link yfiles.algorithms.EdgeList} objects each containing edges that belong to a maximal directed subtree.
+ * @see {@link yfiles.algorithms.Trees#getTreeNodes}
+ */
+ getTreeEdges(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList[];
+ /**
+ * Same as {@link yfiles.algorithms.Trees#getTreeEdges} but more efficient if
+ * the treeNodes where calculated before by {@link yfiles.algorithms.Trees#getTreeNodes}.
+ * Furthermore, the method can also be applied to the result obtained by {@link yfiles.algorithms.Trees#getUndirectedTreeNodes}.
+ * In this case the subtrees are considered to be undirected.
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @param {yfiles.algorithms.NodeList[]} treeNodes
+ * An array of {@link yfiles.algorithms.NodeList}s formerly calculated by {@link yfiles.algorithms.Trees#getTreeNodes}.
+ * @return {yfiles.algorithms.EdgeList[]}
+ * an array of {@link yfiles.algorithms.EdgeList} objects each containing edges that belong to a maximal subtree.
+ */
+ getTreeEdgesForNodes(graph:yfiles.algorithms.Graph,treeNodes:yfiles.algorithms.NodeList[]):yfiles.algorithms.EdgeList[];
+ /**
+ * Returns an array of NodeList objects each containing nodes
+ * that belong to a maximal directed subtree
+ * of the given graph.
+ * For each list of tree nodes the first node
+ * element is the root of a tree. On each such root all
+ * outgoing edges connect to nodes in the subtree and each
+ * root's indegree is at least two.
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {yfiles.algorithms.NodeList[]}
+ * an array of {@link yfiles.algorithms.NodeList} objects each containing nodes that belong to a maximal directed subtree.
+ */
+ getTreeNodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[];
+ /**
+ * Returns an array of NodeList objects each containing nodes
+ * that belong to a maximal undirected subtree
+ * of the given graph.
+ * For each list of tree nodes the first node
+ * is the only node of the subtree that may be incident to non-tree edges.
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {yfiles.algorithms.NodeList[]}
+ * an array of {@link yfiles.algorithms.NodeList} objects each containing nodes that belong to a maximal undirected subtree.
+ */
+ getUndirectedTreeNodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[];
+ /**
+ * Checks whether the given graph is a directed rooted tree where each
+ * node has a maximum of n children.
+ * @param {yfiles.algorithms.Graph} g the given graph.
+ * @param {number} n the allowed maximum of children.
+ * @return {boolean}
+ * true if the given graph is a directed rooted tree where each
+ * node has a maximum of n children. Otherwise, the method returns false.
+ */
+ isNaryTree(g:yfiles.algorithms.Graph,n:number):boolean;
+ /**
+ * Checks whether the given graph is a directed rooted tree.
+ * Note: isRootedTree(graph) => isTree(graph).
+ * @param {yfiles.algorithms.Graph} g the given graph.
+ * @return {boolean}
+ * true if the given graph is a directed rooted tree.
+ * Otherwise, the method returns false.
+ */
+ isRootedTree(g:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given graph is an undirected tree.
+ * Note: isRootedTree(graph) => isTree(graph).
+ * @param {yfiles.algorithms.Graph} g the given graph.
+ * @return {boolean}
+ * true if the given graph is an undirected tree.
+ * Otherwise, the method returns false.
+ */
+ isTree(g:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether the given graph is a forest, that is,
+ * a graph whose connected components are directed rooted trees.
+ * @param {yfiles.algorithms.Graph} g the given graph.
+ * @return {boolean} true if the given graph is a forest. Otherwise, the method returns false.
+ */
+ isForest(g:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether the given graph is a forest.
+ * If directedRootedTree == true each component has to be a directed rooted tree.
+ * Otherwise, each component has to be an undirected tree.
+ * Note: isForest(graph, true) => isForest(graph, false).
+ * @param {yfiles.algorithms.Graph} g the given graph.
+ * @param {boolean} directedRootedTree whether to check for directed rooted trees.
+ * @return {boolean} true if the given graph is a forest. Otherwise, the method returns false.
+ */
+ isForestWithDirection(g:yfiles.algorithms.Graph,directedRootedTree:boolean):boolean;
+ /**
+ * Returns all leaf nodes of the given tree.
+ * A leaf node is a node with outdegree == 0 if the input is a directed rooted tree,
+ * and a node with degree == 1, otherwise.
+ * @param {yfiles.algorithms.Graph} tree the given tree.
+ * @param {boolean} directedRootedTree whether or not to consider the tree as directed rooted tree.
+ * @return {yfiles.algorithms.NodeList} a NodeList that contains all leaf nodes of the given tree.
+ */
+ getLeafNodes(tree:yfiles.algorithms.Graph,directedRootedTree:boolean):yfiles.algorithms.NodeList;
+ /**
+ * Returns the center node of an undirected tree.
+ * The center node has the property of inducing a minimum depth
+ * tree when being used as the root of that tree.
+ * Precondition:!tree.isEmpty()
+ * Precondition:isTree(tree)
+ * @param {yfiles.algorithms.Graph} tree the given undirected tree.
+ * @return {yfiles.algorithms.Node} the center node of the given undirected tree.
+ */
+ getCenterRoot(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node;
+ /**
+ * Returns a possible root for the given (undirected) tree.
+ * More precisely, if the input is a directed rooted tree or reversed directed rooted tree it returns the
+ * corresponding root node.
+ * Otherwise, if the input is a tree, the method returns a maximum weight center node as defined in
+ * {@link yfiles.algorithms.Trees#getWeightedCenterNode}.
+ * If the input is not a tree, the node with indegree == 0 (or outdegree == 0) is returned.
+ * Precondition:
+ * isTree(tree)
+ * or there is exactly one node with indegree == 0
+ * or there is exactly one node with outdegree == 0
+ * Precondition:!tree.isEmpty()
+ * @param {yfiles.algorithms.Graph} tree the given tree.
+ * @return {yfiles.algorithms.Node} a possible root for the given tree.
+ */
+ getRoot(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node;
+ /**
+ * Reverses some edges of the given tree such that it is
+ * a directed rooted tree afterwards.
+ * A list of all reversed edges will be returned by this method.
+ * Precondition: The given graph must be a tree.
+ * Precondition:!graph.isEmpty()
+ * @param {yfiles.algorithms.Graph} tree the given tree.
+ * @return {yfiles.algorithms.EdgeList}
+ * an {@link yfiles.algorithms.EdgeList} that contains the reversed edges.
+ */
+ directTree(tree:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList;
+ /**
+ * Finds a node which is used by the greatest number of all (undirected) paths interconnecting
+ * all nodes with each other.
+ * Precondition: The given graph must be a tree (may be undirected).
+ * Precondition:!graph.isEmpty()
+ * @param {yfiles.algorithms.Graph} tree the given tree.
+ * @return {yfiles.algorithms.Node} a node which is used by the greatest number of all undirected paths.
+ */
+ getWeightedCenterNode(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node;
+ /**
+ * Finds a node which is used by the greatest number of all (undirected) paths interconnecting
+ * all nodes with each other.
+ * The number of paths per node are stored in the given
+ * NodeMap.
+ * Precondition: The given graph must be a tree (may be undirected).
+ * Precondition:!graph.isEmpty()
+ * @param {yfiles.algorithms.Graph} tree the given tree.
+ * @param {yfiles.algorithms.INodeMap} intWeight
+ * a {@link yfiles.algorithms.INodeMap} that is used to store the number of paths per node.
+ * @return {yfiles.algorithms.Node} a node which is used by the greatest number of all undirected paths.
+ */
+ getWeightedCenterNodeWithWeight(tree:yfiles.algorithms.Graph,intWeight:yfiles.algorithms.INodeMap):yfiles.algorithms.Node;
+ /**
+ * Reverses some edges of the given tree such that it is
+ * a directed rooted tree with the given node as root element.
+ * A list of all reversed edges will be returned by this method.
+ * Precondition: The given graph must be a tree.
+ * Precondition: The given node must be part of the given graph
+ * @param {yfiles.algorithms.Graph} tree the given tree.
+ * @param {yfiles.algorithms.Node} root the given root element.
+ * @return {yfiles.algorithms.EdgeList}
+ * an {@link yfiles.algorithms.EdgeList} that contains the reversed edges.
+ */
+ directTreeWithRoot(tree:yfiles.algorithms.Graph,root:yfiles.algorithms.Node):yfiles.algorithms.EdgeList;
+ /**
+ * Collects all nodes of the subtree starting with root.
+ * @deprecated For internal use only. Might be changed or removed in the future.
+ * @param {yfiles.algorithms.Node} root
+ * @param {yfiles.algorithms.NodeList} nodes the resulting node list
+ */
+ collectSubtree(root:yfiles.algorithms.Node,nodes:yfiles.algorithms.NodeList):void;
+ /**
+ * Returns the nearest common ancestor of a subset of nodes within a directed rooted tree.
+ * It is not part of the
+ * given subset.
+ * Precondition: isTree(tree)
+ * Complexity: O(tree.N())
+ * @param {yfiles.algorithms.Graph} tree the given directed rooted tree.
+ * @param {yfiles.algorithms.Node} root the root of the tree.
+ * @param {boolean} rootedDownward
+ * whether the tree is directed from the root to the leaves (true) or from the
+ * leaves to the root (false).
+ * @param {yfiles.algorithms.NodeList} nodes the subset of nodes.
+ * @return {yfiles.algorithms.Node} the nearest common ancestor of the given subset of nodes.
+ */
+ getNearestCommonAncestor(tree:yfiles.algorithms.Graph,root:yfiles.algorithms.Node,rootedDownward:boolean,nodes:yfiles.algorithms.NodeList):yfiles.algorithms.Node;
+ /**
+ * Returns for a rooted directed tree the depths of each of its subtrees.
+ * @param {yfiles.algorithms.Graph} tree a rooted directed tree graph.
+ * @param {yfiles.algorithms.INodeMap} subtreeDepthMap
+ * node map that will hold for each node the depth of the subtree rooted at it. The resulting
+ * depth values can be retrieved using the map method {@link yfiles.algorithms.INodeMap#getInt}.
+ */
+ getSubTreeDepths(tree:yfiles.algorithms.Graph,subtreeDepthMap:yfiles.algorithms.INodeMap):void;
+ /**
+ * Returns for a rooted directed tree the size (number of nodes) of each of its subtrees.
+ * @param {yfiles.algorithms.Graph} tree a rooted directed tree graph
+ * @param {yfiles.algorithms.INodeMap} subtreeSizeMap
+ * node map that will hold for each node the size of the subtree rooted at it. The resulting
+ * size values can be retrieved using the map method {@link yfiles.algorithms.INodeMap#getInt}.
+ */
+ getSubTreeSizes(tree:yfiles.algorithms.Graph,subtreeSizeMap:yfiles.algorithms.INodeMap):void;
+ };
+ /**
+ * This class provides methods for efficiently sorting graph elements in graph
+ * structures.
+ */
+ export interface Sorting extends Object{
+ }
+ var Sorting:{
+ $class:yfiles.lang.Class;
+ /**
+ * Sort nodes by degree in ascending order.
+ */
+ sortNodesByDegree(graph:yfiles.algorithms.Graph):yfiles.algorithms.Node[];
+ /**
+ * Sort nodes by an integer key associated to each node through the given data provider.
+ * The nodes are sorted in ascending order.
+ */
+ sortNodesByIntKey(graph:yfiles.algorithms.Graph,keys:yfiles.algorithms.IDataProvider):yfiles.algorithms.Node[];
+ };
+ /**
+ * Provides (minimum) spanning tree algorithms for graphs.
+ * A spanning tree of an undirected connected graph is a subset of its edges
+ * that form a tree connecting all edges of the graph.
+ * If the edges of a graph have a cost or a weight associated with
+ * them then it is possible to calculate a minimum spanning tree of that graph,
+ * i.e. a spanning tree whose edges have minimum overall cost of all spanning
+ * trees of that graph.
+ */
+ export interface SpanningTrees extends Object{
+ }
+ var SpanningTrees:{
+ $class:yfiles.lang.Class;
+ /**
+ * Calculates a minimum spanning tree for the given graph using our
+ * favorite algorithm for that problem.
+ * Precondition: GraphComponents.isConnected(graph)
+ * Precondition: cost.length == graph.E();
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.IDataProvider} cost
+ * a data provider that must return a double value for each
+ * edge in the graph.
+ * @return {yfiles.algorithms.EdgeList}
+ * a list that contains the edges that make up the minimum spanning
+ * tree.
+ */
+ minimum(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList;
+ /**
+ * Calculates a minimum spanning tree for the given graph.
+ * The implementation
+ * is based on an algorithm originally published in
+ * J.B. Kruskal. On the shortest spanning subtree of a graph and the
+ * traveling salesman problem. Proceedings of the American Mathematical
+ * Society, pages 48-50, 1956.
+ * Precondition: GraphComponents.isConnected(graph)
+ * Precondition: cost.length == graph.E();
+ * Complexity: graph.E()+graph.N()*log(graph.N())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.IDataProvider} cost
+ * a data provider that must return a double value for each
+ * edge in the graph.
+ * @return {yfiles.algorithms.EdgeList}
+ * a list that contains the edges that make up the minimum spanning
+ * tree.
+ */
+ kruskal(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList;
+ /**
+ * Calculates a minimum spanning tree for the given graph.
+ * The implementation
+ * is based on an algorithm originally published in
+ * R.C. Prim. Shortest connection networks and some generalizations.
+ * Bell System Technical Journal, 36:1389-1401, 1957.
+ * Precondition: GraphComponents.isConnected(graph)
+ * Precondition: cost.length == graph.E();
+ * Complexity: graph.E()*log(graph.N())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.IDataProvider} cost
+ * a data provider that must return a double value for each
+ * edge in the graph.
+ * @return {yfiles.algorithms.EdgeList}
+ * a list that contains the edges that make up the minimum spanning
+ * tree.
+ */
+ prim(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList;
+ /**
+ * Calculates a spanning tree for the given graph.
+ * Each edge has
+ * assumed uniform cost of 1.0.
+ * Precondition: GraphComponents.isConnected(graph)
+ * Complexity: O(graph.E()+graph.N())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @return {yfiles.algorithms.EdgeList}
+ * a list that contains the edges that make up the minimum spanning
+ * tree.
+ */
+ uniform(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList;
+ /**
+ * Returns the overall cost of a previously calculated minimum
+ * spanning tree.
+ * @param {yfiles.algorithms.EdgeList} treeEdges edges that make up a minimum spanning tree.
+ * @param {yfiles.algorithms.IDataProvider} edgeCost
+ * a data provider that returns the double valued
+ * cost of each of the tree edges.
+ * @return {number} the overall cost of the tree edges.
+ */
+ cost(treeEdges:yfiles.algorithms.EdgeList,edgeCost:yfiles.algorithms.IDataProvider):number;
+ };
+ /**
+ * This class represents a priority queue for nodes where
+ * the priority values are of type Object
+ * The implementation is based on binary heaps.
+ * In case the priority values are of type double then using {@link yfiles.algorithms.BHeapDoubleNodePQ}
+ * is slightly more efficient than using this generic NodePQ.
+ */
+ export interface BHeapNodePQ extends Object,yfiles.algorithms.INodePQ{
+ /**
+ * Adds the given node with with given priority to this queue.
+ * Precondition: !contains(v)
+ * Complexity: O(log(size()))
+ * @see Specified by {@link yfiles.algorithms.INodePQ#add}.
+ */
+ add(v:yfiles.algorithms.Node,priority:Object):void;
+ /**
+ * Decreases the priority value of the given node.
+ * Precondition: contains(v)
+ * Precondition:
+ * c.compare(priority,getPriority(v)) < 0, where
+ * c is the corresponding comparator for the priorities in this
+ * queue.
+ * Complexity: O(log(size()))
+ * @see Specified by {@link yfiles.algorithms.INodePQ#decreasePriority}.
+ */
+ decreasePriority(v:yfiles.algorithms.Node,priority:Object):void;
+ increasePriority(v:yfiles.algorithms.Node,priority:Object):void;
+ /**
+ * Changes the priority value of the given node.
+ * Precondition: contains(v)
+ * Complexity: O(log(size()))
+ */
+ changePriority(v:yfiles.algorithms.Node,priority:Object):void;
+ /**
+ * Removes the node with smallest priority from this queue.
+ * Precondition: !isEmpty()
+ * Complexity: O(log(size()))
+ * @return {yfiles.algorithms.Node} the removed node with smallest priority
+ * @see Specified by {@link yfiles.algorithms.INodePQ#removeMin}.
+ */
+ removeMin():yfiles.algorithms.Node;
+ /**
+ * He node with smallest priority in this queue.
+ * Precondition: !isEmpty()
+ * @see Specified by {@link yfiles.algorithms.INodePQ#min}.
+ */
+ min:yfiles.algorithms.Node;
+ /**
+ * The minimum priority value in this queue.
+ */
+ minPriority:Object;
+ /**
+ * Removes the given node from this queue.
+ * Precondition: contains(v)
+ * Complexity: O(log(size()))
+ */
+ remove(v:yfiles.algorithms.Node):void;
+ /**
+ * Makes this queue the empty queue.
+ * in this queue.
+ * Complexity: O(graph.N())
+ * @see Specified by {@link yfiles.algorithms.INodePQ#clear}.
+ */
+ clear():void;
+ /**
+ * Returns whether or not the given node is contained
+ * in this queue.
+ * Complexity: O(1)
+ * @see Specified by {@link yfiles.algorithms.INodePQ#contains}.
+ */
+ contains(v:yfiles.algorithms.Node):boolean;
+ /**
+ * Specifies whether or not this queue is empty.
+ * Complexity: O(1)
+ * @see Specified by {@link yfiles.algorithms.INodePQ#empty}.
+ */
+ empty:boolean;
+ /**
+ * Returns the number of nodes currently in this queue.
+ * Complexity: O(1)
+ * @see Specified by {@link yfiles.algorithms.INodePQ#size}.
+ */
+ size():number;
+ /**
+ * Returns the current priority of the given node.
+ * Precondition: contains(v)
+ * @see Specified by {@link yfiles.algorithms.INodePQ#getPriority}.
+ */
+ getPriority(v:yfiles.algorithms.Node):Object;
+ }
+ var BHeapNodePQ:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates an empty NodePQ for nodes contained
+ * in the given graph.
+ * The given comparator
+ * must be able to compare all nodes residing in this
+ * queue by their priority.
+ * Neither the node set nor the indices of the nodes
+ * of the given graph may change while this queue is being used.
+ */
+ new (graph:yfiles.algorithms.Graph,c:yfiles.objectcollections.IComparer):yfiles.algorithms.BHeapNodePQ;
+ /**
+ * Creates an empty NodePQ for nodes contained
+ * in the given graph.
+ * The given comparator
+ * must be able to compare all nodes residing in this
+ * queue by their priority.
+ * By providing a NodeMap that can handle dynamic
+ * changes of its definition range this queue will
+ * be enabled to function even when the node set of
+ * the given graph changes.
+ */
+ FromMap:{
+ new (graph:yfiles.algorithms.Graph,c:yfiles.objectcollections.IComparer,dynamicMap:yfiles.algorithms.INodeMap):yfiles.algorithms.BHeapNodePQ;
+ };
+ };
+ /**
+ * This class implements a priority queue for nodes whose priority
+ * values are of type int.
+ *
+ * The implementation is based on binary heaps.
+ *
+ */
+ export interface BHeapIntNodePQ extends Object,yfiles.algorithms.IIntNodePQ{
+ /**
+ * Adds the given node with with given priority to this queue.
+ * Precondition: !contains(v)
+ * Complexity: O(log(size()))
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#add}.
+ */
+ add(v:yfiles.algorithms.Node,priority:number):void;
+ /**
+ * Decreases the priority value of the given node.
+ * Precondition: contains(v)
+ * Precondition: priority < getPriority(v)
+ * Complexity: O(log(size()))
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#decreasePriority}.
+ */
+ decreasePriority(v:yfiles.algorithms.Node,priority:number):void;
+ /**
+ * Increases the priority value of the given node.
+ * Precondition: contains(v)
+ * Precondition: priority > getPriority(v)
+ * Complexity: O(log(size()))
+ */
+ increasePriority(v:yfiles.algorithms.Node,priority:number):void;
+ /**
+ * Changes the priority value of the given node.
+ * Precondition: contains(v)
+ * Complexity: O(log(size()))
+ */
+ changePriority(v:yfiles.algorithms.Node,p:number):void;
+ /**
+ * Removes the node with smallest priority from this queue.
+ * Precondition: !isEmpty()
+ * Complexity: O(log(size()))
+ * @return {yfiles.algorithms.Node} the removed node with smallest priority
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#removeMin}.
+ */
+ removeMin():yfiles.algorithms.Node;
+ /**
+ * He node with smallest priority in this queue.
+ * Precondition: !isEmpty()
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#min}.
+ */
+ min:yfiles.algorithms.Node;
+ /**
+ * The minimum priority value in this queue.
+ */
+ minPriority:number;
+ /**
+ * Returns whether or not the given node is contained
+ * in this queue.
+ * Complexity: O(1)
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#contains}.
+ */
+ contains(v:yfiles.algorithms.Node):boolean;
+ /**
+ * Specifies whether or not this queue is empty.
+ * Complexity: O(1)
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#empty}.
+ */
+ empty:boolean;
+ /**
+ * Returns the number of nodes currently in this queue.
+ * Complexity: O(1)
+ */
+ size():number;
+ /**
+ * Returns the current priority of the given node.
+ * Precondition: contains(v)
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#getPriority}.
+ */
+ getPriority(v:yfiles.algorithms.Node):number;
+ /**
+ * Removes the given node from this queue.
+ * Precondition: contains(v)
+ * Complexity: O(log(size()))
+ */
+ remove(v:yfiles.algorithms.Node):void;
+ /**
+ * Makes this queue the empty queue.
+ * in this queue.
+ * Complexity: O(graph.N())
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#clear}.
+ */
+ clear():void;
+ /**
+ * Does nothing.
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#dispose}.
+ */
+ dispose():void;
+ }
+ var BHeapIntNodePQ:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates an empty NodePQ for nodes contained
+ * in the given graph.
+ * Neither the node set nor the indices of the nodes
+ * of the given graph may change while this queue is being used.
+ */
+ new (graph:yfiles.algorithms.Graph):yfiles.algorithms.BHeapIntNodePQ;
+ };
+ /**
+ * Implements a priority queue for nodes based on a
+ * array with bucket lists.
+ * The priority values must be less than a maximal-value
+ * which must be provided to the constructor.
+ * Certain operations have time-complexity dependent on this value.
+ * The priority values of the nodes must be non-negative.
+ * While the priority queue is used, the graph must not change.
+ */
+ export interface ArrayIntNodePQ extends Object,yfiles.algorithms.IIntNodePQ{
+ /**
+ * Removes all entries from the queue.
+ * Complexity:O(maxSize)
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#clear}.
+ */
+ clear():void;
+ /**
+ * Specifies whether or not this queue is empty.
+ * Complexity:O(1)
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#empty}.
+ */
+ empty:boolean;
+ /**
+ * Returns whether or not the given node is contained within this queue.
+ * Complexity:O(1)
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#contains}.
+ */
+ contains(n:yfiles.algorithms.Node):boolean;
+ /**
+ * Inserts a node into the queue.
+ * Complexity:O(1)
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#add}.
+ */
+ add(n:yfiles.algorithms.Node,value:number):void;
+ /**
+ * Removes a node from the priority queue.
+ * Time complexity in worst-case O(maxSize).
+ * Complexity:
+ * Amortized time complexity is O(maxSize), given
+ * that the sequence of minimal keys is non-decreasing
+ */
+ remove(n:yfiles.algorithms.Node):void;
+ /**
+ * The node with the minimal value in the queue.
+ * Complexity:O(1)
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#min}.
+ */
+ min:yfiles.algorithms.Node;
+ /**
+ * Decreases the value of a node in the queue to a certain value.
+ * Complexity:O(1)
+ * @param {yfiles.algorithms.Node} n a node in the priority queue.
+ * @param {number} value the new priority value of the node.
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#decreasePriority}.
+ */
+ decreasePriority(n:yfiles.algorithms.Node,value:number):void;
+ /**
+ * Increases the value of a node in the queue to a certain value.
+ * Complexity: O(1).
+ * @param {yfiles.algorithms.Node} n a node in the priority queue.
+ * @param {number} value the new priority value of the node.
+ */
+ increasePriority(n:yfiles.algorithms.Node,value:number):void;
+ /**
+ * Changes the value of a node in the queue to a certain value.
+ * Complexity: O(1).
+ * @param {yfiles.algorithms.Node} n a node in the priority queue.
+ * @param {number} value the new priority value of the node.
+ */
+ changePriority(n:yfiles.algorithms.Node,value:number):void;
+ /**
+ * Removes the node with the minimal value from the queue.
+ * Time complexity like {@link yfiles.algorithms.ArrayIntNodePQ#remove}.
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#removeMin}.
+ */
+ removeMin():yfiles.algorithms.Node;
+ /**
+ * Returns the current priority of the given node.
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#getPriority}.
+ */
+ getPriority(v:yfiles.algorithms.Node):number;
+ /**
+ * Disposes this queue.
+ * It is important to call this method after the queue
+ * is not needed anymore, to free bound resources.
+ * @see Specified by {@link yfiles.algorithms.IIntNodePQ#dispose}.
+ */
+ dispose():void;
+ /**
+ * Returns the list for a given slot.
+ * If there is no list yet, create one.
+ */
+ getList(value:number):yfiles.algorithms.YList;
+ }
+ var ArrayIntNodePQ:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns an empty Priority-Queue.
+ * @param {yfiles.algorithms.Graph} _graph the graph which contains the nodes
+ * @param {number} maxSize the maximum value of a node in the priority queue
+ */
+ new (_graph:yfiles.algorithms.Graph,maxSize:number):yfiles.algorithms.ArrayIntNodePQ;
+ /**
+ * Returns a new Priority-Queue initialized with all nodes of the graph.
+ * @param {yfiles.algorithms.Graph} _graph the graph which contains the nodes
+ * @param {yfiles.algorithms.IDataProvider} _initValues the initial priority values of the nodes.
+ */
+ WithInitValues:{
+ new (_graph:yfiles.algorithms.Graph,_initValues:yfiles.algorithms.IDataProvider):yfiles.algorithms.ArrayIntNodePQ;
+ };
+ /**
+ * Returns an empty Priority-Queue.
+ * This constructor takes a NodeMap as argument
+ * which is used to store the priority values.
+ * @param {yfiles.algorithms.Graph} _graph the graph which contains the nodes
+ * @param {yfiles.algorithms.INodeMap} _valueMap here the priority values are stored
+ * @param {number} maxSize the maximum value of a node in the priority queue
+ */
+ WithValueMapAndMaxSize:{
+ new (_graph:yfiles.algorithms.Graph,_valueMap:yfiles.algorithms.INodeMap,maxSize:number):yfiles.algorithms.ArrayIntNodePQ;
+ };
+ };
+ /**
+ * This class implements a priority queue for nodes whose priority
+ * values are of type double.
+ * The implementation is based on binary heaps.
+ */
+ export interface BHeapDoubleNodePQ extends Object,yfiles.algorithms.IDoubleNodePQ{
+ /**
+ * Adds the given node with with given priority to this queue.
+ * Precondition: !contains(v)
+ * Complexity: O(log(size()))
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#add}.
+ */
+ add(v:yfiles.algorithms.Node,value:number):void;
+ /**
+ * Decreases the priority value of the given node.
+ * Precondition: contains(v)
+ * Precondition:
+ * c.compare(p,getPriority(v)) < 0, where
+ * c is the corresponding comparator for the priorities in this
+ * queue.
+ * Complexity: O(log(size()))
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#decreasePriority}.
+ */
+ decreasePriority(v:yfiles.algorithms.Node,priority:number):void;
+ increasePriority(v:yfiles.algorithms.Node,priority:number):void;
+ /**
+ * Changes the priority value of the given node.
+ * Precondition: contains(v)
+ * Complexity: O(log(size()))
+ */
+ changePriority(v:yfiles.algorithms.Node,p:number):void;
+ /**
+ * Removes the node with smallest priority from this queue.
+ * Precondition: !isEmpty()
+ * Complexity: O(log(size()))
+ * @return {yfiles.algorithms.Node} the removed node with smallest priority
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#removeMin}.
+ */
+ removeMin():yfiles.algorithms.Node;
+ /**
+ * He node with smallest priority in this queue.
+ * Precondition: !isEmpty()
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#min}.
+ */
+ min:yfiles.algorithms.Node;
+ /**
+ * The minimum priority value in this queue.
+ */
+ minPriority:number;
+ /**
+ * Returns whether or not the given node is contained
+ * in this queue.
+ * Complexity: O(1)
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#contains}.
+ */
+ contains(v:yfiles.algorithms.Node):boolean;
+ /**
+ * Specifies whether or not this queue is empty.
+ * Complexity: O(1)
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#empty}.
+ */
+ empty:boolean;
+ /**
+ * Returns the number of nodes currently in this queue.
+ * Complexity: O(1)
+ */
+ size():number;
+ /**
+ * Returns the current priority of the given node.
+ * Precondition: contains(v)
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#getPriority}.
+ */
+ getPriority(v:yfiles.algorithms.Node):number;
+ /**
+ * Removes the given node from this queue.
+ * Precondition: contains(v)
+ * Complexity: O(log(size()))
+ */
+ remove(v:yfiles.algorithms.Node):void;
+ /**
+ * Makes this queue the empty queue.
+ * in this queue.
+ * Complexity: O(graph.N())
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#clear}.
+ */
+ clear():void;
+ /**
+ * Does nothing.
+ * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#dispose}.
+ */
+ dispose():void;
+ }
+ var BHeapDoubleNodePQ:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates an empty NodePQ for nodes contained
+ * in the given graph.
+ * Neither the node set nor the indices of the nodes
+ * of the given graph may change while this queue is being used.
+ */
+ new (graph:yfiles.algorithms.Graph):yfiles.algorithms.BHeapDoubleNodePQ;
+ };
+ /**
+ * This class provides algorithms for the triangulation of point
+ * sets in the plane.
+ */
+ export interface Triangulator extends Object{
+ }
+ var Triangulator:{
+ $class:yfiles.lang.Class;
+ /**
+ * Computes a triangulation of the given points.
+ * The calculated triangulation is represented by an embedded graph,
+ * i.e. to each edge there exists a reverse edge and the outedges
+ * around each node are in embedded order. The returned edge and
+ * the (optional) reverseEdgeMap can be used to construct all faces of the
+ * plane graph and to determine its outer face.
+ * @param {yfiles.algorithms.Graph} result
+ * a graph whose nodes represent the points that need
+ * to be triangulated.
+ * @param {yfiles.algorithms.IDataProvider} pointData must provide the location (YPoint) for each node in the given graph.
+ * @param {yfiles.algorithms.IEdgeMap} reverseEdgeMap
+ * a node map that will contain for each edge its reverse
+ * edge. If this argument is null then no reverse edge information
+ * will be available.
+ * @return {yfiles.algorithms.Edge} an edge on the outer face of the result graph.
+ */
+ triangulatePoints(result:yfiles.algorithms.Graph,pointData:yfiles.algorithms.IDataProvider,reverseEdgeMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge;
+ /**
+ * Computes a triangulation of the given points.
+ * The calculated triangulation is represented by an embedded graph,
+ * i.e. to each edge there exists a reverse edge and the outedges
+ * around each node are in embedded order. The returned edge and
+ * the (optional) reverseEdgeMap can be used to construct all faces of the
+ * plane graph and to determine its outer face.
+ * @param {yfiles.algorithms.YList} points
+ * the point set to be triangulated. The points must be provided
+ * as a YList of YPoints.
+ * @param {yfiles.algorithms.Graph} result the resulting triangulation
+ * @param {yfiles.algorithms.INodeMap} resultMap the node map that forms the link between a point and a node.
+ * @param {yfiles.algorithms.IEdgeMap} reverseEdgeMap
+ * a node map that will contain for each edge its reverse
+ * edge. If this argument is null then no reverse edge information
+ * will be available.
+ * @return {yfiles.algorithms.Edge} an edge on the outer face of the result graph.
+ */
+ triangulatePointsFromList(points:yfiles.algorithms.YList,result:yfiles.algorithms.Graph,resultMap:yfiles.algorithms.INodeMap,reverseEdgeMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge;
+ /**
+ * Computes a Delauney triangulation of the given points.
+ * A Delauney triangulation
+ * is a triangulation such that none of the given points is inside the circumcircle
+ * of any of the calculated triangles.
+ *
+ * The calculated triangulation is represented by an embedded graph,
+ * i.e. to each edge there exists a reverse edge and the outedges
+ * around each node are in embedded order. The returned edge and
+ * the (optional) reverseEdgeMap can be used to construct all faces of the
+ * plane graph and to determine its outer face.
+ *
+ * @param {yfiles.algorithms.Graph} result
+ * a graph whose nodes represent the points that need
+ * to be triangulated.
+ * @param {yfiles.algorithms.IDataProvider} pointData must provide the location (YPoint) for each node in the given graph.
+ * @param {yfiles.algorithms.IEdgeMap} revMap
+ * a node map that will contain for each edge its reverse
+ * edge. If this argument is null then no reverse edge information
+ * will be available.
+ * @return {yfiles.algorithms.Edge} an edge on the outer face of the result graph.
+ */
+ calcDelauneyTriangulation(result:yfiles.algorithms.Graph,pointData:yfiles.algorithms.IDataProvider,revMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge;
+ };
+ /**
+ * This interface describes a 2-dimensional object which has a finite
+ * bounding box.
+ */
+ export interface IPlaneObject extends Object{
+ /**
+ * The smallest Rectangle which contains the object.
+ * @see Specified by {@link yfiles.algorithms.IPlaneObject#boundingBox}.
+ */
+ boundingBox:yfiles.algorithms.YRectangle;
+ }
+ var IPlaneObject:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * This is an interface for a sequence of instances of YPoint.
+ */
+ export interface IPointCursor extends Object,yfiles.algorithms.ICursor{
+ /**
+ * The instance of YPoint the cursor is currently pointing on.
+ * @see Specified by {@link yfiles.algorithms.IPointCursor#point}.
+ */
+ point:yfiles.algorithms.YPoint;
+ }
+ var IPointCursor:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * This class represents a line segment in the plane.
+ * A line segment is defined by its two end points.
+ */
+ export interface LineSegment extends Object,yfiles.algorithms.IPlaneObject{
+ /**
+ * If this segment is considered vertical, i.e.
+ * the x values of the end point differ less then 0.00000001
+ */
+ isVertical:boolean;
+ /**
+ * Determines if the interval is horizontal.
+ */
+ isHorizontal:boolean;
+ /**
+ * The first end point of the line segment.
+ */
+ firstEndPoint:yfiles.algorithms.YPoint;
+ /**
+ * The second end point of the line segment.
+ */
+ secondEndPoint:yfiles.algorithms.YPoint;
+ /**
+ * Returns if the projection on the Y axis of the line segment
+ * covers a certain point on the Y Axis.
+ */
+ isInYIntervall(y:number):boolean;
+ /**
+ * Returns if the projection on the X axis of the line segment
+ * covers a certain point on the X Axis.
+ */
+ isInXIntervall(x:number):boolean;
+ /**
+ * The y value of the line on x coordinate 0.
+ */
+ xOffset:number;
+ /**
+ * The slope of the line segment.
+ */
+ slope:number;
+ /**
+ * Returns the length of the line segment,
+ * this is the value of the Euclidean norm.
+ * @return {number} an value > 0.
+ */
+ length():number;
+ /**
+ * The smallest Rectangle which contains the object.
+ * @see Specified by {@link yfiles.algorithms.IPlaneObject#boundingBox}.
+ */
+ boundingBox:yfiles.algorithms.YRectangle;
+ /**
+ * Checks whether the line segment intersects a box.
+ * @param {yfiles.algorithms.YRectangle} box A rectangle.
+ * @return {boolean}
+ * true if the line segments intersects the box,
+ * false otherwise.
+ */
+ intersectsRectangle(box:yfiles.algorithms.YRectangle):boolean;
+ /**
+ * Checks whether a given point lies on this line segment.
+ * @param {yfiles.algorithms.YPoint} point an arbitrary point.
+ * @return {boolean}
+ * true if the line segments intersects the box,
+ * false otherwise.
+ */
+ contains(point:yfiles.algorithms.YPoint):boolean;
+ /**
+ * Checks whether the line segment intersects a point.
+ * @param {yfiles.algorithms.YPoint} p a point
+ * @return {boolean}
+ * true if the line segments intersects the box,
+ * false otherwise.
+ */
+ intersectsPoint(p:yfiles.algorithms.YPoint):boolean;
+ /**
+ * Returns the vector pointing from the first end point to the second
+ * end point of the line segment.
+ */
+ toYVector():yfiles.algorithms.YVector;
+ /**
+ * Returns the affine line defined by the end points of the
+ * line segment.
+ */
+ toAffineLine():yfiles.algorithms.AffineLine;
+ /**
+ * The distance from start to end point in x-coordinates.
+ */
+ deltaX:number;
+ /**
+ * The distance from start to end point in y-coordinates.
+ */
+ deltaY:number;
+ /**
+ * String representation of the line.
+ */
+ toString():string;
+ }
+ var LineSegment:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns a new LineSegment.
+ * @param {yfiles.algorithms.YPoint} p1 the first end point of the line segment.
+ * @param {yfiles.algorithms.YPoint} p2 the second end point of the line segment.
+ */
+ new (p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.LineSegment;
+ /**
+ * Checks whether a line segment intersects a box.
+ * @param {yfiles.algorithms.YRectangle} box A rectangle.
+ * @param {yfiles.algorithms.YPoint} s first end point of the line segment.
+ * @param {yfiles.algorithms.YPoint} t second end point of the line segment.
+ * @return {boolean}
+ * true if the line segments intersects the box,
+ * false otherwise.
+ */
+ boxIntersectsSegment(box:yfiles.algorithms.YRectangle,s:yfiles.algorithms.YPoint,t:yfiles.algorithms.YPoint):boolean;
+ /**
+ * Checks whether a line segment intersects a box.
+ * Implemented using the Cohen-Sutherland algorithm.
+ * @param {yfiles.algorithms.YRectangle} box A rectangle
+ * @param {number} x1 X-coordinate of start point of vector
+ * @param {number} y1 Y-coordinate of start point of vector
+ * @param {number} x2 X-coordinate of target point of vector
+ * @param {number} y2 Y-coordinate of target point of vector
+ * @return {boolean}
+ * true if the line segments intersects the box,
+ * false otherwise.
+ */
+ boxIntersectsSegmentDouble(box:yfiles.algorithms.YRectangle,x1:number,y1:number,x2:number,y2:number):boolean;
+ /**
+ * Returns intersection point between the two line segments, if there is
+ * one or null if the two line segments do not intersect.
+ * @param {yfiles.algorithms.LineSegment} s1 first line segment
+ * @param {yfiles.algorithms.LineSegment} s2 second line segment
+ */
+ getIntersection(s1:yfiles.algorithms.LineSegment,s2:yfiles.algorithms.LineSegment):yfiles.algorithms.YPoint;
+ };
+ /**
+ * This class defines a rectangle and provides utility methods for it.
+ */
+ export interface YRectangle extends yfiles.algorithms.YDimension,yfiles.algorithms.IPlaneObject{
+ /**
+ * Returns the Manhattan distance to the passed rectangle.
+ * If they overlap the distance is 0.
+ * @param {yfiles.algorithms.YRectangle} other the second rectangle.
+ * @return {number} the distance to the given rectangle.
+ */
+ getManhattanDistance(other:yfiles.algorithms.YRectangle):number;
+ /**
+ * X-coordinate of upper left corner.
+ */
+ x:number;
+ /**
+ * Y-coordinate of upper left corner.
+ */
+ y:number;
+ /**
+ * Coordinates of upper left corner.
+ */
+ location:yfiles.algorithms.YPoint;
+ /**
+ * This object.
+ * @see Specified by {@link yfiles.algorithms.IPlaneObject#boundingBox}.
+ */
+ boundingBox:yfiles.algorithms.YRectangle;
+ /**
+ * Checks whether or not this YRectangle contains the
+ * given point.
+ * @param {number} x the x-coordinate of the point to check.
+ * @param {number} y the x-coordinate of the point to check.
+ * @return {boolean}
+ * true if the point lies inside the rectangle;
+ * false otherwise.
+ */
+ containsPointDouble(x:number,y:number):boolean;
+ /**
+ * Checks whether or not this YRectangle contains the
+ * given point.
+ */
+ contains(p:yfiles.algorithms.YPoint):boolean;
+ /**
+ * Checks whether or not this YRectangle contains the
+ * given rectangle.
+ */
+ containsRectangle(p:yfiles.algorithms.YRectangle):boolean;
+ /**
+ * Checks whether or not this YRectangle contains the
+ * rectangle defined by the given frame.
+ */
+ containsRectangleDouble(x:number,y:number,width:number,height:number):boolean;
+ /**
+ * Returns a string representation of this rectangle.
+ * @see Overrides {@link yfiles.algorithms.YDimension#toString}
+ */
+ toString():string;
+ /**
+ * @see Overrides {@link yfiles.algorithms.YDimension#hashCode}
+ */
+ hashCode():number;
+ /**
+ * @see Overrides {@link yfiles.algorithms.YDimension#equals}
+ */
+ equals(o:Object):boolean;
+ /**
+ * Compares this object to the given object of the same type.
+ * @param {Object} obj The object to compare this to.
+ * @return {number}
+ *
-1: this is less than obj
+ *
0: this is equal to obj
+ *
1: this is greater than obj
+ *
+ * @see Specified by {@link yfiles.lang.IObjectComparable#compareToObject}.
+ */
+ compareToObject(o:Object):number;
+ /**
+ * Creates a {@link yfiles.geometry.RectD} from a given {@link yfiles.algorithms.YRectangle}.
+ * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toRectD}.
+ * @return {yfiles.geometry.RectD} The {@link yfiles.geometry.RectD}.
+ */
+ toRectD():yfiles.geometry.RectD;
+ }
+ var YRectangle:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new rectangle with upper left corner (0,0) and size (0,0).
+ */
+ new ():yfiles.algorithms.YRectangle;
+ /**
+ * Creates a new rectangle with given upper left corner and size.
+ * @param {yfiles.algorithms.YPoint} pos upper left corner of the rectangle.
+ * @param {yfiles.algorithms.YDimension} size size of the rectangle.
+ */
+ FromPointAndSize:{
+ new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension):yfiles.algorithms.YRectangle;
+ };
+ /**
+ * Creates a new rectangle with given upper left corner and size.
+ * @param {number} x x-coordinate of upper left corner of the rectangle.
+ * @param {number} y y-coordinate of upper left corner of the rectangle.
+ * @param {number} width width of the rectangle.
+ * @param {number} height height of the rectangle.
+ */
+ FromDouble:{
+ new (x:number,y:number,width:number,height:number):yfiles.algorithms.YRectangle;
+ };
+ /**
+ * Determines whether the specified rectangle contains the specified point.
+ * @param {number} rx the x-coordinate of the upper left corner of the rectangle.
+ * @param {number} ry the y-coordinate of the upper left corner of the rectangle.
+ * @param {number} rw the width of the rectangle.
+ * @param {number} rh the height of the rectangle.
+ * @param {number} x the x-coordinate of the point to check.
+ * @param {number} y the x-coordinate of the point to check.
+ * @return {boolean}
+ * true if the point lies inside the rectangle;
+ * false otherwise.
+ */
+ containsRectangleCoordinates(rx:number,ry:number,rw:number,rh:number,x:number,y:number):boolean;
+ /**
+ * Determines whether the specified rectangle contains the specified point.
+ * @param {number} rx the x-coordinate of the upper left corner of the rectangle.
+ * @param {number} ry the y-coordinate of the upper left corner of the rectangle.
+ * @param {number} rw the width of the rectangle.
+ * @param {number} rh the height of the rectangle.
+ * @param {number} x the x-coordinate of the point to check.
+ * @param {number} y the x-coordinate of the point to check.
+ * @param {boolean} closed
+ * if true, all points on the border of the
+ * rectangle are considered to be contained.
+ * @return {boolean}
+ * true if the point lies inside the rectangle;
+ * false otherwise.
+ */
+ containsRectangleCoordinatesWithBorder(rx:number,ry:number,rw:number,rh:number,x:number,y:number,closed:boolean):boolean;
+ /**
+ * Returns whether or not the given rectangles intersect.
+ */
+ intersects(r1:yfiles.algorithms.YRectangle,r2:yfiles.algorithms.YRectangle):boolean;
+ };
+ /**
+ * This class represents a vector in the 2-dimensional real vector space.
+ * This vector is an ordered 2 tuple and is defined by two doubles.
+ */
+ export interface YVector extends Object{
+ /**
+ * The first coordinate of the vector.
+ */
+ x:number;
+ /**
+ * The second coordinate of the vector.
+ */
+ y:number;
+ /**
+ * Assigns unit length to the vector.
+ * Postcondition: length() == 1.
+ */
+ norm():void;
+ /**
+ * Returns a new YVector instance that is obtained by rotating
+ * this vector by the given angle (measured in radians) in clockwise
+ * direction (with regards to screen coordinates).
+ * Screen coordinates mean positive x-direction is from left to right and
+ * positive y-direction is from top to bottom.
+ * @param {number} angle the angle of rotation in radians.
+ * @return {yfiles.algorithms.YVector} the rotated vector.
+ */
+ rotate(angle:number):yfiles.algorithms.YVector;
+ /**
+ * Adds a vector to this vector.
+ * @param {yfiles.algorithms.YVector} v the vector to add.
+ */
+ add(v:yfiles.algorithms.YVector):void;
+ /**
+ * Scales the vector by an factor.
+ * @param {number} factor the scale factor, with which the length is multiplied.
+ */
+ scale(factor:number):void;
+ /**
+ * Returns the length of the vector, this is the value of the euclidean norm.
+ * @return {number} a value > 0.
+ */
+ length():number;
+ /**
+ * Returns a string representation of this vector.
+ */
+ toString():string;
+ /**
+ * Creates a {@link yfiles.geometry.PointD} from a given {@link yfiles.algorithms.YVector}.
+ * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toPointDFromVector}.
+ * @return {yfiles.geometry.PointD} The {@link yfiles.geometry.PointD}.
+ */
+ toPointD():yfiles.geometry.PointD;
+ }
+ var YVector:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new vector with given direction.
+ * @param {number} dx the first coordinate
+ * @param {number} dy the second coordinate
+ */
+ FromOrigin:{
+ new (dx:number,dy:number):yfiles.algorithms.YVector;
+ };
+ /**
+ * Creates a new vector which is a copy of another vector.
+ * @param {yfiles.algorithms.YVector} v the vector, whose values are copied.
+ */
+ FromVector:{
+ new (v:yfiles.algorithms.YVector):yfiles.algorithms.YVector;
+ };
+ /**
+ * Creates a new vector, whose direction is given by two points.
+ * The vector is defined by p1 - p2.
+ * @param {yfiles.algorithms.YPoint} p1 the first point.
+ * @param {yfiles.algorithms.YPoint} p2 the second point.
+ */
+ FromPoints:{
+ new (p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YVector;
+ };
+ /**
+ * Creates a new vector, whose direction is given by a point.
+ * The vector is defined by p1 - (0,0).
+ * @param {yfiles.algorithms.YPoint} p1 the point.
+ */
+ FromPoint:{
+ new (p1:yfiles.algorithms.YPoint):yfiles.algorithms.YVector;
+ };
+ /**
+ * Creates a new vector, whose direction is given by two points.
+ * The vector is defined by (x1 - x2, y1 - y2).
+ * @param {number} x1 the X-coordinate of the first point.
+ * @param {number} y1 the Y-coordinate of the first point.
+ * @param {number} x2 the X-coordinate of the second point.
+ * @param {number} y2 the Y-coordinate of the second point.
+ */
+ new (x1:number,y1:number,x2:number,y2:number):yfiles.algorithms.YVector;
+ /**
+ * Adds two vectors and returns the result.
+ * @param {yfiles.algorithms.YVector} v first vector to sum.
+ * @param {yfiles.algorithms.YVector} w second vector to sum.
+ * @return {yfiles.algorithms.YVector} v+w
+ */
+ addVectors(v:yfiles.algorithms.YVector,w:yfiles.algorithms.YVector):yfiles.algorithms.YVector;
+ /**
+ * Adds the vector to a point and returns the resulting point.
+ * @param {yfiles.algorithms.YPoint} p a point.
+ * @param {yfiles.algorithms.YVector} v the vector to add to the point.
+ * @return {yfiles.algorithms.YPoint} p+v
+ */
+ addPointToVector(p:yfiles.algorithms.YPoint,v:yfiles.algorithms.YVector):yfiles.algorithms.YPoint;
+ /**
+ * Returns true if vector v1 is on the right side of v2.
+ */
+ rightOf(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):boolean;
+ /**
+ * Returns this vector with unit length.
+ */
+ getNormal(v:yfiles.algorithms.YVector):yfiles.algorithms.YVector;
+ /**
+ * Returns the vector which is orthogonal to the given one and has unit
+ * length.
+ * @param {yfiles.algorithms.YVector} v a vector.
+ * @return {yfiles.algorithms.YVector} a vector which is orthogonal to v with unit length.
+ */
+ orthoNormal(v:yfiles.algorithms.YVector):yfiles.algorithms.YVector;
+ /**
+ * Returns the value of the scalar product of two vectors.
+ * @param {yfiles.algorithms.YVector} v1 the first vector.
+ * @param {yfiles.algorithms.YVector} v2 the second vector.
+ * @return {number} v1.x * v2.x + v1.y * v2.y
+ */
+ scalarProduct(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):number;
+ /**
+ * Returns the angle (measured in radians) between two vectors in
+ * clockwise order (with regards to screen coordinates) from v1 to v2.
+ * Screen coordinates mean positive x-direction is from left to right and
+ * positive y-direction is from top to bottom:
+ */
+ angle(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):number;
+ };
+ /**
+ * This class implements a directed graph structure.
+ * Basically, a directed graph consists of a set of objects called "nodes" (represented
+ * by instances of class {@link yfiles.algorithms.Node}) and a set of node pairs which are called
+ * "edges" (represented by instances of class {@link yfiles.algorithms.Edge}).
+ * The directed stems from the fact that all edges in the graph have direction,
+ * i.e., they have a distinct source node and a distinct target node.
+ * Using the aforementioned pair notation, an edge would be written as
+ * (<source node>, <target node>).
+ * Class Graph presents a proper data type that provides support for all essential
+ * operations like element creation, removal, access, and iteration.
+ * Important:
+ * Class Graph is the single authority for any structural changes to the graph data
+ * type.
+ * Specifically, this means that there is no way to create or delete a node or an
+ * edge without using an actual Graph instance.
+ * Furthermore, this class is also responsible for providing access to its elements.
+ * This is done by means of bidirectional cursors that present a read-only view
+ * on the node set (interface {@link yfiles.algorithms.INodeCursor}) and edge set (interface
+ * {@link yfiles.algorithms.IEdgeCursor}).
+ * Class Graph fires notification events that signal structural changes, like, e.g.,
+ * creation, removal, reinsertion, or modification of graph elements.
+ * Classes that implement the {@link yfiles.algorithms.IGraphListener} interface can be registered
+ * with this class using the {@link yfiles.algorithms.Graph#addGraphListener addGraphListener}
+ * method in order to receive such events.
+ * This class provides direct support for the notion of data accessors.
+ * It allows to register so-called data providers (implementations of interface
+ * {@link yfiles.algorithms.IDataProvider}) that hold arbitrary data which is associated to its nodes
+ * and/or edges.
+ * Also, it serves as a factory to create so-called maps ({@link yfiles.algorithms.INodeMap},
+ * {@link yfiles.algorithms.IEdgeMap}) that can be utilized to bind arbitrary data to nodes and edges.
+ * General Concepts in yFiles
+ * Working With the Graph Structure
+ */
+ export interface Graph extends Object,yfiles.algorithms.IGraphInterface{
+ /**
+ * The copy factory that is associated with this instance.
+ * The factory should be used by software that wants to create
+ * copies of this graph instance if it is in need of a factory.
+ * If no factory has been set, this method will initialize this instance's
+ * factory using factory method {@link yfiles.algorithms.Graph#createGraphCopyFactory}.
+ * @see {@link yfiles.algorithms.Graph#createGraphCopyFactory}
+ * @see {@link yfiles.algorithms.Graph#createGraphCopyFactory}
+ */
+ graphCopyFactory:yfiles.algorithms.GraphCopier.ICopyFactory;
+ /**
+ * Factory method that is called by {@link yfiles.algorithms.Graph#graphCopyFactory}
+ * to create a (possibly shared) instance.
+ * @return {yfiles.algorithms.GraphCopier.ICopyFactory} the (possibly shared) instance.
+ */
+ createGraphCopyFactory():yfiles.algorithms.GraphCopier.ICopyFactory;
+ /**
+ * Determines whether there are listeners registered with this instance.
+ */
+ hasListeners():boolean;
+ /**
+ * Creates a copy of this graph.
+ * Invokes .
+ * @return {yfiles.algorithms.Graph} The newly created Graph object.
+ */
+ createCopy():yfiles.algorithms.Graph;
+ /**
+ * Creates a new node in this graph and fires a corresponding notification event
+ * to inform registered listeners.
+ * @return {yfiles.algorithms.Node} The newly created Node object.
+ */
+ createNode():yfiles.algorithms.Node;
+ /**
+ * Creates a new edge in this graph and fires a corresponding notification event
+ * to inform registered listeners.
+ * The new edge has source node v and target node w,
+ * i.e., would be written as edge e = (v, w).
+ * The edge is appended to the lists of incoming and outgoing edges at the source
+ * node and target node, respectively.
+ * @param {yfiles.algorithms.Node} v The source node of the edge.
+ * @param {yfiles.algorithms.Node} w The target node of the edge.
+ * @return {yfiles.algorithms.Edge} The newly created Edge object.
+ */
+ createEdgeBetween(v:yfiles.algorithms.Node,w:yfiles.algorithms.Node):yfiles.algorithms.Edge;
+ /**
+ * Creates a new edge in this graph to be ordered before or after a given edge
+ * and fires a corresponding notification event to inform registered listeners.
+ * The new edge e has source node v and target node
+ * w, i.e., would be written as edge e = (v, w).
+ * Edge e is inserted in such a way that an iteration over the edges
+ * at node v returns e
+ *
+ *
+ * after e1, if d1 == AFTER
+ *
+ *
+ * before e1, if d1 == BEFORE,
+ *
+ *
+ * and an iteration over the edges at w returns e
+ *
+ *
+ * after e2, if d2 == AFTER
+ *
+ *
+ * before e2, if d2 == BEFORE.
+ *
+ *
+ * Precondition:
+ * Edge e1 must have source node v
+ * and
+ * edge e2 must have target node w.
+ * @param {yfiles.algorithms.Node} v The source node of the edge.
+ * @param {yfiles.algorithms.Edge} e1 An edge with source node v.
+ * @param {yfiles.algorithms.Node} w The target node of the edge.
+ * @param {yfiles.algorithms.Edge} e2 An edge with target node w.
+ * @param {yfiles.algorithms.GraphElementInsertion} d1
+ * One of the object insertion specifiers {@link yfiles.algorithms.GraphElementInsertion#BEFORE} or {@link yfiles.algorithms.GraphElementInsertion#AFTER}.
+ * @param {yfiles.algorithms.GraphElementInsertion} d2
+ * One of the object insertion specifiers {@link yfiles.algorithms.GraphElementInsertion#BEFORE} or {@link yfiles.algorithms.GraphElementInsertion#AFTER}.
+ * @return {yfiles.algorithms.Edge} The newly created Edge object.
+ */
+ createEdgeWithGraphElementInsertion(v:yfiles.algorithms.Node,e1:yfiles.algorithms.Edge,w:yfiles.algorithms.Node,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion):yfiles.algorithms.Edge;
+ /**
+ * Removes the given node from this graph.
+ * All edges connecting to the given node are removed as well (preceding the actual
+ * node removal).
+ * Corresponding notification events are fired to inform registered listeners.
+ * The node will be deselected before it gets removed.
+ * @param {yfiles.algorithms.Node} v The node to be removed from this graph.
+ */
+ removeNode(v:yfiles.algorithms.Node):void;
+ /**
+ * Removes the given edge from this graph and fires a corresponding notification
+ * event to inform registered listeners.
+ * The edge will be deselected before it gets removed.
+ * @param {yfiles.algorithms.Edge} e The edge to be removed.
+ */
+ removeEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Reinserts a formerly removed node into this graph and fires a corresponding
+ * notification event to inform registered listeners.
+ * The reinserted node is appended to the sequence of nodes in this graph, i.e.,
+ * normally, its new position does not match the position before its removal.
+ * @param {yfiles.algorithms.Node} v The node to be reinserted.
+ * @see {@link yfiles.algorithms.Graph#removeNode}
+ */
+ reInsertNode(v:yfiles.algorithms.Node):void;
+ /**
+ * Reinserts a formerly removed edge into this graph and fires a corresponding
+ * notification event to inform registered listeners.
+ * The reinserted edge is appended to the sequence of edges in this graph, i.e.,
+ * normally, its new position does not match the position before its removal.
+ * The same holds for the edge's positions in the list of incoming and outgoing
+ * edges at its source node and target node, respectively.
+ * @param {yfiles.algorithms.Edge} e The edge to be reinserted.
+ * @see {@link yfiles.algorithms.Graph#removeEdge}
+ */
+ reInsertEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Redefines an edge's end points and fires corresponding notification events
+ * to inform registered listeners.
+ * Edge e has
+ * source node v := e1.source()
+ * and
+ * target node w := e2.target().
+ * Edge e is inserted in such a way that an iteration over the edges
+ * at v returns e
+ *
+ *
+ * after e1, if d1 == AFTER
+ *
+ *
+ * before e1, if d1 == BEFORE,
+ *
+ *
+ * and an iteration over the edges at w returns e
+ *
+ *
+ * after e2, if d2 == AFTER
+ *
+ *
+ * before e2, if d2 == BEFORE.
+ *
+ *
+ * Precondition:
+ * Edges e, e1, and e2 must belong to this
+ * graph.
+ * @param {yfiles.algorithms.Edge} e The edge to be changed.
+ * @param {yfiles.algorithms.Edge} e1 Reference edge for insertion at a new source node.
+ * @param {yfiles.algorithms.Edge} e2 Reference edge for insertion at a new target node.
+ * @param {yfiles.algorithms.GraphElementInsertion} d1
+ * One of the object insertion specifiers {@link yfiles.algorithms.GraphElementInsertion#BEFORE} or {@link yfiles.algorithms.GraphElementInsertion#AFTER}.
+ * @param {yfiles.algorithms.GraphElementInsertion} d2
+ * One of the object insertion specifiers {@link yfiles.algorithms.GraphElementInsertion#BEFORE} or {@link yfiles.algorithms.GraphElementInsertion#AFTER}.
+ */
+ changeEdgeWithReferences(e:yfiles.algorithms.Edge,e1:yfiles.algorithms.Edge,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion):void;
+ /**
+ * Redefines an edge's end points and fires corresponding notification events
+ * to inform registered listeners.
+ * Edge e has
+ * source node v := sourceReference.source() or v := newSource,
+ * if sourceReference == null
+ * and
+ * target node w := targetReference.target() or w := newTarget,
+ * if targetReference == null.
+ * Edge e is inserted in such a way that an iteration over the edges
+ * at v returns e
+ *
+ *
+ * after sourceReference, if sourceD == AFTER
+ *
+ *
+ * before sourceReference, if sourceD == BEFORE,
+ *
+ *
+ * and an iteration over the edges at w returns e
+ *
+ *
+ * after targetReference, if targetD == AFTER
+ *
+ *
+ * before targetReference, if targetD == BEFORE.
+ *
+ *
+ * Precondition:
+ * Edge e must belong to this graph.
+ * Also, either sourceReference or newSource must be
+ * non-null and belong to this graph, and either targetReference
+ * or newTarget must be non-null and belong to this graph.
+ * @param {yfiles.algorithms.Edge} e The edge to be changed.
+ * @param {yfiles.algorithms.Node} newSource The new source node.
+ * @param {yfiles.algorithms.Edge} sourceReference Reference edge for insertion at the new source node.
+ * @param {yfiles.algorithms.GraphElementInsertion} sourceD
+ * One of the object insertion specifiers {@link yfiles.algorithms.GraphElementInsertion#BEFORE} or {@link yfiles.algorithms.GraphElementInsertion#AFTER}.
+ * @param {yfiles.algorithms.Node} newTarget The new target node.
+ * @param {yfiles.algorithms.Edge} targetReference Reference edge for insertion at the new target node.
+ * @param {yfiles.algorithms.GraphElementInsertion} targetD
+ * One of the object insertion specifiers {@link yfiles.algorithms.GraphElementInsertion#BEFORE} or {@link yfiles.algorithms.GraphElementInsertion#AFTER}.
+ */
+ changeEdgeWithReference(e:yfiles.algorithms.Edge,newSource:yfiles.algorithms.Node,sourceReference:yfiles.algorithms.Edge,sourceD:yfiles.algorithms.GraphElementInsertion,newTarget:yfiles.algorithms.Node,targetReference:yfiles.algorithms.Edge,targetD:yfiles.algorithms.GraphElementInsertion):void;
+ /**
+ * Redefines an edge's end points and fires corresponding notification events
+ * to inform registered listeners.
+ * The edge is appended to the lists of incoming and outgoing edges at the given
+ * source node and target node, respectively.
+ * Precondition:newSource and newTarget must belong to this graph.
+ * @param {yfiles.algorithms.Edge} e The edge to be changed.
+ * @param {yfiles.algorithms.Node} newSource The new source node of the given edge.
+ * @param {yfiles.algorithms.Node} newTarget The new target node of the given edge.
+ */
+ changeEdge(e:yfiles.algorithms.Edge,newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node):void;
+ /**
+ * Reverses the given edge and fires corresponding notification events to inform
+ * registered listeners.
+ * This operation exchanges source and target node of the edge.
+ */
+ reverseEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Hides the given edge from this graph.
+ * Hiding an edge means to (temporarily) remove the edge from the graph.
+ * The only difference to a proper edge removal as performed by {@link yfiles.algorithms.Graph#removeEdge}
+ * is that no {@link yfiles.algorithms.GraphEvent} will be emitted that signals the structural change
+ * (i.e. the edge's removal).
+ * Generally, hiding should only be used in the sense of temporarily removing
+ * an object that will be reinserted shortly after.
+ * To reinsert a hidden edge use {@link yfiles.algorithms.Graph#unhideEdge}.
+ * @see {@link yfiles.algorithms.Graph#hideNode}
+ * @see {@link yfiles.algorithms.Graph#unhideNode}
+ */
+ hideEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Unhides the given edge in this graph.
+ * Unhiding an edge means to reinsert an edge that was formerly hidden from this
+ * graph by a call to {@link yfiles.algorithms.Graph#hideEdge}.
+ * The only difference to a proper edge reinsertion as performed by {@link yfiles.algorithms.Graph#reInsertEdge}
+ * is that no {@link yfiles.algorithms.GraphEvent} will be emitted that signals the structural change
+ * (i.e. the edge's reinsertion).
+ * @see {@link yfiles.algorithms.Graph#hideNode}
+ * @see {@link yfiles.algorithms.Graph#unhideNode}
+ */
+ unhideEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Hides the given node from this graph.
+ * Hiding a node means to (temporarily) remove the node from the graph.
+ * The only difference to a proper node removal as performed by {@link yfiles.algorithms.Graph#removeNode}
+ * is that no {@link yfiles.algorithms.GraphEvent} will be emitted that signals the structural change
+ * (i.e. the node's removal).
+ * Generally, hiding should only be used in the sense of temporarily removing
+ * an object that will be reinserted shortly after.
+ * To reinsert a hidden node use {@link yfiles.algorithms.Graph#unhideNode}.
+ * @see {@link yfiles.algorithms.Graph#hideEdge}
+ * @see {@link yfiles.algorithms.Graph#unhideEdge}
+ */
+ hideNode(v:yfiles.algorithms.Node):void;
+ /**
+ * Unhides the given node in this graph.
+ * Unhiding a node means to reinsert a node that was formerly hidden from this
+ * graph by a call to {@link yfiles.algorithms.Graph#hideNode}.
+ * The only difference to a proper node reinsertion as performed by {@link yfiles.algorithms.Graph#reInsertNode}
+ * is that no {@link yfiles.algorithms.GraphEvent} will be emitted that signals the structural change
+ * (i.e. the node's reinsertion).
+ */
+ unhideNode(v:yfiles.algorithms.Node):void;
+ /**
+ * Moves the given node to the last position within the sequence of nodes in this
+ * graph.
+ */
+ moveToLastNode(v:yfiles.algorithms.Node):void;
+ /**
+ * Moves the given node to the first position within the sequence of nodes in
+ * this graph.
+ */
+ moveToFirstNode(v:yfiles.algorithms.Node):void;
+ /**
+ * Moves the given edge to the last position within the sequence of edges in this
+ * graph.
+ */
+ moveToLastEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * Moves the given edge to the first position within the sequence of edges in
+ * this graph.
+ */
+ moveToFirstEdge(e:yfiles.algorithms.Edge):void;
+ /**
+ * The number of nodes in this graph.
+ * Same as {@link yfiles.algorithms.Graph#nodeCount}.
+ */
+ n:number;
+ /**
+ * The number of nodes in this graph.
+ */
+ nodeCount:number;
+ /**
+ * The number of edges in this graph.
+ * Same as {@link yfiles.algorithms.Graph#edgeCount}.
+ */
+ e:number;
+ /**
+ * The number of edges in this graph.
+ */
+ edgeCount:number;
+ /**
+ * true if this graph contains no nodes.
+ */
+ empty:boolean;
+ /**
+ * Removes all nodes and edges from this graph and fires corresponding notification
+ * events to inform registered listeners.
+ */
+ clear():void;
+ /**
+ * Whether or not this graph contains the given node.
+ */
+ containsNode(v:yfiles.algorithms.Node):boolean;
+ /**
+ * Whether or not this graph contains the given edge.
+ */
+ containsEdge(e:yfiles.algorithms.Edge):boolean;
+ /**
+ * Returns whether or not this graph contains an edge that connects the given
+ * nodes.
+ * @param {yfiles.algorithms.Node} source The source node.
+ * @param {yfiles.algorithms.Node} target The target node.
+ * @see {@link yfiles.algorithms.Node#getEdgeTo}
+ * @see {@link yfiles.algorithms.Node#getEdgeFrom}
+ * @see {@link yfiles.algorithms.Node#getEdge}
+ */
+ containsEdgeBetweenNodes(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node):boolean;
+ /**
+ * The first node in this graph.
+ * Precondition:!isEmpty()
+ */
+ firstNode:yfiles.algorithms.Node;
+ /**
+ * The first edge in this graph.
+ * Precondition:edgeCount() > 0
+ */
+ firstEdge:yfiles.algorithms.Edge;
+ /**
+ * The last node in this graph.
+ * Precondition:!isEmpty()
+ */
+ lastNode:yfiles.algorithms.Node;
+ /**
+ * The last edge in this graph.
+ * Precondition:edgeCount() > 0
+ */
+ lastEdge:yfiles.algorithms.Edge;
+ /**
+ * Returns an array containing all nodes of this graph.
+ */
+ getNodeArray():yfiles.algorithms.Node[];
+ /**
+ * Returns an array containing all edges of this graph.
+ */
+ getEdgeArray():yfiles.algorithms.Edge[];
+ /**
+ * Provides access to the nodes of the graph.
+ * @return {yfiles.algorithms.INodeCursor} A NodeCursor to iterate over the nodes in the graph.
+ */
+ getNodeCursor():yfiles.algorithms.INodeCursor;
+ /**
+ * Provides access to the edges of the graph.
+ * @return {yfiles.algorithms.IEdgeCursor} An EdgeCursor to iterate over the edges in the graph.
+ */
+ getEdgeCursor():yfiles.algorithms.IEdgeCursor;
+ /**
+ * Moves an induced subgraph to another graph.
+ * Precondition: The nodes in subNodes must belong to this graph.
+ * @param {yfiles.algorithms.NodeList} subNodes A list of nodes that induce the subgraph to be moved.
+ * @param {yfiles.algorithms.Graph} targetGraph The graph where the subgraph is moved to.
+ * @return {yfiles.algorithms.EdgeList} A list of removed edges that connected the induced subgraph to this graph.
+ */
+ moveSubGraph(subNodes:yfiles.algorithms.NodeList,targetGraph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList;
+ /**
+ * Creates an empty base object of the same type as this graph.
+ * Subclasses should override this method.
+ */
+ createGraph():yfiles.algorithms.Graph;
+ /**
+ * Sorts the internally held list of edges.
+ * If the given comparator is null, then the edges will not be sorted.
+ * This list determines the order of the edges as returned by {@link yfiles.algorithms.Graph#getEdgeCursor}.
+ * @param {yfiles.objectcollections.IComparer} comp The comparator used for the edges.
+ */
+ sortEdges(comp:yfiles.objectcollections.IComparer):void;
+ /**
+ * Sorts the internally held list of nodes.
+ * If the given comparator is null, then the nodes will not be sorted.
+ * This list determines the order of the nodes as returned by {@link yfiles.algorithms.Graph#getNodeCursor}.
+ * @param {yfiles.objectcollections.IComparer} comp The comparator used for the nodes.
+ */
+ sortNodes(comp:yfiles.objectcollections.IComparer):void;
+ /**
+ * Sorts incoming and outgoing edges at each node of the graph.
+ * If a given comparator is null, then the corresponding edges (i.e.,
+ * incoming/outgoing) will not be sorted.
+ * This sorts the order of the edges as returned by {@link yfiles.algorithms.Node#getOutEdgeCursor}
+ * and {@link yfiles.algorithms.Node#getInEdgeCursor} respectively.
+ * @param {yfiles.objectcollections.IComparer} inComp The comparator used for the incoming edges at each node.
+ * @param {yfiles.objectcollections.IComparer} outComp The comparator used for the outgoing edges at each node.
+ */
+ sortEdgesInAndOut(inComp:yfiles.objectcollections.IComparer,outComp:yfiles.objectcollections.IComparer):void;
+ /**
+ * Registers the given graph listener with this graph.
+ * The listener will receive graph events that signal structural changes occurring
+ * within this graph.
+ * @see {@link yfiles.algorithms.GraphEvent}
+ */
+ addGraphListener(listener:yfiles.algorithms.IGraphListener):void;
+ /**
+ * Removes the given graph listener from this graph.
+ */
+ removeGraphListener(listener:yfiles.algorithms.IGraphListener):void;
+ /**
+ * An iterator that grants access to all registered graph listeners.
+ */
+ graphListeners:yfiles.algorithms.IIterator;
+ /**
+ * Propagates a so-called PRE event to all registered graph listeners.
+ * This method should only be used if a corresponding call to {@link yfiles.algorithms.Graph#firePostEvent}
+ * follows.
+ * Generally, PRE and POST events serve as a means to bracket a sequence of graph
+ * events.
+ * @see {@link yfiles.algorithms.IGraphListener}
+ */
+ firePreEvent():void;
+ /**
+ * Like {@link yfiles.algorithms.Graph#firePreEvent}.
+ * Additionally, an event ID may be specified.
+ * @param {Object} id An identifying tag for the event.
+ * @see {@link yfiles.algorithms.IGraphListener}
+ */
+ firePreEventWithId(id:Object):void;
+ /**
+ * Propagates a so-called POST event to all registered graph listeners.
+ * This method should only be used if a corresponding call to {@link yfiles.algorithms.Graph#firePreEvent}
+ * was made.
+ * Generally, PRE and POST events serve as a means to bracket a sequence of graph
+ * events.
+ * @see {@link yfiles.algorithms.IGraphListener}
+ */
+ firePostEvent():void;
+ /**
+ * Like {@link yfiles.algorithms.Graph#firePostEvent}.
+ * Additionally, an event ID may be specified.
+ * @param {Object} id An identifying tag for the event.
+ * @see {@link yfiles.algorithms.IGraphListener}
+ */
+ firePostEventWithId(id:Object):void;
+ /**
+ * Propagates the given graph event to all registered graph listeners.
+ */
+ fireGraphEvent(e:yfiles.algorithms.GraphEvent):void;
+ /**
+ * Returns a newly created node map that is valid for the nodes in this graph.
+ * The implementation returned by this method can be used for any node that is
+ * part of this Graph instance at any point of time, i.e., it is safe to modify
+ * the graph structure (add and remove nodes and edges) freely.
+ * The implementation returned uses O(n) memory at all times and
+ * provides true O(1) read and write access for each node.
+ * In order to release the resources held by this map, {@link yfiles.algorithms.Graph#disposeNodeMap}
+ * has to be called.
+ */
+ createNodeMap():yfiles.algorithms.INodeMap;
+ /**
+ * Returns a newly created edge map that is valid for the edges in this graph.
+ * The implementation returned by this method can be used for any edge that is
+ * part of this Graph instance at any point of time, i.e., it is safe to modify
+ * the graph structure (add and remove nodes and edges) freely.
+ * The implementation returned uses O(m) memory at all times and
+ * provides true O(1) read and write access for each edge.
+ * In order to release the resources held by this map, {@link yfiles.algorithms.Graph#disposeEdgeMap}
+ * has to be called.
+ */
+ createEdgeMap():yfiles.algorithms.IEdgeMap;
+ /**
+ * Informs the graph that the given node map is no longer needed.
+ * This method is used for NodeMap implementations that have been obtained using
+ * the {@link yfiles.algorithms.Graph#createNodeMap} factory method.
+ * Calling this method will destroy the node map and associated resources can
+ * be freed.
+ * It is strongly recommended to dispose of all node maps that are not needed
+ * anymore using this method.
+ */
+ disposeNodeMap(map:yfiles.algorithms.INodeMap):void;
+ /**
+ * Informs the graph that the given edge map is no longer needed.
+ * This method is used for EdgeMap implementations that have been obtained using
+ * the {@link yfiles.algorithms.Graph#createEdgeMap} factory method.
+ * Calling this method will destroy the edge map and associated resources can
+ * be freed.
+ * It is strongly recommended to dispose of all edge maps that are not needed
+ * anymore using this method.
+ */
+ disposeEdgeMap(map:yfiles.algorithms.IEdgeMap):void;
+ /**
+ * All node maps that have been created by this graph but have not yet
+ * been disposed.
+ * @see {@link yfiles.algorithms.Graph#createNodeMap}
+ * @see {@link yfiles.algorithms.Graph#disposeNodeMap}
+ */
+ registeredNodeMaps:yfiles.algorithms.INodeMap[];
+ /**
+ * All edge maps that have been created by this graph but have not yet
+ * been disposed.
+ * @see {@link yfiles.algorithms.Graph#createEdgeMap}
+ * @see {@link yfiles.algorithms.Graph#disposeEdgeMap}
+ */
+ registeredEdgeMaps:yfiles.algorithms.IEdgeMap[];
+ /**
+ * Returns the source node associated with the given edge.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#getSource}.
+ */
+ getSource(edge:Object):Object;
+ /**
+ * Returns the target node associated with the given edge.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#getTarget}.
+ */
+ getTarget(edge:Object):Object;
+ /**
+ * Returns an iterator that provides access to all nodes residing in this graph.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#nodeObjects}.
+ */
+ nodeObjects():yfiles.algorithms.IIterator;
+ /**
+ * Returns an iterator that provides access to all edges residing in this graph.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#edgeObjects}.
+ */
+ edgeObjects():yfiles.algorithms.IIterator;
+ /**
+ * Returns the data provider that is registered with the graph using the given
+ * look-up key.
+ * The look-up domain of a returned data provider normally consists of either
+ * the nodes of the graph, or its edges, or both.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#getDataProvider}.
+ */
+ getDataProvider(providerKey:Object):yfiles.algorithms.IDataProvider;
+ /**
+ * Registers the given data provider using the given look-up key.
+ * If there is already a data provider registered with that key, then it will
+ * be overwritten with the new one.
+ */
+ addDataProvider(providerKey:Object,data:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Removes the data provider that is registered using the given look-up key.
+ */
+ removeDataProvider(providerKey:Object):void;
+ /**
+ * An array of all data provider look-up keys that are registered with
+ * this graph.
+ * @see Specified by {@link yfiles.algorithms.IGraphInterface#dataProviderKeys}.
+ */
+ dataProviderKeys:Object[];
+ /**
+ * For internal debugging purposes only.
+ */
+ printNodeSlotSize():void;
+ /**
+ * Returns a String representation of this graph.
+ * The result contains the String representations of all nodes followed by the
+ * String representations of all edges.
+ */
+ toString():string;
+ /**
+ * Yields a dynamic {@link yfiles.collections.IEnumerable}
+ * for {@link yfiles.algorithms.Node}s that can be used to iterate over the nodes that are contained in this instance.
+ * This is a live enumerable and will thus reflect the current state of the graph.
+ * Note that changes to the graph structure during the traversal should be carried out with great care.
+ */
+ nodes:yfiles.collections.IEnumerable;
+ /**
+ * Yields a dynamic {@link yfiles.collections.IEnumerable}
+ * for {@link yfiles.algorithms.Edge}s that can be used to iterate over the edges that are contained in this instance.
+ * This is a live enumerable and will thus reflect the current state of the graph.
+ * Note that changes to the graph structure during the traversal should be carried out with great care.
+ */
+ edges:yfiles.collections.IEnumerable;
+ }
+ var Graph:{
+ $class:yfiles.lang.Class;
+ /**
+ * Instantiates an empty Graph object.
+ */
+ new ():yfiles.algorithms.Graph;
+ /**
+ * Instantiates a new Graph object as a copy of the given graph.
+ * Values bound to the argument graph via node and edge keys are available in
+ * the new Graph instance with the keys registered with argGraph.
+ * Only references to these values are copied.
+ * The new Graph instance also inherits all graph listeners registered with the
+ * given graph.
+ * This constructor does not use a {@link yfiles.algorithms.GraphCopier}.
+ * @param {yfiles.algorithms.Graph} argGraph The graph to be copied.
+ */
+ FromOther:{
+ new (argGraph:yfiles.algorithms.Graph):yfiles.algorithms.Graph;
+ };
+ /**
+ * Instantiates a new Graph object as a partial copy of the given graph.
+ * Only the subgraph induced by the given cursor will be copied to the new Graph
+ * instance.
+ * Values bound to the argument graph via node and edge keys are available in
+ * the new Graph instance with the keys registered with graph.
+ * Only references to these values are copied.
+ * The new Graph instance also inherits all graph listeners registered with the
+ * given graph.
+ * This constructor does not use a {@link yfiles.algorithms.GraphCopier}.
+ * @param {yfiles.algorithms.Graph} graph The graph to be (partially) copied.
+ * @param {yfiles.algorithms.ICursor} subNodes
+ * A cursor to iterate over the nodes that actually induce the subgraph to be
+ * copied.
+ */
+ FromSubset:{
+ new (graph:yfiles.algorithms.Graph,subNodes:yfiles.algorithms.ICursor):yfiles.algorithms.Graph;
+ };
+ /**
+ * Low-level iteration support for adjacent edges.
+ */
+ firstOutEdge(v:yfiles.algorithms.Node):yfiles.algorithms.Edge;
+ };
+ /**
+ * This class represents an ordered list of points in the plane.
+ */
+ export interface YPointPath extends Object{
+ /**
+ * Get the points in the path.
+ */
+ cursor():yfiles.algorithms.ICursor;
+ /**
+ * Get the points in the path.
+ */
+ points():yfiles.algorithms.IPointCursor;
+ /**
+ * Get the points in the path.
+ */
+ iterator():yfiles.algorithms.IIterator;
+ /**
+ * The first point in the path.
+ */
+ first:yfiles.algorithms.YPoint;
+ /**
+ * The last point in the path.
+ */
+ last:yfiles.algorithms.YPoint;
+ /**
+ * Get the points in the path as list.
+ * @return {yfiles.algorithms.IList}
+ * a list of {@link yfiles.algorithms.YPoint} instances.
+ */
+ toList():yfiles.algorithms.IList;
+ /**
+ * Get the points in the list as array.
+ */
+ toArray():yfiles.algorithms.YPoint[];
+ /**
+ * Create a point path with reverse ordering of the points.
+ */
+ createReverse():yfiles.algorithms.YPointPath;
+ /**
+ * Get the number of points in the path.
+ */
+ length():number;
+ /**
+ * The number of line segments in the path.
+ */
+ lineSegmentCount:number;
+ /**
+ * Get the points in the path.
+ */
+ lineSegments():yfiles.algorithms.ILineSegmentCursor;
+ /**
+ * Returns a line segment in the path.
+ */
+ getLineSegment(i:number):yfiles.algorithms.LineSegment;
+ toString():string;
+ /**
+ * Calculate the (geometric) length of the path.
+ * The length of the path is the sum of lengths of all line segments making
+ * up the path.
+ * @return {number} the (geometric) length of the path
+ */
+ calculateLength():number;
+ }
+ var YPointPath:{
+ $class:yfiles.lang.Class;
+ /**
+ * Defines a path with no points.
+ */
+ EMPTY_PATH:yfiles.algorithms.YPointPath;
+ /**
+ * Creates a new empty path.
+ */
+ new ():yfiles.algorithms.YPointPath;
+ /**
+ * Creates a new path from a list of points.
+ * @param {yfiles.algorithms.IList} l
+ * a list of {@link yfiles.algorithms.YPoint} instances.
+ */
+ FromList:{
+ new (l:yfiles.algorithms.IList):yfiles.algorithms.YPointPath;
+ };
+ /**
+ * Creates a new path from an array of points.
+ */
+ FromPoints:{
+ new (path:yfiles.algorithms.YPoint[]):yfiles.algorithms.YPointPath;
+ };
+ };
+ /**
+ * This class represents the size of an object.
+ * An instance of this class implements the immutable design pattern.
+ */
+ export interface YDimension extends Object,yfiles.lang.IObjectComparable{
+ /**
+ * The width of the dimension object.
+ */
+ width:number;
+ /**
+ * The height of the dimension object.
+ */
+ height:number;
+ /**
+ * Tests a dimension to equality to another dimension.
+ */
+ equals(o:Object):boolean;
+ hashCode():number;
+ /**
+ * Returns the size in the form: "W: width H: height"
+ */
+ toString():string;
+ /**
+ * Compares this object to the given object of the same type.
+ * @param {Object} obj The object to compare this to.
+ * @return {number}
+ *
-1: this is less than obj
+ *
0: this is equal to obj
+ *
1: this is greater than obj
+ *
+ * @see Specified by {@link yfiles.lang.IObjectComparable#compareToObject}.
+ */
+ compareToObject(o:Object):number;
+ /**
+ * Creates a {@link yfiles.geometry.SizeD} from a given {@link yfiles.algorithms.YDimension}.
+ * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toSizeD}.
+ * @return {yfiles.geometry.SizeD} The {@link yfiles.geometry.SizeD}.
+ */
+ toSizeD():yfiles.geometry.SizeD;
+ }
+ var YDimension:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new YDimension2D object for given size.
+ */
+ new (width:number,height:number):yfiles.algorithms.YDimension;
+ };
+ /**
+ * An oriented rectangle in 2D coordinate space with double precision
+ * coordinates.
+ * The rectangle's height extends from its
+ * {@link yfiles.algorithms.YOrientedRectangle#anchor anchor point} in the direction of its up
+ * vector ({@link yfiles.algorithms.YOrientedRectangle#upX ux}, {@link yfiles.algorithms.YOrientedRectangle#upY uy}).
+ * Its width extends from its
+ * {@link yfiles.algorithms.YOrientedRectangle#anchor anchor point} in direction
+ * (-uy, ux) (i.e. perpendicular to the up vector).
+ * This means that an oriented rectangle with anchor point (0, 0)
+ * width 100, height 10, and up vector
+ * (0, -1) is a paraxial rectangle with upper left corner
+ * (0, -10) and lower right corner (100, 0).
+ */
+ export interface YOrientedRectangle extends Object,yfiles.algorithms.IPlaneObject{
+ /**
+ * Specifies whether this instance has negative width or height.
+ */
+ empty:boolean;
+ /**
+ * The anchor of this oriented rectangle.
+ */
+ anchor:yfiles.algorithms.YPoint;
+ /**
+ * Sets the anchor of this rectangle.
+ * @param {number} x the new x-coordinate of the anchor point.
+ * @param {number} y the new y-coordinate of the anchor point.
+ */
+ setAnchor(x:number,y:number):void;
+ /**
+ * The x-coordinate of this rectangle's anchor point.
+ */
+ anchorX:number;
+ /**
+ * The y-coordinate of this rectangle's anchor point.
+ */
+ anchorY:number;
+ /**
+ * The size of this rectangle.
+ */
+ size:yfiles.algorithms.YDimension;
+ /**
+ * Sets the size of this rectangle.
+ * @param {number} width the new width.
+ * @param {number} height the new height.
+ */
+ setSize(width:number,height:number):void;
+ /**
+ * The width of this rectangle.
+ */
+ width:number;
+ /**
+ * The height of this rectangle.
+ */
+ height:number;
+ /**
+ * Sets the components of the up vector to the new values.
+ * @param {number} upX The x component of the normalized up vector.
+ * @param {number} upY The y component of the normalized up vector.
+ */
+ setUpVector(upX:number,upY:number):void;
+ /**
+ * The x-component of this rectangle's up vector.
+ */
+ upX:number;
+ /**
+ * The y-component of this rectangle's up vector.
+ */
+ upY:number;
+ /**
+ * The angle (measured in radians) of this rectangle.
+ * The angle of an oriented rectangle is the angle between the vector
+ * (0, -1) and the rectangle's up vector in counter clockwise
+ * order.
+ * An angle of 0 means the up vector points up in direction (0, -1).
+ */
+ angle:number;
+ /**
+ * Moves this rectangle by applying the offset to the anchor.
+ * @param {number} dx The x offset to move the rectangle's position by.
+ * @param {number} dy The y offset to move the rectangle's position by.
+ */
+ moveBy(dx:number,dy:number):void;
+ /**
+ * The current center of the oriented rectangle.
+ */
+ center:yfiles.algorithms.YPoint;
+ /**
+ * Sets the anchor of the OrientedRectangle so that the center of the
+ * rectangle coincides with the given coordinate pair.
+ * @param {number} cx The x coordinate of the center.
+ * @param {number} cy The y coordinate of the center.
+ */
+ setCenter(cx:number,cy:number):void;
+ /**
+ * Calculates the paraxial bounding box of this oriented rectangle.
+ * @see Specified by {@link yfiles.algorithms.IPlaneObject#boundingBox}.
+ */
+ boundingBox:yfiles.algorithms.YRectangle;
+ /**
+ * Determines whether or not the specified point lies inside this oriented
+ * rectangle.
+ * @param {number} x the x-coordinate of the point to check.
+ * @param {number} y the y-coordinate of the point to check.
+ * @return {boolean}
+ * true iff the specified point lies inside;
+ * false otherwise.
+ */
+ containsPoint(x:number,y:number):boolean;
+ /**
+ * Determines whether or not the specified point lies inside this oriented
+ * rectangle.
+ * @param {number} x the x-coordinate of the point to check.
+ * @param {number} y the y-coordinate of the point to check.
+ * @param {boolean} closed
+ * if true, all points on the border of the
+ * rectangle are considered to be contained.
+ * @return {boolean}
+ * true iff the specified point lies inside;
+ * false otherwise.
+ */
+ containsPointWithBorder(x:number,y:number,closed:boolean):boolean;
+ toString():string;
+ equals(o:Object):boolean;
+ hashCode():number;
+ /**
+ * Creates a new OrientedRectangle instance whose anchor point
+ * is moved by the specified distance values, but has the same width, height,
+ * and up vector as this rectangle.
+ * @param {number} dx
+ * the distance to move the anchor point in x-direction. A positive
+ * value means "move" to the right, a negative value means "move" to the left.
+ * @param {number} dy
+ * the distance to move the anchor point in y-direction. A positive
+ * value means "move" downwards, a negative value means "move" upwards.
+ * @return {yfiles.algorithms.YOrientedRectangle}
+ * a new OrientedRectangle instance whose anchor point
+ * is moved by the specified distance values.
+ */
+ getMovedInstance(dx:number,dy:number):yfiles.algorithms.YOrientedRectangle;
+ /**
+ * Creates a new OrientedRectangle instance that has the
+ * specified width and height, but has the same anchor point and up vector
+ * as this rectangle.
+ * @param {number} width the width of the new rectangle.
+ * @param {number} height the height of the new rectangle.
+ * @return {yfiles.algorithms.YOrientedRectangle}
+ * a new OrientedRectangle instance that has the
+ * specified width and height.
+ */
+ getResizedInstance(width:number,height:number):yfiles.algorithms.YOrientedRectangle;
+ /**
+ * Copies the actual values from the given OrientedRectangle to this instance.
+ * @param {yfiles.algorithms.YOrientedRectangle} other the OrientedRectangle to retrieve the values from
+ */
+ adoptValues(other:yfiles.algorithms.YOrientedRectangle):void;
+ /**
+ * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} from a given {@link yfiles.algorithms.YOrientedRectangle}.
+ * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toImmutableOrientedRectangle}.
+ * @return {yfiles.geometry.IOrientedRectangle} The {@link yfiles.geometry.IOrientedRectangle}.
+ */
+ toImmutableOrientedRectangle():yfiles.geometry.IOrientedRectangle;
+ }
+ var YOrientedRectangle:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new instance using the provided rectangle's values to initialize
+ * anchor and size.
+ * The oriented rectangle's up vector will be
+ * (0, -1).
+ * @param {yfiles.algorithms.YRectangle} rect the provided rectangle.
+ */
+ FromRect:{
+ new (rect:yfiles.algorithms.YRectangle):yfiles.algorithms.YOrientedRectangle;
+ };
+ /**
+ * Creates a new instance using the provided rectangle's values to initialize
+ * anchor, size, and up vector.
+ * @param {yfiles.algorithms.YOrientedRectangle} rect the provided rectangle.
+ */
+ YOrientedRectangle:{
+ new (rect:yfiles.algorithms.YOrientedRectangle):yfiles.algorithms.YOrientedRectangle;
+ };
+ /**
+ * Creates a new instance using the provided values to initialize the anchor and size.
+ * The oriented rectangle's up vector will be (0, -1).
+ * @param {yfiles.algorithms.YPoint} anchor The provider for the dynamic anchor of this instance.
+ * @param {yfiles.algorithms.YDimension} size The provider for the dynamic size of this instance.
+ */
+ FromAnchorAndSize:{
+ new (anchor:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension):yfiles.algorithms.YOrientedRectangle;
+ };
+ /**
+ * Creates a new instance using the provided values to initialize anchor,
+ * size, and up vector.
+ * @param {yfiles.algorithms.YPoint} position The provider for the dynamic anchor of this instance.
+ * @param {yfiles.algorithms.YDimension} size The provider for the dynamic size of this instance.
+ * @param {yfiles.algorithms.YVector} upVector The up vector.
+ */
+ FromPositionSizeAndUpVector:{
+ new (position:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,upVector:yfiles.algorithms.YVector):yfiles.algorithms.YOrientedRectangle;
+ };
+ /**
+ * Creates a new instance using the provided values to initialize anchor and
+ * size.
+ * The oriented rectangle's up vector will be
+ * (0, -1).
+ * @param {number} anchorX The x coordinate of the anchor of the oriented rectangle.
+ * @param {number} anchorY The y coordinate of the anchor of the oriented rectangle.
+ * @param {number} width The width of the rectangle.
+ * @param {number} height The height of the rectangle.
+ */
+ FromAnchorXAnchorYWidthAndHeight:{
+ new (anchorX:number,anchorY:number,width:number,height:number):yfiles.algorithms.YOrientedRectangle;
+ };
+ /**
+ * Creates a new instance using the provided values to initialize anchor,
+ * size, and up vector.
+ * @param {number} anchorX The x coordinate of the anchor of the oriented rectangle.
+ * @param {number} anchorY The y coordinate of the anchor of the oriented rectangle.
+ * @param {number} width The width of the rectangle.
+ * @param {number} height The height of the rectangle.
+ * @param {number} upX The x component of the up vector.
+ * @param {number} upY The y component of the up vector.
+ */
+ FromAnchorXAnchorYWidthHeightUpXAndUpY:{
+ new (anchorX:number,anchorY:number,width:number,height:number,upX:number,upY:number):yfiles.algorithms.YOrientedRectangle;
+ };
+ /**
+ * Determines the four corner points of an oriented rectangle.
+ * @param {yfiles.algorithms.YOrientedRectangle} rect The rectangle to determine the bounds.
+ * @return {yfiles.algorithms.YPoint[]} the array of corner points.
+ */
+ calcPoints(rect:yfiles.algorithms.YOrientedRectangle):yfiles.algorithms.YPoint[];
+ /**
+ * Determines whether a rectangle intersects an oriented rectangle, given an epsilon.
+ * @param {yfiles.algorithms.YOrientedRectangle} orientedRectangle The oriented rectangle to test.
+ * @param {yfiles.algorithms.YRectangle} rectangle The rectangle to test.
+ * @param {number} eps
+ * A positive value allows for fuzzy hit testing. If the point lies outside the given object
+ * but it's distance is less than or equal to that value, it will be considered a hit.
+ * @return {boolean} Whether they have a non-empty intersection.
+ */
+ intersectsRectangle(orientedRectangle:yfiles.algorithms.YOrientedRectangle,rectangle:yfiles.algorithms.YRectangle,eps:number):boolean;
+ /**
+ * Determines whether the given oriented rectangle contains the provided
+ * point, using an epsilon value.
+ * @param {yfiles.algorithms.YOrientedRectangle} rect The rectangle.
+ * @param {yfiles.algorithms.YPoint} p The point to test.
+ * @param {number} eps
+ * fuzziness range. A positive value allows for fuzzy hit testing.
+ * If a point lies outside the given rectangle, but its distance is less than
+ * or equal to that value, it will be considered a hit.
+ * @return {boolean}
+ * true if the point lies inside the rectangle;
+ * false otherwise.
+ */
+ containsPointWithEps(rect:yfiles.algorithms.YOrientedRectangle,p:yfiles.algorithms.YPoint,eps:number):boolean;
+ /**
+ * Determines whether the given oriented rectangle contains the provided
+ * point, using an epsilon value.
+ * @param {yfiles.algorithms.YOrientedRectangle} rect The rectangle.
+ * @param {number} x x-coordinate of the point to test.
+ * @param {number} y y-coordinate of the point to test.
+ * @param {number} eps
+ * fuzziness range. A positive value allows for fuzzy hit testing.
+ * If a point lies outside the given rectangle, but its distance is less than
+ * or equal to that value, it will be considered a hit.
+ * @return {boolean}
+ * true if the point lies inside the rectangle;
+ * false otherwise.
+ */
+ containsPointCoordsWithEps(rect:yfiles.algorithms.YOrientedRectangle,x:number,y:number,eps:number):boolean;
+ /**
+ * Determines whether the given rectangle r1 contains rectangle r2, using an epsilon value.
+ * @param {yfiles.algorithms.YOrientedRectangle} r1 The first rectangle.
+ * @param {yfiles.algorithms.YOrientedRectangle} r2 The second rectangle.
+ * @param {number} eps
+ * A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's
+ * distance is less than or equal to that value, it will be considered a hit.
+ * @return {boolean} true iff the r1 contains r2.
+ */
+ containsRectangle(r1:yfiles.algorithms.YOrientedRectangle,r2:yfiles.algorithms.YOrientedRectangle,eps:number):boolean;
+ /**
+ * Determines whether or not the specified oriented rectangle and the
+ * specified line segment intersect.
+ * @return {boolean}
+ * true if the rectangle and the segment intersect and
+ * false otherwise.
+ */
+ intersectsLine(rect:yfiles.algorithms.YOrientedRectangle,line:yfiles.algorithms.LineSegment,eps:number):boolean;
+ /**
+ * Determines an intersection point of the specified oriented rectangle and
+ * the specified line segment.
+ * Note: there might be more than one intersection point. However this method only returns one intersection point
+ * or null if there is no intersection.
+ * @return {yfiles.algorithms.YPoint}
+ * an intersection point of the specified oriented rectangle and
+ * the specified line segment or null if the rectangle and the
+ * segment do not intersect.
+ */
+ intersectionPoint(rect:yfiles.algorithms.YOrientedRectangle,line:yfiles.algorithms.LineSegment,eps:number):yfiles.algorithms.YPoint;
+ };
+ /**
+ * This class represents a point in the plane with double coordinates.
+ * This class implements the immutable design pattern.
+ */
+ export interface YPoint extends Object,yfiles.lang.IObjectComparable{
+ /**
+ * The x-coordinate of the point object.
+ */
+ x:number;
+ /**
+ * The y-coordinate of the point object.
+ */
+ y:number;
+ /**
+ * Returns the euclidean distance between this point and a given point.
+ * @param {number} x the x coordinate of an arbitrary point
+ * @param {number} y the y coordinate of an arbitrary point
+ * @return {number} the Euclidean distance between this point and the point (x,y).
+ */
+ distanceToDouble(x:number,y:number):number;
+ /**
+ * Returns the euclidean distance between this point and a given point.
+ * @param {yfiles.algorithms.YPoint} p an arbitrary point
+ * @return {number} the Euclidean distance between this point and p.
+ */
+ distanceTo(p:yfiles.algorithms.YPoint):number;
+ /**
+ * Returns the point, got by moving this point to another position.
+ * @param {number} x the value which is added on the x-coordinate of the point.
+ * @param {number} y the value which is added on the y-coordinate of the point.
+ * @return {yfiles.algorithms.YPoint}
+ * a new instance of YPoint which is the result of the moving
+ * operation.
+ */
+ moveBy(x:number,y:number):yfiles.algorithms.YPoint;
+ /**
+ * Tests a point to equality to another point.
+ * This test returns true if the o is also an instance of
+ * YPoint and has the same coordinates as the instance on which equals is
+ * invoked.
+ * @param {Object} o an arbitrary instance.
+ */
+ equals(o:Object):boolean;
+ hashCode():number;
+ /**
+ * Returns the coordinates of the point as string.
+ */
+ toString():string;
+ /**
+ * Comparable implementation.
+ * YPoints are ordered by ascending x-coordinates.
+ * If the x-coordinates of two points equal, then these points are ordered by
+ * ascending y-coordinates.
+ * @see Specified by {@link yfiles.lang.IObjectComparable#compareToObject}.
+ */
+ compareToObject(o:Object):number;
+ /**
+ * Creates a {@link yfiles.geometry.PointD} from a given {@link yfiles.algorithms.YPoint}.
+ * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toPointD}.
+ * @return {yfiles.geometry.PointD} The {@link yfiles.geometry.PointD}.
+ */
+ toPointD():yfiles.geometry.PointD;
+ }
+ var YPoint:{
+ $class:yfiles.lang.Class;
+ /**
+ * A YPoint constant with coordinates (0,0).
+ */
+ ORIGIN:yfiles.algorithms.YPoint;
+ /**
+ * Creates a new YPoint at location (0,0).
+ */
+ AtOrigin:{
+ new ():yfiles.algorithms.YPoint;
+ };
+ /**
+ * Creates a new YPoint object for a given position.
+ * @param {number} x the x coordinate of the point.
+ * @param {number} y the y coordinate of the point.
+ */
+ new (x:number,y:number):yfiles.algorithms.YPoint;
+ /**
+ * Returns the euclidean distance between two points.
+ * @param {yfiles.algorithms.YPoint} p1 an arbitrary point
+ * @param {yfiles.algorithms.YPoint} p2 an arbitrary point
+ * @return {number} the Euclidean distance between p1 and p2.
+ */
+ distance(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):number;
+ /**
+ * Returns the euclidean distance between two points.
+ * @param {number} x1 x-coordinate of first point
+ * @param {number} y1 y-coordinate of first point
+ * @param {number} x2 x-coordinate of second point
+ * @param {number} y2 y-coordinate of second point
+ * @return {number} the euclidean distance between first and second point
+ */
+ distanceDouble(x1:number,y1:number,x2:number,y2:number):number;
+ /**
+ * Adds two points and returns the result.
+ * @param {yfiles.algorithms.YPoint} p1 an arbitrary instance of YPoint.
+ * @param {yfiles.algorithms.YPoint} p2 an arbitrary instance of YPoint.
+ */
+ add(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint;
+ /**
+ * Subtracts two points (p1 - p2) and returns the result.
+ * @param {yfiles.algorithms.YPoint} p1 an arbitrary instance of YPoint.
+ * @param {yfiles.algorithms.YPoint} p2 an arbitrary instance of YPoint.
+ */
+ subtract(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint;
+ /**
+ * Returns a point that geometrically lies in
+ * in the middle of the line formed by the given points.
+ * @param {yfiles.algorithms.YPoint} p1 an arbitrary instance of YPoint.
+ * @param {yfiles.algorithms.YPoint} p2 an arbitrary instance of YPoint.
+ */
+ midPoint(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint;
+ /**
+ * Returns a copy of the given point with exchanged
+ * x- and y-coordinates.
+ * @param {yfiles.algorithms.YPoint} p an arbitrary instance of YPoint.
+ */
+ swap(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint;
+ };
+ export enum BfsDirection{
+ /**
+ * Edge direction specifier for incoming edges.
+ * @see {@link yfiles.algorithms.Bfs#getLayersWithDirection}
+ */
+ PREDECESSOR,
+ /**
+ * Edge direction specifier for outgoing edges.
+ * @see {@link yfiles.algorithms.Bfs#getLayersWithDirection}
+ */
+ SUCCESSOR,
+ /**
+ * Edge direction specifier for both incoming and outgoing edges.
+ * @see {@link yfiles.algorithms.Bfs#getLayersWithDirection}
+ */
+ BOTH
+ }
+ export enum GraphEventType{
+ /**
+ * Type constant that identifies an event that gets fired immediately after a
+ * node has been created.
+ * The data of the event is the newly created node.
+ */
+ NODE_CREATION,
+ /**
+ * Type constant that identifies an event that gets fired immediately after an
+ * edge has been created.
+ * The data of the event is the newly created edge.
+ */
+ EDGE_CREATION,
+ /**
+ * Type constant that identifies an event that gets fired immediately before a
+ * node will be removed from the graph.
+ * The data of the event is the node to be removed.
+ */
+ PRE_NODE_REMOVAL,
+ /**
+ * Type constant that identifies an event that gets fired immediately after a
+ * node has been removed from the graph.
+ * The data of the event is the removed node.
+ */
+ POST_NODE_REMOVAL,
+ /**
+ * Type constant that identifies an event that gets fired immediately before an
+ * edge will be removed from the graph.
+ * The data of the event is the edge to be removed.
+ */
+ PRE_EDGE_REMOVAL,
+ /**
+ * Type constant that identifies an event that gets fired immediately after an
+ * edge has been removed from the graph.
+ * The data of the event is the removed edge.
+ */
+ POST_EDGE_REMOVAL,
+ /**
+ * Type constant that identifies an event that gets fired immediately after a
+ * node has been reinserted into the graph.
+ * The data of the event is the reinserted node.
+ */
+ NODE_REINSERTION,
+ /**
+ * Type constant that identifies an event that gets fired immediately after an
+ * edge has been reinserted into the graph.
+ * The data of the event is the reinserted edge.
+ */
+ EDGE_REINSERTION,
+ /**
+ * Type constant that identifies an event that gets fired immediately before the
+ * end points of an edge will be changed.
+ * The data of the event is the edge to be redefined.
+ */
+ PRE_EDGE_CHANGE,
+ /**
+ * Type constant that identifies an event that gets fired immediately after the
+ * end points of an edge have been changed.
+ * The data of the event is the redefined edge.
+ */
+ POST_EDGE_CHANGE,
+ /**
+ * Type constant that identifies an event that gets fired after a subgraph of
+ * a graph G has been moved to the emitting graph.
+ * The data of the event is a {@link yfiles.algorithms.NodeList} containing the nodes that induce
+ * the moved subgraph.
+ * This event gets fired just after the {@link yfiles.algorithms.GraphEventType#SUBGRAPH_REMOVAL} event got fired
+ * on the subgraph's original graph G.
+ * Note that at the time the event gets fired, the nodes from the node list are
+ * already part of the emitting graph.
+ */
+ SUBGRAPH_INSERTION,
+ /**
+ * Type constant that identifies an event that gets fired after a subgraph of
+ * the emitting graph has been moved to a graph G.
+ * The data of the event is a {@link yfiles.algorithms.NodeList} containing the nodes that induce
+ * the moved subgraph.
+ * This event gets fired just before the {@link yfiles.algorithms.GraphEventType#SUBGRAPH_INSERTION} event will
+ * be fired on the subgraph's new graph G.
+ * Note that at the time the event gets fired, the nodes from the node list are
+ * already part of graph G.
+ */
+ SUBGRAPH_REMOVAL,
+ /**
+ * Type constant that signals the start of a some logically coherent event sequence.
+ * If specified, the data of this event is its ID.
+ */
+ PRE_EVENT,
+ /**
+ * Type constant that signals the end of a some logically coherent event sequence.
+ * If specified, the data of this event is its ID.
+ */
+ POST_EVENT
+ }
+ /**
+ * This class represents a line in the 2D-dimensional affine space.
+ * The line is defined by the equation ax + by + c = 0
+ */
+ export interface AffineLine extends Object{
+ /**
+ * A from ax+by+c = 0.
+ */
+ a:number;
+ /**
+ * B from ax+by+c = 0.
+ */
+ b:number;
+ /**
+ * C from ax+by+c = 0.
+ */
+ c:number;
+ /**
+ * Returns the equation of the line as String.
+ */
+ toString():string;
+ /**
+ * Projects an point on the line in direction of the X-axis.
+ */
+ getXProjection(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint;
+ /**
+ * Projects an point on the line in direction of the Y-axis.
+ */
+ getYProjection(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint;
+ }
+ var AffineLine:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates an affine line which is defined by a point
+ * and a vector.
+ */
+ FromPointAndVector:{
+ new (p1:yfiles.algorithms.YPoint,v:yfiles.algorithms.YVector):yfiles.algorithms.AffineLine;
+ };
+ /**
+ * Creates an affine line which is defined by two points.
+ */
+ new (p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.AffineLine;
+ /**
+ * Returns the crossing of two lines.
+ * If the lines are parallel, null is returned.
+ */
+ getCrossing(l1:yfiles.algorithms.AffineLine,l2:yfiles.algorithms.AffineLine):yfiles.algorithms.YPoint;
+ };
+ export enum GraphElementInsertion{
+ /**
+ * Object insertion specifier.
+ * An object gets inserted before another one.
+ */
+ BEFORE,
+ /**
+ * Object insertion specifier.
+ * An object gets inserted after another one.
+ */
+ AFTER
+ }
+ /**
+ * This is an interface for a sequence of instances of LineSegment.
+ */
+ export interface ILineSegmentCursor extends Object,yfiles.algorithms.ICursor{
+ /**
+ * The instance of LineSegment the cursor is currently pointing on.
+ * @see Specified by {@link yfiles.algorithms.ILineSegmentCursor#lineSegment}.
+ */
+ lineSegment:yfiles.algorithms.LineSegment;
+ }
+ var ILineSegmentCursor:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * This class calculates the intersection of rectangles in the plane with
+ * the help of a sweep-line algorithm.
+ * The complexity is O(n log n + s) where n
+ * is the number of rectangles and s the number of intersections.
+ */
+ export interface IntersectionAlgorithm extends Object{
+ }
+ export module IntersectionAlgorithm{
+ /**
+ * An instance of this interface handles intersections found by the
+ * IntersectionAlgorithm,.
+ */
+ export interface IIntersectionHandler extends Object{
+ /**
+ * This method is called at every intersection.
+ * @see Specified by {@link yfiles.algorithms.IntersectionAlgorithm.IIntersectionHandler#checkIntersection}.
+ */
+ checkIntersection(a:Object,b:Object):void;
+ }
+ }
+ var IntersectionAlgorithm:{
+ $class:yfiles.lang.Class;
+ /**
+ * Calculates the intersections of rectangles in the plane.
+ * Every found intersection is reported to an
+ * IntersectionHandler.
+ * Rectangles with negative size are completely ignored by this implementation (i.e.
+ * never generate intersections)
+ * @param {yfiles.algorithms.YList} objects a list of PlaneObject objects.
+ * @param {yfiles.algorithms.IntersectionAlgorithm.IIntersectionHandler} iHandler intersections are reported to this class.
+ */
+ intersect(objects:yfiles.algorithms.YList,iHandler:yfiles.algorithms.IntersectionAlgorithm.IIntersectionHandler):void;
+ /**
+ * Initializes the sweep line data structures from a set of objects.
+ */
+ createXStruct(objects:yfiles.algorithms.YList):yfiles.algorithms.YList;
+ };
+ /**
+ * This class provides useful geometric primitives and advanced
+ * geometric algorithms.
+ * This class is intended to provide static methods for geometric
+ * calculations. It can be compared to the class java.lang.Math
+ * which provides methods for general mathematical calculations.
+ */
+ export interface Geom extends Object{
+ }
+ var Geom:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns the orientation of point r relative to the directed
+ * line from point p to point q.
+ * The given tuple of points is said to have positive orientation if
+ * p and q are distinct and r lies
+ * to the left of the oriented line passing through p
+ * and q and oriented from p to q.
+ * The tuple is said to have negative orientation if
+ * p and q are distinct and r lies
+ * to the right of the line, and the tuple is said to have orientation zero
+ * if the three points are collinear.
+ * @return {number}
+ * +1 in the case of positive orientation, -1 in the
+ * case of negative orientation and 0 in the case of zero
+ * orientation.
+ */
+ orientation(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):number;
+ /**
+ * Same as {@link yfiles.algorithms.Geom#orientation} with double values as arguments.
+ */
+ orientationDouble(px:number,py:number,qx:number,qy:number,rx:number,ry:number):number;
+ /**
+ * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) > 0}.
+ */
+ leftTurn(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean;
+ /**
+ * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) < 0}.
+ */
+ rightTurn(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean;
+ /**
+ * Returns true iff the given points are collinear, i.e.
+ * all
+ * three points lie on a common line.
+ * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) == 0}
+ */
+ collinear(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean;
+ /**
+ * Returns +1 if point d lies left of the directed circle through
+ * points a, b, and c,
+ * 0 if a,b,c and d are cocircular, and -1 otherwise.
+ */
+ sideOfCircle(a:yfiles.algorithms.YPoint,b:yfiles.algorithms.YPoint,c:yfiles.algorithms.YPoint,d:yfiles.algorithms.YPoint):number;
+ /**
+ * Calculates the convex hull for a set of points.
+ * Complexity:O(n)*log(n), n := points.size()
+ * @param {yfiles.algorithms.YList} points
+ * a list of {@link yfiles.algorithms.YPoint} objects
+ * @return {yfiles.algorithms.YList}
+ * a list of {@link yfiles.algorithms.YPoint} objects that constitute the convex hull of
+ * the given points. The list contains points in counter clockwise order
+ * around the hull. The first point is the one with the smallest
+ * x coordinate. If two such points exist then of these points
+ * the one with the smallest y coordinate is chosen as the first
+ * one.
+ */
+ calcConvexHull(points:yfiles.algorithms.YList):yfiles.algorithms.YList;
+ /**
+ * Converts the given degree value from angular to radian.
+ */
+ toRadians(angdeg:number):number;
+ /**
+ * Converts the given degree value from radian to angular.
+ */
+ toDegrees(angrad:number):number;
+ /**
+ * Calculates the intersection point of two affine lines.
+ * Each line is given by a point and a direction vector.
+ * @param {yfiles.algorithms.YPoint} p1 origin point of the first line.
+ * @param {yfiles.algorithms.YVector} d1 direction vector of the first line.
+ * @param {yfiles.algorithms.YPoint} p2 origin point of the second line.
+ * @param {yfiles.algorithms.YVector} d2 direction vector of the second line.
+ * @return {yfiles.algorithms.YPoint}
+ * the intersection point of the specified lines or null
+ * if there is no intersection.
+ */
+ calcIntersectionWithPointsAndVectors(p1:yfiles.algorithms.YPoint,d1:yfiles.algorithms.YVector,p2:yfiles.algorithms.YPoint,d2:yfiles.algorithms.YVector):yfiles.algorithms.YPoint;
+ /**
+ * Calculates the intersection point of two affine lines.
+ * Each line is given by two points.
+ * @param {yfiles.algorithms.YPoint} p1 one point on the first line.
+ * @param {yfiles.algorithms.YPoint} p2 another point on the first line.
+ * @param {yfiles.algorithms.YPoint} p3 one point on the second line.
+ * @param {yfiles.algorithms.YPoint} p4 another point on the second line.
+ * @return {yfiles.algorithms.YPoint}
+ * the intersection point of the specified lines or null
+ * if there is no intersection.
+ */
+ calcIntersectionWithPoints(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint,p3:yfiles.algorithms.YPoint,p4:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint;
+ /**
+ * Calculates the intersection point of two affine lines.
+ * Each line is given by the coordinates of two points.
+ * @param {number} x1 x-coordinate of one point on the first line.
+ * @param {number} y1 y-coordinate of one point on the first line.
+ * @param {number} x2 x-coordinate of another point on the first line.
+ * @param {number} y2 y-coordinate of another point on the first line.
+ * @param {number} x3 x-coordinate of one point on the second line.
+ * @param {number} y3 y-coordinate of one point on the second line.
+ * @param {number} x4 x-coordinate of another point on the second line.
+ * @param {number} y4 y-coordinate of another point on the second line.
+ * @return {yfiles.algorithms.YPoint}
+ * the intersection point of the specified lines or null
+ * if there is no intersection.
+ */
+ calcIntersectionWithCoordinates(x1:number,y1:number,x2:number,y2:number,x3:number,y3:number,x4:number,y4:number):yfiles.algorithms.YPoint;
+ /**
+ * Returns whether the two lines defined by the given coordinates intersect or not.
+ */
+ linesIntersect(x1:number,y1:number,x2:number,y2:number,x3:number,y3:number,x4:number,y4:number):boolean;
+ /**
+ * Determines the projection of the point p onto the line
+ * segment [l1, l2].
+ * The resulting point is
+ *
+ *
the orthogonal projection of p onto the line through
+ * l1 and l2, iff the projection lies on the
+ * line segment [l1, l2]
+ *
the end point of the line segment [l1, l2] that is closest
+ * to p
, otherwise
+ *
+ * @param {number} pointX the x coordinate of p
+ * @param {number} pointY the y coordinate of p
+ * @param {number} lineX1 the x coordinate of l1
+ * @param {number} lineY1 the y coordinate of l1
+ * @param {number} lineX2 the x coordinate of l2
+ * @param {number} lineY2 the y coordinate of l2
+ */
+ projection(pointX:number,pointY:number,lineX1:number,lineY1:number,lineX2:number,lineY2:number):yfiles.algorithms.YPoint;
+ /**
+ * Determines the distance of the point p to the line segment
+ * [l1, l2].
+ * @param {number} pointX the x coordinate of p
+ * @param {number} pointY the y coordinate of p
+ * @param {number} lineX1 the x coordinate of l1
+ * @param {number} lineY1 the y coordinate of l1
+ * @param {number} lineX2 the x coordinate of l2
+ * @param {number} lineY2 the y coordinate of l2
+ */
+ distanceToLineSegment(pointX:number,pointY:number,lineX1:number,lineY1:number,lineX2:number,lineY2:number):number;
+ /**
+ * Unions the pair of source Rectangle2D objects
+ * and puts the result into the specified destination
+ * Rectangle2D object.
+ * If one of the source rectangles has negative width or height,
+ * it is excluded from the union.
+ * If both source rectangles have negative width or height,
+ * the destination rectangle will become a copy of r1.
+ * One of the source rectangles can also be the destination to avoid creating
+ * a third Rectangle2D object, but in this case the original points of this
+ * source rectangle will be overwritten by this method.
+ * If the destination is null, a new Rectangle2D
+ * is created.
+ * @param {yfiles.algorithms.Rectangle2D} r1
+ * the first of a pair of Rectangle2D
+ * objects to be combined with each other
+ * @param {yfiles.algorithms.Rectangle2D} r2
+ * the second of a pair of Rectangle2D
+ * objects to be combined with each other
+ * @param {yfiles.algorithms.Rectangle2D} dest
+ * the Rectangle2D that holds the
+ * results of the union of r1 and
+ * r2
+ */
+ calcUnion(r1:yfiles.algorithms.Rectangle2D,r2:yfiles.algorithms.Rectangle2D,dest:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D;
+ /**
+ * Intersects the pair of specified source Rectangle2D
+ * objects and puts the result into the specified destination
+ * Rectangle2D object.
+ * If one or both of the source rectangles have negative width or height,
+ * the resulting rectangle will be located at (0,0) with a width and height
+ * of -1.
+ * One of the source rectangles can also be the destination to avoid
+ * creating a third Rectangle2D object, but in this case the original
+ * points of this source rectangle will be overwritten by this method.
+ * @param {yfiles.algorithms.Rectangle2D} r1
+ * the first of a pair of Rectangle2D
+ * objects to be intersected with each other
+ * @param {yfiles.algorithms.Rectangle2D} r2
+ * the second of a pair of Rectangle2D
+ * objects to be intersected with each other
+ * @param {yfiles.algorithms.Rectangle2D} dest
+ * the Rectangle2D that holds the
+ * results of the intersection of r1 and
+ * r2
+ */
+ calcIntersection(r1:yfiles.algorithms.Rectangle2D,r2:yfiles.algorithms.Rectangle2D,dest:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D;
+ };
+ /**
+ * Specialized list implementation for instances of type {@link yfiles.algorithms.Edge}.
+ */
+ export interface EdgeList extends yfiles.algorithms.YList{
+ /**
+ * Returns an edge cursor for this edge list.
+ * @return {yfiles.algorithms.IEdgeCursor} An edge cursor granting access to the edges within this list.
+ */
+ edges():yfiles.algorithms.IEdgeCursor;
+ /**
+ * Returns the first edge in this list, or null when the list is
+ * empty.
+ * @return {yfiles.algorithms.Edge} The first edge in the list.
+ */
+ firstEdge():yfiles.algorithms.Edge;
+ /**
+ * Returns the last edge in this list, or null when the list is empty.
+ * @return {yfiles.algorithms.Edge} The last edge in the list.
+ */
+ lastEdge():yfiles.algorithms.Edge;
+ /**
+ * Removes the first edge from this list and returns it.
+ * @return {yfiles.algorithms.Edge} The first edge from the list.
+ */
+ popEdge():yfiles.algorithms.Edge;
+ /**
+ * Returns an edge array containing all elements of this list in the canonical
+ * order.
+ */
+ toEdgeArray():yfiles.algorithms.Edge[];
+ getEnumerator():yfiles.collections.IEnumerator;
+ }
+ var EdgeList:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates an empty edge list.
+ */
+ new ():yfiles.algorithms.EdgeList;
+ /**
+ * Creates a list that is initialized with the edges provided by the given array
+ * of edges.
+ */
+ FromEdgeArray:{
+ new (a:yfiles.algorithms.Edge[]):yfiles.algorithms.EdgeList;
+ };
+ /**
+ * Creates a list that is initialized with the edges provided by the given EdgeCursor
+ * object.
+ */
+ FromEdgeCursor:{
+ new (c:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.EdgeList;
+ };
+ /**
+ * Creates a list that is initialized with those edges from the given EdgeCursor
+ * object for which the given data provider returns true upon
+ * calling its {@link yfiles.algorithms.IDataProvider#getBool getBool} method.
+ * @param {yfiles.algorithms.IEdgeCursor} ec An edge cursor providing edges that should be added to this list.
+ * @param {yfiles.algorithms.IDataProvider} predicate
+ * A data provider that acts as a inclusion predicate for each edge accessible
+ * by the given edge cursor.
+ */
+ FromEdgeCursorFiltered:{
+ new (ec:yfiles.algorithms.IEdgeCursor,predicate:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList;
+ };
+ /**
+ * Creates a list that is initialized with the elements provided by the given
+ * Iterator object.
+ */
+ FromIterator:{
+ new (it:yfiles.algorithms.IIterator):yfiles.algorithms.EdgeList;
+ };
+ /**
+ * Creates a list that is initialized with a single edge provided.
+ */
+ WithEdge:{
+ new (e:yfiles.algorithms.Edge):yfiles.algorithms.EdgeList;
+ };
+ /**
+ * Creates a list that is initialized with an EdgeList.
+ */
+ FromEdgeList:{
+ new (edgeList:yfiles.algorithms.EdgeList):yfiles.algorithms.EdgeList;
+ };
+ };
+ /**
+ * This class can be used to easily model an orthogonal
+ * border line or sky-line.
+ * It provides methods for measuring
+ * the distance between different BorderLine instances, merging
+ * multiple instances, modifying and efficiently moving them around.
+ */
+ export interface BorderLine extends Object{
+ /**
+ * Creates a copy of this borderline.
+ * Optionally negates the values or offsets.
+ * @param {boolean} negateValues whether the values are negated
+ * @param {boolean} negateOffsets whether the offsets are negated
+ * @return {yfiles.algorithms.BorderLine} the copy of the borderline
+ */
+ createCopy(negateValues:boolean,negateOffsets:boolean):yfiles.algorithms.BorderLine;
+ /**
+ * Assures that all values in the given interval are less or equal than the given value.
+ * @param {number} min the lower end of the interval
+ * @param {number} max the upper end of the interval
+ * @param {number} value the greatest possible value for the interval
+ */
+ setMinValue(min:number,max:number,value:number):void;
+ /**
+ * Assures that all values in the given interval are greater or equal than the given value.
+ * @param {number} min the lower end of the interval
+ * @param {number} max the upper end of the interval
+ * @param {number} value the smallest possible value for the interval
+ */
+ setMaxValue(min:number,max:number,value:number):void;
+ /**
+ * Convenience method that copies the actual data from the given
+ * argument to this instance.
+ * @param {yfiles.algorithms.BorderLine} other the argument to retrieve the values from
+ */
+ adoptValues(other:yfiles.algorithms.BorderLine):void;
+ /**
+ * Sets a specific interval described by min and max to a given value.
+ * @param {number} min the left side of the interval.
+ * @param {number} max the right side of the interval.
+ * @param {number} value the value for the whole interval.
+ */
+ setValue(min:number,max:number,value:number):void;
+ /**
+ * Sets a specific interval to a slope starting at a given value.
+ * @param {number} min the left side of the interval.
+ * @param {number} max the right side of the interval.
+ * @param {number} value the value at min where the slope starts.
+ * @param {number} slope the slope of the segment in the given interval.
+ * @throws {yfiles.system.ArgumentException} if min is greater than max.
+ */
+ setSloped(min:number,max:number,value:number,slope:number):void;
+ /**
+ * Adds the given offset to the current values of
+ * the whole borderline.
+ * This method has complexity O(1).
+ * @param {number} delta the delta to add to the values
+ */
+ addValueOffset(delta:number):void;
+ /**
+ * Adds the given offset to the segments' positions.
+ * This method has complexity O(1).
+ * @param {number} delta the delta to add to the positions
+ */
+ addOffset(delta:number):void;
+ /**
+ * The smallest position of this borderline.
+ */
+ min:number;
+ /**
+ * The greatest position of this borderline.
+ */
+ max:number;
+ /**
+ * The minimum value that is set on this borderline.
+ */
+ minValue:number;
+ /**
+ * The maximum value that is set on this borderline.
+ */
+ maxValue:number;
+ /**
+ * Returns the value that is set on this borderline
+ * at the specified position.
+ * @param {number} pos the position
+ * @return {number} the value
+ * @throws {yfiles.system.IndexOutOfRangeException} if the position is outside of the borderline.
+ */
+ getValueAt(pos:number):number;
+ /**
+ * Returns the value that is set on this borderline at the specified position.
+ * The position must lie within the range of the segment that is stored in cell.
+ * @param {yfiles.algorithms.ListCell} cell The list cell containing the segment whose value shall be returned.
+ * @param {number} pos the position
+ * @return {number} the value
+ * @throws {yfiles.system.ArgumentException} if pos is outside the segment's range that is stored in cell.
+ */
+ getValueAtWithListCell(cell:yfiles.algorithms.ListCell,pos:number):number;
+ /**
+ * Returns the value that is set on this borderline at the specified position.
+ * The position must lie within the range of the segment.
+ * @param {yfiles.algorithms.BorderLine.Segment} segment The segment whose value shall be returned.
+ * @param {number} pos the position where the value will be retrieved.
+ * @return {number} the value
+ * @throws {yfiles.system.ArgumentException} if pos is outside the segment's range.
+ */
+ getValueAtWithSegment(segment:yfiles.algorithms.BorderLine.Segment,pos:number):number;
+ /**
+ * Merges this borderline with the given borderline
+ * using the "maximum" policy.
+ * That means the resulting borderline will have greater value of both borderline on each position. If you imagine
+ * each borderline as a the upper border of a plane, the resulting borderline will be the upper border of the merged
+ * planes.
+ * @param {yfiles.algorithms.BorderLine} other the other borderline
+ * @return {yfiles.algorithms.BorderLine} a new borderline that is the result of the merge
+ */
+ createMax(other:yfiles.algorithms.BorderLine):yfiles.algorithms.BorderLine;
+ /**
+ * Merges this borderline with the given borderline
+ * using the "minimum" policy.
+ * That means the resulting borderline will have smaller value of both borderline on each position. If you imagine
+ * each borderline as a the lower border of a plane, the resulting borderline will be the lower border of the merged
+ * planes.
+ * @param {yfiles.algorithms.BorderLine} other the other borderline
+ * @return {yfiles.algorithms.BorderLine} a new borderline that is the result of the merge
+ */
+ createMin(other:yfiles.algorithms.BorderLine):yfiles.algorithms.BorderLine;
+ /**
+ * Merges this borderline with the given borderline
+ * using the "maximum" policy.
+ * @param {yfiles.algorithms.BorderLine} other the other borderline
+ */
+ mergeWithMax(other:yfiles.algorithms.BorderLine):void;
+ /**
+ * Merges this borderline with the given borderline
+ * using the "minimum" policy.
+ * @param {yfiles.algorithms.BorderLine} other the other borderline
+ */
+ mergeWithMin(other:yfiles.algorithms.BorderLine):void;
+ /**
+ * Returns the value of the minimum of the given segment.
+ * If the segment's slope is 0, it's the value of the whole
+ * segment. In case the slope differs from 0, it's the value of the start of the slope.
+ * @param {yfiles.algorithms.BorderLine.Segment} s the segment
+ */
+ getValue(s:yfiles.algorithms.BorderLine.Segment):number;
+ /**
+ * Returns the minimum position of the given segment.
+ * @param {yfiles.algorithms.BorderLine.Segment} s the segment
+ */
+ getMin(s:yfiles.algorithms.BorderLine.Segment):number;
+ /**
+ * Returns the slope of the given segment.
+ * @param {yfiles.algorithms.BorderLine.Segment} s the segment
+ */
+ getSlope(s:yfiles.algorithms.BorderLine.Segment):number;
+ /**
+ * Returns the segment at the given position.
+ * @param {number} pos the position
+ */
+ getSegmentAt(pos:number):yfiles.algorithms.BorderLine.Segment;
+ /**
+ * Returns the maximum position of the given segment.
+ * @param {yfiles.algorithms.BorderLine.Segment} s the segment
+ */
+ getMax(s:yfiles.algorithms.BorderLine.Segment):number;
+ /**
+ * Returns the first segment or null if there is
+ * no such segment.
+ */
+ firstSegment():yfiles.algorithms.BorderLine.Segment;
+ /**
+ * Returns the last segment or null if there is
+ * no such segment.
+ */
+ lastSegment():yfiles.algorithms.BorderLine.Segment;
+ /**
+ * Returns the previous segment or null if there is
+ * no such segment.
+ */
+ prev(s:yfiles.algorithms.BorderLine.Segment):yfiles.algorithms.BorderLine.Segment;
+ /**
+ * Returns the next segment or null if there is
+ * no such segment.
+ */
+ next(s:yfiles.algorithms.BorderLine.Segment):yfiles.algorithms.BorderLine.Segment;
+ /**
+ * Calculates the maximum value in the interval from->to.
+ */
+ getMaxValue(from:number,to:number):number;
+ /**
+ * Calculates the minimum value in the interval from->to.
+ */
+ getMinValue(from:number,to:number):number;
+ /**
+ * Calculates the minimal distance between this borderline and the other one.
+ * The other one is treated as if the values were all greater.
+ */
+ getDistanceTo(greater:yfiles.algorithms.BorderLine):number;
+ /**
+ * Returns a lengthy String representation of this borderline.
+ */
+ toString():string;
+ /**
+ * Grows this BorderLine horizontally, so that the {@link yfiles.algorithms.BorderLine#getValueAtWithSegment values}
+ * of the BorderLine stay the same however their {@link yfiles.algorithms.BorderLine#getMin start} and
+ * {@link yfiles.algorithms.BorderLine#getMax end} points are moved in the direction of toMin
+ * and toMax.
+ * This is useful for scenarios where a BorderLine is needed that consists of an enlarged border.
+ *
+ * Note that this method normalizes the segments, i.e., it transforms each segment with slope != 0 to
+ * a segment with slope == 0.
+ *
+ * @param {number} toMin the delta by which the border should be extended towards -Infinity
+ * @param {number} toMax the delta by which the border should be extended towards +Infinity
+ * @param {boolean} positive
+ * whether the BorderLine should be interpreted to point in positive direction. This influences the
+ * direction into which a segment's border is extended.
+ */
+ grow(toMin:number,toMax:number,positive:boolean):void;
+ }
+ export module BorderLine{
+ /**
+ * The handle of a segment of a borderline.
+ */
+ export interface Segment extends Object{
+ /**
+ * Returns the segment's value at the given position.
+ * Note: In case the position lies outside the segments range, the calculated value might be invalid. As the segment
+ * is not aware of any offsets the position also must not include any offsets.
+ * @param {number} position the position the value is retrieved for.
+ * @return {number} the segment's value at the given position.
+ */
+ getValueAt(position:number):number;
+ /**
+ * The end of this segment.
+ */
+ end:number;
+ /**
+ * Returns the previous segment or null if there is
+ * no such segment.
+ */
+ prev():yfiles.algorithms.BorderLine.Segment;
+ /**
+ * Returns the next segment or null if there is
+ * no such segment.
+ */
+ next():yfiles.algorithms.BorderLine.Segment;
+ toString():string;
+ }
+ }
+ var BorderLine:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new BorderLine with the given value
+ * from -Double.MAX_VALUE to Double.MAX_VALUE.
+ * @param {number} value the value of the segment
+ */
+ WithValue:{
+ new (value:number):yfiles.algorithms.BorderLine;
+ };
+ /**
+ * Creates a new BorderLine from a single segment.
+ * @param {number} min the beginning of this borderline
+ * @param {number} max the ending of this borderline
+ * @param {number} value the value of the segment
+ */
+ FromMinToMax:{
+ new (min:number,max:number,value:number):yfiles.algorithms.BorderLine;
+ };
+ /**
+ * Creates a new BorderLine from a single segment.
+ * @param {number} min the beginning of this borderline
+ * @param {number} max the ending of this borderline
+ * @param {number} valueAtMin the value of the segment at the beginning of this borderline
+ * @param {number} valueAtMax the value of the segment at the ending of this borderline
+ */
+ FromSegment:{
+ new (min:number,max:number,valueAtMin:number,valueAtMax:number):yfiles.algorithms.BorderLine;
+ };
+ };
+ /**
+ * This class provides a means for early termination of graph algorithms.
+ * Instances of this class may be attached to and retrieved from a graph
+ * and may receive requests for stopping and canceling an algorithm working
+ * on the graph.
+ *
+ * Client Code Usage:
+ * The handler's
+ * {@link yfiles.algorithms.AbortHandler#stopDuration}
+ * and
+ * {@link yfiles.algorithms.AbortHandler#cancelDuration}
+ * methods can be used to automatically stop or cancel an algorithm after a specified
+ * period of time has elapsed.
+ *
+ *
+ * Stop
+ *
+ * The algorithm should terminate gracefully, delivering a consistent result.
+ * Although the termination will be early, it usually will not be immediate.
+ *
+ * Cancel
+ *
+ * The algorithm should terminate immediately, all work done so far will be
+ * discarded.
+ * IMPORTANT: It is not guaranteed that the processed graph will be in a
+ * consistent state after cancellation. For this reason it is strongly
+ * recommended to cancel only algorithms that work on copies of the real
+ * graph structure such as layout algorithms running in buffered mode.
+ * Furthermore, the state of the used layouter
+ * instance may become corrupted. Hence, a new
+ * instance has to be created after each cancellation.
+ *
+ *
+ * If a graph with an attached handler is processed by multiple algorithms
+ * (or multiple times by one algorithm), the attached handler has to be
+ * {@link yfiles.algorithms.AbortHandler#reset} between algorithm runs. Otherwise, previous requests for
+ * early termination may lead to an undesired early termination of the next
+ * algorithm run. Typically, the LayoutExecutor takes care of this.
+ *
+ *
+ * Usage in Algorithms:
+ * Algorithms have to retrieve an instance of this class from the graph
+ * that is processed using method {@link yfiles.algorithms.AbortHandler#getFromGraph}.
+ * The algorithm then needs to query the retrieved instance of this class for
+ * stop or cancel requests using method {@link yfiles.algorithms.AbortHandler#check}.
+ * Alternatively, convenience method {@link yfiles.algorithms.AbortHandler#check} for
+ * one-time checks is available. For performance critical code that checks
+ * repeatedly, it is recommended to follow the first approach, though.
+ * When handling a stop request, algorithms should ensure that the resulting
+ * graph is still in a consistent state.
+ *
+ */
+ export interface AbortHandler extends Object{
+ /**
+ * Schedules a stop request.
+ * Algorithms that detect stop requests should terminate gracefully and ensure
+ * that the processed graph remains in a consistent state.
+ *
+ * Since JavaScript is not multi-threaded, this method is not meant to be called
+ * in an interactive context on user request. Instead, it can be used in
+ * an algorithm or layout stage to end the complete current calculation.
+ *
+ * @see {@link yfiles.algorithms.AbortHandler#check}
+ */
+ stop():void;
+ /**
+ * Returns whether or not a stop request was scheduled explicitly with the {@link yfiles.algorithms.AbortHandler#stop} method.
+ */
+ stopRequested:boolean;
+ /**
+ * Determines the remaining time (in milliseconds) until an algorithm that
+ * {@link yfiles.algorithms.AbortHandler#check checks} this handler is stopped automatically.
+ * @return {number}
+ * the remaining time (in milliseconds) until the algorithm is
+ * stopped automatically.
+ * @see {@link yfiles.algorithms.AbortHandler#stopDuration}
+ * @see {@link yfiles.algorithms.AbortHandler#reset}
+ * @see {@link yfiles.algorithms.AbortHandler#stop}
+ */
+ timeToStop():number;
+ /**
+ * The duration (in milliseconds) an algorithm may run before being
+ * stopped automatically.
+ * An algorithm is terminated gracefully, if the time in between
+ * or {@link yfiles.algorithms.AbortHandler#reset resetting} this handler
+ * and calling {@link yfiles.algorithms.AbortHandler#check} exceeds the stop duration.
+ *
+ * Note, automatic termination will only occur for positive values.
+ *
+ * Defaults to 0, i.e. no automatic termination will occur.
+ *
+ * @see {@link yfiles.algorithms.AbortHandler#timeToStop}
+ * @see {@link yfiles.algorithms.AbortHandler#reset}
+ * @see {@link yfiles.algorithms.AbortHandler#stop}
+ */
+ stopDuration:number;
+ /**
+ * Determines the remaining time (in milliseconds) until an algorithm that
+ * {@link yfiles.algorithms.AbortHandler#check checks}
+ * this handler is cancelled automatically.
+ * @return {number}
+ * the remaining time (in milliseconds) until the algorithm is
+ * cancelled automatically.
+ * @see {@link yfiles.algorithms.AbortHandler#cancelDuration}
+ * @see {@link yfiles.algorithms.AbortHandler#reset}
+ */
+ timeToCancel():number;
+ /**
+ * The duration (in milliseconds) an algorithm may run before being
+ * cancelled automatically.
+ * An algorithm is terminated immediately, if the time in between
+ * or {@link yfiles.algorithms.AbortHandler#reset resetting} this handler
+ * and calling {@link yfiles.algorithms.AbortHandler#check} exceeds the cancel duration.
+ *
+ * Note, automatic termination will only occur for positive values.
+ *
+ * Defaults to 0, i.e. no automatic termination will occur.
+ *
+ * @see {@link yfiles.algorithms.AbortHandler#timeToCancel}
+ * @see {@link yfiles.algorithms.AbortHandler#reset}
+ */
+ cancelDuration:number;
+ /**
+ * true if method{@link yfiles.algorithms.AbortHandler#check} or {@link yfiles.algorithms.AbortHandler#check}
+ * were called after a stop or cancel event.
+ * More precisely, it returns true if one of the check methods
+ * either threw an {@link yfiles.algorithms.AlgorithmAbortedException} or returned true to indicate
+ * that the calling algorithm should terminate gracefully.
+ * Otherwise, this method returns false.
+ * @see {@link yfiles.algorithms.AbortHandler#check}
+ * @see {@link yfiles.algorithms.AbortHandler#check}
+ */
+ checkFailed:boolean;
+ /**
+ * Determines if an algorithm should terminate its work early.
+ * This method returns true if the algorithm should terminate
+ * gracefully and ensures that the processed graph remains in a consistent
+ * state.
+ * This method throws an {@link yfiles.algorithms.AlgorithmAbortedException} if the algorithm
+ * should terminate immediately.
+ * @return {boolean}
+ * true, if the algorithm should stop as soon as possible
+ * while still providing some valid result and false if the
+ * algorithm should continue normally.
+ * @throws {yfiles.algorithms.AlgorithmAbortedException}
+ * if the algorithm should terminate
+ * immediately.
+ * @see {@link yfiles.algorithms.AbortHandler#stop}
+ */
+ check():boolean;
+ /**
+ * Resets the state of the handler.
+ * Resetting the handler discards any
+ * previous stop or cancel requests. Moreover, the handler's internal
+ * timestamp that is used to determine whether or not an algorithm should
+ * be stopped or cancelled automatically is updated to the
+ * current time
+ * as well.
+ *
+ * This method should be called whenever a graph with an attached handler
+ * is processed an additional time to prevent previous requests for
+ * early termination to result in an undesired early termination of the next
+ * algorithm run.
+ *
+ * @see {@link yfiles.algorithms.AbortHandler#cancelDuration}
+ * @see {@link yfiles.algorithms.AbortHandler#stopDuration}
+ */
+ reset():void;
+ }
+ var AbortHandler:{
+ $class:yfiles.lang.Class;
+ /**
+ * {@link yfiles.algorithms.IDataProvider} key used to attach an {@link yfiles.algorithms.AbortHandler} instance to a graph.
+ * Only instances of {@link yfiles.algorithms.AbortHandler} should be assigned to this data provider, otherwise a
+ * {@link yfiles.system.InvalidCastException} will occur.
+ * Layout algorithms will use the attached handler to check for requests to cancel or stop the layout process.
+ */
+ ABORT_HANDLER_DP_KEY:Object;
+ /**
+ * Initializes a new AbortHandler instance with the
+ * {@link yfiles.algorithms.Runtime#currentTimeMillis current time} to be used as timestamp
+ * for determining whether or not an algorithm should be stopped or cancelled
+ * automatically.
+ * @see {@link yfiles.algorithms.AbortHandler#stopDuration}
+ * @see {@link yfiles.algorithms.AbortHandler#cancelDuration}
+ * @see {@link yfiles.algorithms.AbortHandler#reset}
+ */
+ new ():yfiles.algorithms.AbortHandler;
+ /**
+ * Creates an instance of this class and attaches it to the given graph.
+ * If the given graph already has an attached handler instance, said instance
+ * will be returned and this method will not create a new handler instance.
+ *
+ * This method should be called by client code prior to starting a graph
+ * algorithm that may be terminated early.
+ *
+ * @param {yfiles.algorithms.Graph} graph the graph to which the handler will be attached.
+ * @return {yfiles.algorithms.AbortHandler} the handler instance for the given graph.
+ * @throws {yfiles.system.ArgumentNullException} if the given graph is null.
+ * @see {@link yfiles.algorithms.AbortHandler#hasHandler}
+ */
+ createForGraph(graph:yfiles.algorithms.Graph):yfiles.algorithms.AbortHandler;
+ /**
+ * Removes any attached instance of this class from the given graph.
+ * @param {yfiles.algorithms.Graph} graph the graph from which the handler will be removed.
+ * @throws {yfiles.system.ArgumentNullException} if the given graph is null.
+ */
+ removeFromGraph(graph:yfiles.algorithms.Graph):void;
+ /**
+ * Returns an instance of this class for the given graph.
+ * If {@link yfiles.algorithms.AbortHandler#createForGraph} has been used to attach a new
+ * handler to the given graph, said instance is returned. Otherwise a
+ * non-functional instance is returned whose methods do nothing. Use
+ * {@link yfiles.algorithms.AbortHandler#hasHandler} whether or not a handler
+ * has been already attached to the given graph.
+ * @param {yfiles.algorithms.Graph} graph the graph for which the handler should be retrieved.
+ * @return {yfiles.algorithms.AbortHandler}
+ * a handler for the given graph. Maybe a non-functional instance
+ * if no handler has been previously created.
+ * @throws {yfiles.system.ArgumentNullException} if the given graph is null.
+ * @see {@link yfiles.algorithms.AbortHandler#createForGraph}
+ * @see {@link yfiles.algorithms.AbortHandler#hasHandler}
+ */
+ getFromGraph(graph:yfiles.algorithms.Graph):yfiles.algorithms.AbortHandler;
+ /**
+ * Attaches the handler instance of the given source graph to the target
+ * graph as well.
+ *
+ * Note, if there is a handler attached to the given target graph,
+ * this method will silently replace said instance with the one attached
+ * to the source graph.
+ *
+ * @param {yfiles.algorithms.Graph} source the graph whose handler is attached to the target graph.
+ * @param {yfiles.algorithms.Graph} target
+ * the graph to which the handler of the source graph is
+ * attached.
+ * @throws {yfiles.system.ArgumentNullException} if the given source is null.
+ */
+ copyHandler(source:yfiles.algorithms.Graph,target:yfiles.algorithms.Graph):void;
+ /**
+ * Determines whether or not an instance of this class is attached to the
+ * given graph.
+ * @param {yfiles.algorithms.Graph} graph the graph which to check for a handler.
+ * @return {boolean}
+ * true if a handler is attached to the given graph;
+ * false otherwise.
+ * @throws {yfiles.system.ArgumentNullException} if the given graph is null.
+ */
+ hasHandler(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Determines if an algorithm should terminate its work early.
+ * This method returns true if the algorithm should terminate
+ * gracefully and ensure that the processed graph remains in a consistent
+ * state.
+ * This method throws an {@link yfiles.algorithms.AlgorithmAbortedException} if the algorithm
+ * should terminate immediately.
+ *
+ * This convenience method is meant for one-time checks only.
+ * For performance critical code that checks repeatedly, it is recommended to
+ * retrieve the given graph's attached handler once and only call the
+ * handler's {@link yfiles.algorithms.AbortHandler#check} method repeatedly.
+ *
+ * @return {boolean}
+ * true, if the algorithm should stop as soon as possible
+ * while still providing some valid result and false if the
+ * algorithm should continue normally.
+ * @throws {yfiles.algorithms.AlgorithmAbortedException}
+ * if the algorithm should terminate
+ * immediately.
+ * @throws {yfiles.system.ArgumentNullException} if the given graph is null.
+ * @see {@link yfiles.algorithms.AbortHandler#check}
+ * @see {@link yfiles.algorithms.AbortHandler#stop}
+ */
+ check(graph:yfiles.algorithms.Graph):boolean;
+ };
+ /**
+ * Common base type for both {@link yfiles.algorithms.Node} and {@link yfiles.algorithms.Edge}.
+ * This type does not add public functionality to its base type.
+ */
+ export interface GraphObject extends Object{
+ }
+ var GraphObject:{
+ $class:yfiles.lang.Class;
+ };
+ /**
+ * Exception that gets thrown by an algorithm if a immediate termination
+ * request is detected.
+ * @see {@link yfiles.algorithms.AbortHandler}
+ * @see {@link yfiles.algorithms.AbortHandler}
+ * @see {@link yfiles.algorithms.AbortHandler#check}
+ */
+ export interface AlgorithmAbortedException extends yfiles.lang.Exception{
+ }
+ var AlgorithmAbortedException:{
+ $class:yfiles.lang.Class;
+ WithMessage:{
+ new (msg:string):yfiles.algorithms.AlgorithmAbortedException;
+ };
+ new ():yfiles.algorithms.AlgorithmAbortedException;
+ };
+ /**
+ * Responsible for graph bipartition problems.
+ * A bipartite graph is a graph whose node set can be partitioned
+ * into two sets in such a way that all edges in the graph
+ * connect nodes that belong to different partitions. In other words,
+ * there are no edges connecting nodes that belong to the same
+ * partition.
+ */
+ export interface Bipartitions extends Object{
+ }
+ var Bipartitions:{
+ $class:yfiles.lang.Class;
+ /**
+ * Marker for a node that belongs to the red partition.
+ */
+ RED:Object;
+ /**
+ * Marker for a node that belongs to the blue partition.
+ */
+ BLUE:Object;
+ /**
+ * Tests whether or not the given graph is bipartite.
+ * Complexity:O(nodeCount()+edgeCount())
+ */
+ isBipartite(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Calculates a bipartition of the given graph if one exists.
+ * If the graph is bipartite then for all nodes of the
+ * given graph either {@link yfiles.algorithms.Bipartitions#RED} or {@link yfiles.algorithms.Bipartitions#BLUE}
+ * objects will put in the given node map, depending on
+ * the partition the node belongs to.
+ * Complexity:O(nodeCount()+edgeCount())
+ * @return {boolean} isBipartite(graph)
+ */
+ getBipartition(graph:yfiles.algorithms.Graph,markMap:yfiles.algorithms.INodeMap):boolean;
+ };
+ /**
+ * This class provides services that center around breadth first search (BFS).
+ */
+ export interface Bfs extends Object{
+ }
+ var Bfs:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns layers of nodes constructed by a breadth first search.
+ * The first of these layers contains all nodes within the given NodeList.
+ * These nodes are the core nodes from where an
+ * undirected breath first search to the other nodes starts.
+ * In the i-th layer are previously unassigned nodes that are
+ * connected to nodes in the (i-1)-th layer.
+ * Complexity: O(graph.N()+graph.E())
+ */
+ getLayersFromNodeList(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList):yfiles.algorithms.NodeList[];
+ /**
+ * Like {@link yfiles.algorithms.Bfs#getLayersFromNodeList}, but this time the core nodes
+ * are identified by a boolean predicate.
+ * Precondition: isCoreNode.getBool(node) defined for all nodes in graph.
+ */
+ getLayersFromNodeMap(graph:yfiles.algorithms.Graph,isCoreNode:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList[];
+ /**
+ * Like {@link yfiles.algorithms.Bfs#getLayersFromNodeMap}.
+ * Additionally
+ * the provided node map will be filled with integers that
+ * hold the layer number for each node.
+ */
+ getLayersFromNodeMapToMap(graph:yfiles.algorithms.Graph,isCoreNode:yfiles.algorithms.IDataProvider,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[];
+ /**
+ * Like {@link yfiles.algorithms.Bfs#getLayersFromNodeList}.
+ * Additionally
+ * the provided node map will be filled with integers that
+ * hold the layer number for each node.
+ */
+ getLayersFromNodeListUndirected(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[];
+ /**
+ * Returns layers of nodes constructed by a breadth first search.
+ * The first of these layers contains all nodes within the given NodeList.
+ * These nodes are the core nodes from where either a directed or undirected
+ * breath first search to the other nodes starts.
+ * In the i-th layer are previously unassigned nodes that are
+ * successors to nodes in the (i-1)-th layer.
+ * Complexity: O(graph.N()+graph.E())
+ */
+ getLayersFromNodeListToMap(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,directed:boolean,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[];
+ /**
+ * Returns layers of nodes constructed by a breadth first search.
+ * The first of these layers contains all nodes within the given NodeList.
+ * These nodes are the core nodes from where either a directed or undirected
+ * breath first search to the other nodes starts.
+ * In the i-th layer are previously unassigned nodes that are
+ * successors to nodes in the (i-1)-th layer.
+ * Complexity: O(graph.N()+graph.E())
+ * @param {yfiles.algorithms.Graph} graph the graph the bfs is running on
+ * @param {yfiles.algorithms.NodeList} coreNodes contains the nodes the bfs run starts from
+ * @param {boolean} directed true: only outgoing edges are attended, false: all edges
+ * @param {yfiles.algorithms.INodeMap} layerIDMap is used to store the layer depths information in
+ * @param {number} maxLayers number of layers that will be returned. "0" for all layers
+ * @return {yfiles.algorithms.NodeList[]}
+ * an array of {@link yfiles.algorithms.NodeList}s representing the layers
+ */
+ getLayersWithMaxLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,directed:boolean,layerIDMap:yfiles.algorithms.INodeMap,maxLayers:number):yfiles.algorithms.NodeList[];
+ /**
+ * Returns layers of nodes constructed by a breadth first search.
+ * The first of these layers contains all nodes within the given NodeList.
+ * These nodes are the core nodes from where either a directed or undirected
+ * breath first search to the other nodes starts.
+ * In the i-th layer are previously unassigned nodes that are
+ * successors to nodes in the (i-1)-th layer.
+ * Complexity: O(graph.N()+graph.E())
+ * @param {yfiles.algorithms.Graph} graph the graph the bfs is running on
+ * @param {yfiles.algorithms.NodeList} coreNodes contains the nodes the bfs run starts from
+ * @param {yfiles.algorithms.BfsDirection} direction
+ * specifies which edges to follow. One of
+ *
{@link yfiles.algorithms.BfsDirection#SUCCESSOR}, or
+ *
{@link yfiles.algorithms.BfsDirection#BOTH}
+ *
+ * @param {yfiles.algorithms.INodeMap} layerIDMap is used to store the layer depths information in
+ * @param {number} maxLayers number of layers that will be returned. "0" for all layers
+ * @return {yfiles.algorithms.NodeList[]}
+ * an array of {@link yfiles.algorithms.NodeList}s representing the layers
+ */
+ getLayersWithDirection(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,direction:yfiles.algorithms.BfsDirection,layerIDMap:yfiles.algorithms.INodeMap,maxLayers:number):yfiles.algorithms.NodeList[];
+ };
+ /**
+ * A general interface for iterating over a collection of objects.
+ * It can be regarded as a read-only view of such a collection.
+ * A YCursor acts like a movable pointer on the elements of a collection.
+ * The pointer can be moved forward and backward and the element currently pointed
+ * on can be accessed.
+ * The removal of elements can only be performed on the provider of the cursor,
+ * not on the cursor itself.
+ * (That's why the cursor presents a read-only view.)
+ * Implementations of this interface do not need to support operations marked "optional."
+ */
+ export interface ICursor extends Object{
+ /**
+ * true if the current cursor position is valid.
+ * @see Specified by {@link yfiles.algorithms.ICursor#ok}.
+ */
+ ok:boolean;
+ /**
+ * Moves this cursor one position forward.
+ * @see Specified by {@link yfiles.algorithms.ICursor#next}.
+ */
+ next():void;
+ /**
+ * Moves this cursor one position backward (optional).
+ * @see Specified by {@link yfiles.algorithms.ICursor#prev}.
+ */
+ prev():void;
+ /**
+ * Moves this cursor to the first valid cursor position (optional).
+ * @see Specified by {@link yfiles.algorithms.ICursor#toFirst}.
+ */
+ toFirst():void;
+ /**
+ * Moves this cursor to the last valid cursor position (optional).
+ * @see Specified by {@link yfiles.algorithms.ICursor#toLast}.
+ */
+ toLast():void;
+ /**
+ * The object currently pointed on.
+ * @see Specified by {@link yfiles.algorithms.ICursor#current}.
+ */
+ current:Object;
+ /**
+ * The number of elements that can be accessed with this cursor.
+ * @see Specified by {@link yfiles.algorithms.ICursor#size}.
+ */
+ size:number;
+ }
+ var ICursor:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * A general interface for setting data.
+ * A data acceptor associates data with data holders.
+ * It constitutes a write-only view on particular data.
+ */
+ export interface IDataAcceptor extends Object{
+ /**
+ * Sets an object value associated with the given data holder.
+ * This method may throw an UnsupportedOperationException.
+ * @see Specified by {@link yfiles.algorithms.IDataAcceptor#set}.
+ */
+ set(dataHolder:Object,value:Object):void;
+ /**
+ * Sets an integer value associated with the given data holder.
+ * This method may throw an UnsupportedOperationException.
+ * @see Specified by {@link yfiles.algorithms.IDataAcceptor#setInt}.
+ */
+ setInt(dataHolder:Object,value:number):void;
+ /**
+ * Sets a double value associated with the given data holder.
+ * This method may throw an UnsupportedOperationException.
+ * @see Specified by {@link yfiles.algorithms.IDataAcceptor#setDouble}.
+ */
+ setDouble(dataHolder:Object,value:number):void;
+ /**
+ * Sets a boolean value associated with the given data holder.
+ * This method may throw an UnsupportedOperationException.
+ * @see Specified by {@link yfiles.algorithms.IDataAcceptor#setBool}.
+ */
+ setBool(dataHolder:Object,value:boolean):void;
+ }
+ var IDataAcceptor:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * Interface that combines the {@link yfiles.algorithms.IDataProvider} and {@link yfiles.algorithms.IDataAcceptor}
+ * interfaces.
+ * This interface does not declare any additional methods.
+ */
+ export interface IDataMap extends Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor{
+ }
+ var IDataMap:{
+ $class:yfiles.lang.Class;
+ isInstance(o:Object):boolean;
+ };
+ /**
+ * This class provides methods for automatically partitioning nodes of a graph into groups.
+ */
+ export interface Groups extends Object{
+ }
+ var Groups:{
+ $class:yfiles.lang.Class;
+ /**
+ * Partitions the graph into groups using edge betweenness centrality (see {@link yfiles.algorithms.Centrality#edgeBetweenness}.
+ * In each iteration the edge with the highest
+ * betweenness centrality is removed from the graph. The method stops, if there are no more edges to remove. The
+ * clustering with the best quality reached during the process will be returned.
+ * Complexity:
+ * O(graph.E())*O(edgeBetweenness) (Note: is practical faster because edge betweenness is computed for
+ * subgraphs during the process and this algorithm terminates after maxGroupCount groups have been
+ * determined.)
+ * Precondition:minGroupCount <= maxGroupCount
+ * Precondition:minGroupCount <= graph.N()
+ * Precondition:maxGroupCount > 0
+ * @param {yfiles.algorithms.Graph} graph the input graph.
+ * @param {yfiles.algorithms.INodeMap} clusterIDs used as return value. This map gets a cluster ID of integer type for every node.
+ * @param {boolean} directed whether or not to consider the edges of the graph as directed.
+ * @param {number} minGroupCount the minimum number of groups to be returned.
+ * @param {number} maxGroupCount
+ * the maximum number of groups to be returned. The smaller this value is chosen the faster the
+ * overall computation time. Note that the upper bound on the number of groups is
+ * graph.N(). Note, that the number of returned groups is never less than the number
+ * of connected components of the graph.
+ * @param {yfiles.algorithms.IDataProvider} edgeCosts
+ * if null the edges of the graph are considered to have equal cost. Otherwise
+ * it must provide a non-negative double value (its cost) for every edge.
+ * @return {number} the number of different groups found.
+ */
+ edgeBetweennessClusteringWithCost(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,directed:boolean,minGroupCount:number,maxGroupCount:number,edgeCosts:yfiles.algorithms.IDataProvider):number;
+ /**
+ * Partitions the graph into groups using Edge Betweenness Clustering proposed by Girvan and Newman.
+ * In each
+ * iteration the edge with the highest betweenness centrality is removed from the graph. The method stops, if there
+ * are no more edges to remove or if the requested maximum number of groups is found. The clustering with the best
+ * quality reached during the process is returned.
+ * The algorithm includes several heuristic speed-up techniques available through the quality/time ratio. For the
+ * highest quality setting, it is used almost unmodified. The fast betweenness approximation of Brandes und Pich
+ * (Centrality Estimation in Large Networks) is employed for values around 0.5. Typically, this results in a
+ * tiny decrease in quality but a large speed-up and is the recommended setting. To achieve the lowest running time, a
+ * local betweenness calculation is used (Gregory: Local Betweenness for Finding Communities in Networks).
+ * Complexity:
+ * O(graph.E())*O(edgeBetweenness) (Note: is practical faster because edge betweenness is computed for
+ * subgraphs during the process and this algorithm terminates after maxGroupCount groups have been
+ * determined.)
+ * Precondition:minGroupCount <= maxGroupCount
+ * Precondition:minGroupCount <= graph.N()
+ * Precondition:maxGroupCount > 0
+ * @param {yfiles.algorithms.Graph} graph the input graph.
+ * @param {yfiles.algorithms.INodeMap} clusterIDs used as return value. This map gets a cluster ID of integer type for every node.
+ * @param {number} qualityTimeRatio
+ * a value between 0.0 (low quality, fast) and 1.0 (high quality, slow). The recommended value
+ * is 0.5.
+ * @param {number} minGroupCount the minimum number of groups to be returned.
+ * @param {number} maxGroupCount
+ * the maximum number of groups to be returned. The smaller this value is chosen the faster
+ * the overall computation time. Note, that the upper bound on the number of groups is
+ * graph.N() and that the number of returned groups is never less than the number
+ * of connected components of the graph.
+ * @param {boolean} refine whether the algorithm refines or discards the current grouping.
+ * @return {number} the number of different groups found
+ */
+ edgeBetweennessClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,qualityTimeRatio:number,minGroupCount:number,maxGroupCount:number,refine:boolean):number;
+ /**
+ * This method partitions the graph by analyzing its biconnected component structure.
+ * Nodes will be grouped in a way
+ * that the nodes within each group are biconnected. Nodes that belong to multiple biconnected components will be
+ * assigned to exactly one of these components.
+ *
+ * Note:
+ * Biconnected components are defined for undirected graphs only.
+ * As a consequence, this algorithm ignores selfloops and isolated nodes with
+ * only selfloop edges or no edges at all are not assigned to any group,
+ * i.e. the groupID for such a node will be null.
+ *
+ * Complexity: O(graph.E()+graph.N())
+ * @param {yfiles.algorithms.Graph} graph the input graph.
+ * @param {yfiles.algorithms.INodeMap} groupIDs used as return value. This map gets a cluster ID of integer type for every node.
+ * @return {number} the number of different groups found.
+ */
+ biconnectedComponentGrouping(graph:yfiles.algorithms.Graph,groupIDs:yfiles.algorithms.INodeMap):number;
+ };
+ /**
+ * Represents an edge, i.e., a directed connection between two nodes (represented
+ * by instances of class {@link yfiles.algorithms.Node}) in the directed graph data type {@link yfiles.algorithms.Graph}.
+ * The directed stems from the fact that an edge has a distinct source node
+ * and a distinct target node.
+ * Using pair notation, an edge would be written as
+ * (<source node>, <target node>).
+ * Most notably, an edge provides access to its source node ({@link yfiles.algorithms.Edge#source})
+ * and its target node ({@link yfiles.algorithms.Edge#target}).
+ * Note that an edge can have the same node as its source and target.
+ * Such an edge is then called "self-loop" and method {@link yfiles.algorithms.Edge#selfLoop} yields
+ * true.
+ * Important:
+ * Class Graph is the single authority for any structural changes to the graph data
+ * type.
+ * Specifically, this means that there is no way to create or delete a node or an
+ * edge without using an actual Graph instance.
+ */
+ export interface Edge extends yfiles.algorithms.GraphObject{
+ /**
+ * Creates a copy of this edge that will be inserted into the given graph connecting
+ * the given source and target nodes.
+ * @param {yfiles.algorithms.Graph} g The graph the created edge will belong to.
+ * @param {yfiles.algorithms.Node} v The source node of the created edge.
+ * @param {yfiles.algorithms.Node} w The target node of the created edge.
+ * @return {yfiles.algorithms.Edge} The newly created Edge object.
+ */
+ createCopy(g:yfiles.algorithms.Graph,v:yfiles.algorithms.Node,w:yfiles.algorithms.Node):yfiles.algorithms.Edge;
+ /**
+ * The graph this edge belongs to.
+ * If the edge does not belong to a graph, because it was removed or hidden from
+ * it, this method returns null.
+ */
+ graph:yfiles.algorithms.Graph;
+ /**
+ * The index of this edge within its graph G.
+ * Edge indices represent the ordering of standard edge iteration on G.
+ * The value of an index is >= 0 and < G.edgeCount().
+ * Note that indices are subject to change whenever the sequence of edges in a
+ * graph is modified by either removing, hiding, reinserting, or unhiding an edge,
+ * or by explicitly changing its position in the sequence.
+ * Precondition: This edge must belong to some graph.
+ * @see {@link yfiles.algorithms.Graph#removeEdge}
+ * @see {@link yfiles.algorithms.Graph#hideEdge}
+ * @see {@link yfiles.algorithms.Graph#reInsertEdge}
+ * @see {@link yfiles.algorithms.Graph#unhideEdge}
+ * @see {@link yfiles.algorithms.Graph#moveToFirstEdge}
+ * @see {@link yfiles.algorithms.Graph#moveToLastEdge}
+ */
+ index:number;
+ /**
+ * The source node connected to this edge.
+ * @see {@link yfiles.algorithms.Edge#target}
+ */
+ source:yfiles.algorithms.Node;
+ /**
+ * The target node connected to this edge.
+ * @see {@link yfiles.algorithms.Edge#source}
+ */
+ target:yfiles.algorithms.Node;
+ /**
+ * Returns the node at the opposite edge end with respect to the given node.
+ * Note that self-loops have the same node at both edge ends.
+ * Precondition: The given node must be either the edge's source node or target node.
+ */
+ opposite(v:yfiles.algorithms.Node):yfiles.algorithms.Node;
+ /**
+ * true if and only if this edge is a self-loop.
+ * An edge is called a self-loop, if it is adjacent to only one node, i.e.,
+ * source node and target node are the same.
+ */
+ selfLoop:boolean;
+ /**
+ * Returns a String representation of this edge.
+ */
+ toString():string;
+ /**
+ * Callback method that is invoked from a graph just before this edge will be
+ * reinserted into that graph.
+ */
+ onReinsert():void;
+ /**
+ * The successor of this edge in the list of outgoing edges at its source
+ * node.
+ * If this edge is the last outgoing edge at its source node, then null
+ * is returned.
+ * Precondition: This edge must belong to some graph.
+ * @see {@link yfiles.algorithms.Edge#prevOutEdge}
+ * @see {@link yfiles.algorithms.Edge#nextInEdge}
+ */
+ nextOutEdge:yfiles.algorithms.Edge;
+ /**
+ * The successor of this edge in the list of incoming edges at its target
+ * node.
+ * If this edge is the last incoming edge at its target node, then null
+ * is returned.
+ * Precondition: This edge must belong to some graph.
+ * @see {@link yfiles.algorithms.Edge#prevInEdge}
+ * @see {@link yfiles.algorithms.Edge#nextOutEdge}
+ */
+ nextInEdge:yfiles.algorithms.Edge;
+ /**
+ * The predecessor of this edge in the list of outgoing edges at its source
+ * node.
+ * If this edge is the first outgoing edge at its source node, then null
+ * is returned.
+ * Precondition: This edge must belong to some graph.
+ * @see {@link yfiles.algorithms.Edge#nextOutEdge}
+ * @see {@link yfiles.algorithms.Edge#prevInEdge}
+ */
+ prevOutEdge:yfiles.algorithms.Edge;
+ /**
+ * The predecessor of this edge in the list of incoming edges at its target
+ * node.
+ * If this edge is the first incoming edge at its target node, then null
+ * is returned.
+ * Precondition: This edge must belong to some graph.
+ * @see {@link yfiles.algorithms.Edge#nextInEdge}
+ * @see {@link yfiles.algorithms.Edge#prevOutEdge}
+ */
+ prevInEdge:yfiles.algorithms.Edge;
+ }
+ var Edge:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new edge that belongs to the given graph.
+ * The new edge e has source node v and target node
+ * w.
+ * Edge e is inserted in such a way that an iteration over the edges
+ * at node v returns e
+ *
+ *
+ * after e1, if d1 == AFTER
+ *
+ *
+ * before e1, if d1 == BEFORE,
+ *
+ *
+ * and an iteration over the edges at w returns e
+ *
+ *
+ * after e2, if d2 == AFTER
+ *
+ *
+ * before e2, if d2 == BEFORE.
+ *
+ *
+ * Precondition:
+ * Edge e1 must have source node v and edge e2
+ * must have target node w.
+ * @param {yfiles.algorithms.Node} v The source node of the edge.
+ * @param {yfiles.algorithms.Edge} e1 An edge with source node v.
+ * @param {yfiles.algorithms.Node} w The target node of the edge.
+ * @param {yfiles.algorithms.Edge} e2 An edge with target node w.
+ * @param {yfiles.algorithms.GraphElementInsertion} d1
+ * One of the object insertion specifiers {@link yfiles.algorithms.GraphElementInsertion#BEFORE} or {@link yfiles.algorithms.GraphElementInsertion#AFTER}.
+ * @param {yfiles.algorithms.GraphElementInsertion} d2
+ * One of the object insertion specifiers {@link yfiles.algorithms.GraphElementInsertion#BEFORE} or {@link yfiles.algorithms.GraphElementInsertion#AFTER}.
+ */
+ new (g:yfiles.algorithms.Graph,v:yfiles.algorithms.Node,e1:yfiles.algorithms.Edge,w:yfiles.algorithms.Node,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion):yfiles.algorithms.Edge;
+ };
+ /**
+ * An event which indicates that a graph structure change occurred.
+ * This low-level event is generated by a graph when its structure changes.
+ * The event is passed to every {@link yfiles.algorithms.IGraphListener} object that registered to
+ * receive such events using the graph's
+ * {@link yfiles.algorithms.Graph#addGraphListener addGraphListener} method.
+ * The object that implements the GraphListener interface gets this GraphEvent when
+ * the event occurs.
+ * Each GraphEvent has a type that signals what kind of change occurred in the graph
+ * and a data object that is the object (either node or edge) that was involved
+ * in the structural change of the graph, e.g., the node that has been created or
+ * the edge that has been reversed.
+ */
+ export interface GraphEvent extends Object{
+ /**
+ * The type of this GraphEvent.
+ * It can be either of the type constants defined in this class.
+ */
+ type:yfiles.algorithms.GraphEventType;
+ /**
+ * The data object associated with this graph event.
+ * For a "Node"-associated event, it returns an object of type y.base.Node.
+ * For an "Edge"-associated event, it returns an object of type y.base.Edge.
+ * To check the type of event, see the method getType()
+ */
+ data:Object;
+ /**
+ * The graph that is the emitter of this event.
+ */
+ graph:yfiles.algorithms.Graph;
+ /**
+ * Returns a String representation of this GraphEvent object's type.
+ */
+ toString():string;
+ }
+ var GraphEvent:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new GraphEvent instance with given type and data.
+ */
+ new (source:yfiles.algorithms.Graph,type:yfiles.algorithms.GraphEventType,data:Object):yfiles.algorithms.GraphEvent;
+ };
+ /**
+ * Provides methods that check structural properties of a given graph.
+ */
+ export interface GraphChecker extends Object{
+ }
+ var GraphChecker:{
+ $class:yfiles.lang.Class;
+ /**
+ * Checks whether or not the given graph is acyclic, that is, if it contains no directed cycle.
+ * Note: isAcyclic(graph) <=> !isCyclic(graph).
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean} true if the graph is acyclic; false, otherwise.
+ */
+ isAcyclic(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given graph is cyclic, that is, if it contains a directed cycle.
+ * Note: isCyclic(graph) <=> !isAcyclic(graph).
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean} true if the graph is cyclic; false, otherwise.
+ */
+ isCyclic(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given graph is planar.
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean} true if the graph is planar; false, otherwise.
+ */
+ isPlanar(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given graph is connected.
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean} true if the graph is connected; false, otherwise.
+ */
+ isConnected(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given directed graph is strongly connected.
+ * @param {yfiles.algorithms.Graph} graph the given directed graph.
+ * @return {boolean} true if the graph is strongly connected; false, otherwise.
+ */
+ isStronglyConnected(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given undirected graph is biconnected.
+ * @param {yfiles.algorithms.Graph} graph the given undirected graph.
+ * @return {boolean} true if the graph is biconnected; false, otherwise.
+ */
+ isBiconnected(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given undirected graph is bipartite.
+ * @param {yfiles.algorithms.Graph} graph the given undirected graph.
+ * @return {boolean} true if the graph is bipartite; false, otherwise.
+ */
+ isBipartite(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given graph is a directed rooted tree
+ * where each node has a maximum of n children.
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean}
+ * true if the graph is a directed rooted tree where each node has <= n children;
+ * false, otherwise.
+ */
+ isNaryTree(graph:yfiles.algorithms.Graph,n:number):boolean;
+ /**
+ * Checks whether or not the given graph is a directed rooted tree.
+ * Note: isRootedTree(graph) => isTree(graph).
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean} true if the graph is a directed rooted tree; false, otherwise.
+ */
+ isRootedTree(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given graph is an undirected tree.
+ * Note: isRootedTree(graph) => isTree(graph).
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean} true if the graph is an undirected tree; false, otherwise.
+ */
+ isTree(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether the given graph is a forest, that is,
+ * a graph whose connected components are directed rooted trees.
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean} true if the graph is a forest; false, otherwise.
+ */
+ isForest(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given graph contains no self-loops.
+ * Note: !isSelfLoopFree(graph) => !isAcyclic(graph).
+ * @param {yfiles.algorithms.Graph} graph the given graph.
+ * @return {boolean} true if the graph contains no self-loops; false, otherwise.
+ */
+ isSelfLoopFree(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given directed graph is simple.
+ * A graph is called simple if it contains no two distinct edges e1, e2 where
+ * e1.source() == e2.source() && e1.target() == e2.target().
+ * Note: isMultipleEdgeFree(graph) => isSimple(graph).
+ * @param {yfiles.algorithms.Graph} graph the given directed graph.
+ * @return {boolean} true if the graph is simple; false, otherwise.
+ */
+ isSimple(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Checks whether or not the given undirected graph contains no multiple edges.
+ * More precisely, the method returns true if the graph contains no two distinct
+ * edges e1, e2 that connect the same pairs of nodes in either direction.
+ * Note: isMultipleEdgeFree(graph) => isSimple(graph).
+ * @param {yfiles.algorithms.Graph} graph the given undirected graph.
+ * @return {boolean} true if the graph contains no multiple edges; false, otherwise.
+ */
+ isMultipleEdgeFree(graph:yfiles.algorithms.Graph):boolean;
+ };
+ /**
+ * Provides algorithms for determining certain connectivity components within a graph.
+ * Also provides convenience method for working with these components.
+ */
+ export interface GraphConnectivity extends Object{
+ }
+ var GraphConnectivity:{
+ $class:yfiles.lang.Class;
+ /**
+ * Returns the connected components of a given graph.
+ * A graph G is called connected if there is an
+ * undirected path between each pair of nodes belonging to G.
+ * The connected components of G are connected
+ * subgraphs that G consists of.
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @return {yfiles.algorithms.NodeList[]}
+ * an array of NodeLists each of which contains the nodes that belong to
+ * a common connected component of the graph.
+ */
+ connectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[];
+ /**
+ * Returns the connected components of a given graph.
+ * A graph G is called connected if there is an
+ * undirected path between each pair of nodes belonging to G.
+ * The connected components of G are connected
+ * subgraphs that G consists of.
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.INodeMap} compNum
+ * return value that will hold the zero-based number
+ * of the connected component that it belongs to. The component number of
+ * Node v is compNum.getInt().
+ * @return {number} the number of connected components of this graph.
+ */
+ connectedComponentsWithIndex(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap):number;
+ /**
+ * Makes a graph connected by adding additional edges to the graph.
+ * The number of edges that will be added is equal to one less the number of
+ * separate components of the original graph.
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @return {yfiles.algorithms.EdgeList} an edge list containing the edges added to this graph.
+ */
+ makeConnected(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList;
+ /**
+ * Transforms the return values of {@link yfiles.algorithms.GraphConnectivity#connectedComponentsWithIndex} to
+ * an array of type NodeList, like it is returned by
+ * {@link yfiles.algorithms.GraphConnectivity#connectedComponents}.
+ */
+ toNodeListArray(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap,maxCompNum:number):yfiles.algorithms.NodeList[];
+ /**
+ * Checks whether or not the given graph is connected.
+ */
+ isConnected(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Calculates the biconnected components of a given undirected graph.
+ * The result is returned as an array of EdgeList objects each containing all
+ * edges that belong to the same biconnected component of
+ * the graph.
+ *
+ * Note: Selfloops do not belong to any biconnected component.
+ * Therefore no selfloops are included in the returned edge lists.
+ *
+ * Precondition: GraphChecker.isConnected(graph)
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ */
+ biconnectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList[];
+ /**
+ * Calculates the biconnected components of a given undirected graph.
+ * The main result is returned in the form of an EdgeMap that provides
+ * for each edge a zero-based index of the biconnected component it belongs to.
+ *
+ * Note: Selfloops do not belong to any biconnected component.
+ * Therefore the component index for selfloops is always -1.
+ *
+ * Precondition: GraphChecker.isConnected(graph)
+ * Precondition: compNum defined for each edge in the graph.
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.IEdgeMap} compNum
+ * return value that provides for each edge a zero-based index
+ * of the biconnected component it belongs to or
+ * -1 for selfloops.
+ * @return {number} the number of biconnected components found
+ */
+ biconnectedComponentsWithIndex(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap):number;
+ /**
+ * Calculates the biconnected components of a given undirected graph.
+ * Additionally, this method calculates the articulation points of the input
+ * graph. Articulation points are returned in the form of a NodeMap that
+ * provides for each node a boolean value indicating whether or not it is an
+ * articulation point.
+ *
+ * Note: Selfloops do not belong to any biconnected component.
+ * Therefore the component index for selfloops is always -1.
+ *
+ * Precondition: aPoint defined for each node in the graph
+ * @param {yfiles.algorithms.INodeMap} aPoint
+ * return value that provides for each node a boolean value
+ * indicating whether or not it is an articulation point.
+ */
+ biconnectedComponentsWithIndexAndArticulationPoint(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap,aPoint:yfiles.algorithms.INodeMap):number;
+ /**
+ * Transforms the return values of {@link yfiles.algorithms.GraphConnectivity#biconnectedComponentsWithIndex} to
+ * an array of {@link yfiles.algorithms.EdgeList}s, like it is returned by
+ * {@link yfiles.algorithms.GraphConnectivity#biconnectedComponents}.
+ */
+ toEdgeListArray(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap,maxCompNum:number):yfiles.algorithms.EdgeList[];
+ /**
+ * Makes the given graph biconnected by inserting a minimum number of edges
+ * in the graph.
+ * The given graph is considered to be undirected.
+ * Precondition: GraphChecker.isConnected(graph)
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @return {yfiles.algorithms.EdgeList} an edge list containing the edges added to this graph.
+ */
+ makeBiconnected(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList;
+ /**
+ * Checks whether or not the given graph is biconnected.
+ */
+ isBiconnected(graph:yfiles.algorithms.Graph):boolean;
+ /**
+ * Determines the set of nodes that can be reached in the given graph when starting
+ * from a given node.
+ * Precondition: reached.length = graph.N()
+ * @param {yfiles.algorithms.Graph} graph the graph the search is performed on
+ * @param {yfiles.algorithms.Node} start the node the search is started from
+ * @param {boolean} directed
+ * traverses edges only from source to target if true. Otherwise
+ * traverses edges in both directions.
+ * @param {boolean[]} reached
+ * the return value. a boolean array that has value true at field
+ * v.index() iff node v can be reached by the dfs search.
+ */
+ reachable(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,directed:boolean,reached:boolean[]):void;
+ /**
+ * Similar to {@link yfiles.algorithms.GraphConnectivity#reachable}.
+ * Additionally
+ * it is possible to specify a set of forbidden edges that will not be traversed
+ * when performing the search.
+ * Precondition: forbiddenEdges.length = graph.E()
+ * @param {yfiles.algorithms.Graph} graph the graph DFS is performed on
+ * @param {yfiles.algorithms.Node} start the node DFS is started from
+ * @param {boolean} directed
+ * traverses edges only from source to target if true. Otherwise
+ * traverses edges in both directions.
+ * @param {boolean[]} forbidden
+ * marks edges that may not be traversed by DFS. An edge e
+ * is marked as forbidden if forbidden[e.index()] == true.
+ * @param {boolean[]} reached
+ * the return value. a boolean array that has value true at field
+ * v.index() iff node v can be reached by the dfs search.
+ */
+ reachableWithForbidden(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,directed:boolean,forbidden:boolean[],reached:boolean[]):void;
+ /**
+ * Determines the direct or indirect successors of a given set of nodes.
+ * A direct successor
+ * of a node is the target node of an outgoing edge connected to a node.
+ * An indirect successor of a node is a direct successor to another successor of a node.
+ * @param {yfiles.algorithms.Graph} graph the graph to act upon
+ * @param {yfiles.algorithms.NodeList} startNodes contains the node the search is started from
+ * @param {number} maxDistance
+ * limits the distance between a start node and a returned node. For all returned
+ * nodes there must be a path to a start node that has a length equal or smaller than maxDistance.
+ * Setting maxDistance to 1 will only yield the direct successors of all start nodes. On the other hand,
+ * setting maxDistance to graph.N() or larger, will yield all successors of all start nodes.
+ * @return {yfiles.algorithms.NodeList}
+ * a NodeList that contains all direct and indirect successors of a node. The order
+ * of the returned nodes follows is determined by a breadth first search.
+ * No start node will be part of the resulting set.
+ */
+ getSuccessors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList;
+ /**
+ * Determines the direct or indirect predecessors of a given set of nodes.
+ * A direct predecessor
+ * of a node is the source node of an ingoing edge connected to a node.
+ * An indirect predecessor of a node is a direct predecessor to another predecessor of a node.
+ * @param {yfiles.algorithms.Graph} graph the graph to act upon
+ * @param {yfiles.algorithms.NodeList} startNodes contains the node the search is started from
+ * @param {number} maxDistance
+ * limits the distance between a start node and a returned node. For all returned
+ * nodes there must be a path to a start node that has a length equal or smaller than maxDistance.
+ * Setting maxDistance to 1 will only yield the direct predecessors of all start nodes. On the other hand,
+ * setting maxDistance to graph.N() or larger, will yield all predecessors of all start nodes.
+ * @return {yfiles.algorithms.NodeList}
+ * a NodeList that contains all direct and indirect predecessors of a node. The order
+ * of the returned nodes follows is determined by a breadth first search.
+ * No start node will be part of the resulting set.
+ */
+ getPredecessors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList;
+ /**
+ * Determines the direct or indirect neighbors of a given set of nodes.
+ * A direct neighbor
+ * of a node is directly connected by an edge to that node.
+ * An indirect neighbor of a node is directly connected to another direct or indirect neighbor of a node.
+ * @param {yfiles.algorithms.Graph} graph the graph to act upon
+ * @param {yfiles.algorithms.NodeList} startNodes contains the node the search is started from
+ * @param {number} maxDistance
+ * limits the distance between a start node and a returned node. For all returned
+ * nodes there must be a path to a start node that has a length equal or smaller than maxDistance.
+ * Setting maxDistance to 1 will only yield the direct neighbors of all start nodes. On the other hand,
+ * setting maxDistance to graph.N() or larger, will yield all neighbors of all start nodes.
+ * @return {yfiles.algorithms.NodeList}
+ * a NodeList that contains all direct and indirect neighbors of a node.
+ * The order of the returned nodes follows is determined by a breadth first search.
+ * No start node will be part of the resulting set.
+ */
+ getNeighbors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList;
+ /**
+ * Returns the connected components of a given graph.
+ * A graph G is called strongly connected if there is an
+ * directed path between each pair of nodes belonging to G.
+ * The strongly connected components of G are strongly connected
+ * subgraphs that G consists of.
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @return {yfiles.algorithms.NodeList[]}
+ * an array of NodeLists each of which contains the nodes that belong to
+ * a common connected component of the graph.
+ */
+ stronglyConnectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[];
+ /**
+ * Returns the connected components of a given graph.
+ * A graph G is called strongly connected if there is an
+ * directed path between each pair of nodes belonging to G.
+ * The strongly connected components of G are strongly connected
+ * subgraphs that G consists of.
+ * Complexity: O(graph.N() + graph.E())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.INodeMap} compNum
+ * return value that will hold the zero-based number
+ * of the strongly connected component that it belongs to. The component number of
+ * Node v is compNum.getInt().
+ * @return {number} the number of strongly connected components of this graph.
+ */
+ stronglyConnectedComponentsWithIndex(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap):number;
+ /**
+ * Checks whether or not the given graph is strongly connected.
+ */
+ isStronglyConnected(graph:yfiles.algorithms.Graph):boolean;
+ };
+ /**
+ * Very simple default implementation of a Copy Factory that creates {@link yfiles.algorithms.Graph} instances
+ * and simply delegates to the {@link yfiles.algorithms.Graph#createNode} and
+ * {@link yfiles.algorithms.Graph#createEdgeBetween} method.
+ */
+ export interface GraphCopyFactory extends Object,yfiles.algorithms.GraphCopier.ICopyFactory{
+ /**
+ * This implementation does nothing.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#preCopyGraphData}.
+ */
+ preCopyGraphData(hint:yfiles.algorithms.Graph,newGraph:yfiles.algorithms.Graph):void;
+ /**
+ * This implementation does nothing.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#postCopyGraphData}.
+ */
+ postCopyGraphData(originalGraph:yfiles.algorithms.Graph,newGraph:yfiles.algorithms.Graph,nodeMap:yfiles.algorithms.IMap,edgeMap:yfiles.algorithms.IMap):void;
+ /**
+ * Copies the originalNode from the source graph to the new targetGraph.
+ * @param {yfiles.algorithms.Graph} targetGraph the graph to create the new node in
+ * @param {yfiles.algorithms.Node} originalNode the original node from the source graph
+ * @return {yfiles.algorithms.Node} the newly created node
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#copyNode}.
+ */
+ copyNode(targetGraph:yfiles.algorithms.Graph,originalNode:yfiles.algorithms.Node):yfiles.algorithms.Node;
+ /**
+ * Copies the originalEdge from the source graph to the new targetGraph
+ * using the specified new source and target node in the target graph.
+ * @param {yfiles.algorithms.Graph} targetGraph the graph to create the new node in
+ * @param {yfiles.algorithms.Node} newSource the source node in the target graph to use for the newly created edge
+ * @param {yfiles.algorithms.Node} newTarget the target node in the target graph to use for the newly created edge
+ * @param {yfiles.algorithms.Edge} originalEdge the original edge from the source graph
+ * @return {yfiles.algorithms.Edge} the newly created edge
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#copyEdge}.
+ */
+ copyEdge(targetGraph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,originalEdge:yfiles.algorithms.Edge):yfiles.algorithms.Edge;
+ /**
+ * Creates a new {@link yfiles.algorithms.Graph}.
+ * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#createGraph}.
+ */
+ createGraph():yfiles.algorithms.Graph;
+ }
+ var GraphCopyFactory:{
+ $class:yfiles.lang.Class;
+ };
+ /**
+ * This class provides methods to determine various centrality indices of nodes or edges of a graph.
+ * Centrality indices serve to quantify an intuitive feeling that in most networks some nodes
+ * or edges are "more central" than others. The provided methods assign a value of type double to each node or edge of
+ * a graph that represents its centrality. The higher an assigned value the more central the element
+ * is considered by the algorithm.
+ * Also, this class provides convenience methods that normalize the returned centrality values to lie within
+ * the interval [0..1].
+ */
+ export interface Centrality extends Object{
+ }
+ var Centrality:{
+ $class:yfiles.lang.Class;
+ /**
+ * Computes betweenness centrality for each node of a given graph.
+ * Betweenness Centrality is a measure for how often a node lies on a shortest path between
+ * each pair of nodes in the graph. Removing a central node will cause many shortest paths to change.
+ * Complexity: O(graph.N()*graph.E()) for unweighted graphs, O(graph.N() * (graph.E()+graph.N()) * log(graph.N()) for weighted graphs.
+ * Precondition: NodeMap centrality with values initially zero
+ * @param {yfiles.algorithms.Graph} graph the input graph.
+ * @param {yfiles.algorithms.INodeMap} centrality return value. A NodeMap which will holds a non-negative centrality value of type double for each node.
+ * @param {boolean} directed
+ * whether to consider the edges of the graph as directed or undirected.
+ * If false, the algorithm traverse every edge in both direction regardless of the direction of the edge.
+ * @param {yfiles.algorithms.IDataProvider} edgeCosts
+ * if null the edges of the graph are considered to have equal cost. Otherwise
+ * it must provide a strictly positive double value (its cost) for every edge. Invalid values are assumed
+ * to be 1.0.
+ */
+ nodeBetweenness(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Computes betweenness centrality for each edge of a given graph.
+ * Like {@link yfiles.algorithms.Centrality#nodeBetweenness} but applied to edges.
+ * Precondition: EdgeMap centrality with values initially zero
+ * @param {yfiles.algorithms.IEdgeMap} centrality return value. A EdgeMap which will hold a non-negative centrality value of type double for each edge.
+ */
+ edgeBetweenness(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.IEdgeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Computes betweenness centrality for each node and edge of a given graph.
+ * Like {@link yfiles.algorithms.Centrality#nodeBetweenness} but applied to both nodes and edges.
+ * Precondition: NodeMap nodeCentrality with values initially zero
+ * Precondition: EdgeMap edgeCentrality with values initially zero
+ * @param {yfiles.algorithms.INodeMap} nodeCentrality return value. A NodeMap which will hold the centrality value of type double for every node.
+ * @param {yfiles.algorithms.IEdgeMap} edgeCentrality return value. A EdgeMap which will hold the centrality value of type double for every edge.
+ */
+ nodeEdgeBetweenness(graph:yfiles.algorithms.Graph,nodeCentrality:yfiles.algorithms.INodeMap,edgeCentrality:yfiles.algorithms.IEdgeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Computes the closeness centrality for the nodes of a graph.
+ * Closeness centrality is defined as the reciprocal
+ * of the sum of
+ * shortest path distances of a node to all other nodes in the graph. Therefore a node with high closeness
+ * centrality has short distances to all other nodes of a graph. Also note, that for unconnected graphs
+ * the centrality values of all nodes will be zero, since the distance to some nodes is infinite.
+ * Precondition:GraphChecker.isConnected(graph)
+ * Complexity:
+ * O(graph.N()^2 + graph.N()*graph.E()) for unweighted graphs, O( (graph.N()*graph.E()) + graph.N()^2 *log(graph.N()))
+ * or: O(graph.N()) * O(Uniform) for unweighted, O(allPairs) for weighted graphs
+ * @param {yfiles.algorithms.Graph} graph the input graph.
+ * @param {yfiles.algorithms.INodeMap} closeness return value. A map which hold the centrality value of type double for every node.
+ * @param {boolean} directed whether to consider the edges of the graph as directed or undirected.
+ * @param {yfiles.algorithms.IDataProvider} edgeCosts
+ * when null the edges of the graph are considered to have equal cost. Otherwise
+ * it must provide a non-negative double value (its cost) for every edge.
+ */
+ closenessCentrality(graph:yfiles.algorithms.Graph,closeness:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Computes the graph centrality for the nodes of a graph.
+ * Graph centrality is defined as the reciprocal
+ * of the maximum of all shortest path distances from a node to all other nodes in the graph.
+ * Nodes with high graph centrality have short distances to all other nodes in the graph.
+ * Also note, that for unconnected graphs the centrality values of all nodes will be zero, since the
+ * distance to some nodes is infinite.
+ * Complexity:
+ * O(graph.N()^2 + graph.N()*graph.E()) for unweighted graphs, O( (graph.N()*graph.E()) + graph.N()^2 *log(graph.N()))
+ * or: O(graph.N()) * O(Uniform) for unweighted, O(allPairs) for weighted graphs
+ * @param {yfiles.algorithms.Graph} graph the input graph.
+ * @param {yfiles.algorithms.INodeMap} centrality return value. A map which hold the centrality value of type double for every node.
+ * @param {boolean} directed whether to consider the edges of the graph as directed or undirected.
+ * @param {yfiles.algorithms.IDataProvider} edgeCosts
+ * when null the edges of the graph are considered to have equal cost. Otherwise
+ * it must provide a non-negative double value (its cost) for every edge.
+ */
+ graphCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Computes the degree centrality for the nodes of a graph.
+ * Degree centrality measures in-, out- or overall degree of
+ * a node.
+ * Complexity: O(graph.N())
+ * Precondition: at least one of the flags considerInEdges and considerOutEdges must be true.
+ * @param {yfiles.algorithms.Graph} graph the input graph.
+ * @param {yfiles.algorithms.INodeMap} centrality return value. A map which provides the degree centrality as double value for every node.
+ */
+ degreeCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,considerInEdges:boolean,considerOutEdges:boolean):void;
+ /**
+ * Computes the weight centrality for the nodes of a graph.
+ * Weight centrality measures the weight associated with incoming, outgoing, or
+ * all edges of a node.
+ * Note that weight centrality degenerates to degree centrality when the edges
+ * have uniform weight.
+ * In particular, when parameter 'edgeWeights' is null then
+ * {@link yfiles.algorithms.Centrality#degreeCentrality degreeCentrality}
+ * is invoked instead.
+ * Complexity: O(graph.E())
+ * @param {yfiles.algorithms.Graph} graph The input graph.
+ * @param {yfiles.algorithms.INodeMap} centrality
+ * Return value.
+ * A map which provides the value centrality as double value for
+ * every node.
+ * @param {boolean} considerInEdges Whether the weights associated with incoming edges should be considered.
+ * @param {boolean} considerOutEdges Whether the weights associated with outgoing edges should be considered.
+ * @param {yfiles.algorithms.IDataProvider} edgeWeights
+ * When null, the edges of the graph are considered to have uniform
+ * weight of 1.0.
+ * Otherwise it must provide a non-negative double value (the weight)
+ * for every edge.
+ */
+ weightCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,considerInEdges:boolean,considerOutEdges:boolean,edgeWeights:yfiles.algorithms.IDataProvider):void;
+ /**
+ * This method normalizes the double values of a node map by dividing all values by the maximum of all values (maximum norm).
+ * Note, if the maximum value is Double.POSITIVE_INFINITY, all values other than Double.POSITIVE_INFINITY
+ * are set to 0.
+ * Precondition: for each node n: map.getDouble(n) >= 0
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.INodeMap} map return value that holds double values between zero and one.
+ */
+ normalizeNodeMap(graph:yfiles.algorithms.Graph,map:yfiles.algorithms.INodeMap):void;
+ /**
+ * Like {@link yfiles.algorithms.Centrality#normalizeNodeMap}, but for EdgeMap.
+ * Precondition: for each edge e: map.getDouble(e) >= 0
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.IEdgeMap} map return value that holds double values between zero and one.
+ */
+ normalizeEdgeMap(graph:yfiles.algorithms.Graph,map:yfiles.algorithms.IEdgeMap):void;
+ };
+ /**
+ * Framework class for depth first search (DFS) based algorithms.
+ * To write graph algorithms that are based on a depth first search
+ * one can extend this class and overwrite appropriate callback
+ * methods provided by this class.
+ */
+ export interface Dfs extends Object{
+ /**
+ * NodeMap that indicates the state of the nodes as they
+ * are visited by this algorithm.
+ * Possible states of a node are
+ * {@link yfiles.algorithms.Dfs#WHITE WHITE}, {@link yfiles.algorithms.Dfs#GRAY GRAY} and {@link yfiles.algorithms.Dfs#BLACK BLACK}.
+ */
+ stateMap:yfiles.algorithms.INodeMap;
+ /**
+ * Specifies whether or not to interpret the edges of the graph
+ * as directed.
+ * By default directed mode is disabled.
+ */
+ directedMode:boolean;
+ /**
+ * Specifies whether or not to continue the depth first search
+ * after all nodes reachable from the first node were
+ * visited.
+ * By default look further mode is active.
+ */
+ lookFurtherMode:boolean;
+ /**
+ * Starts a depth first search on the given graph.
+ * The first node in the graph will be visited first.
+ */
+ start(graph:yfiles.algorithms.Graph):void;
+ /**
+ * Starts a depth first search on the given graph.
+ * The given node will be visited first.
+ * If start is null, this method returns silently.
+ */
+ startFromNode(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node):void;
+ /**
+ * Callback method that will be invoked whenever a formerly unvisited node
+ * gets visited the first time.
+ * The given int is the dfs number of that
+ * node.
+ * By default this method does nothing
+ */
+ preVisit(node:yfiles.algorithms.Node,dfsNumber:number):void;
+ /**
+ * Callback method that will be invoked whenever a node visit has
+ * been completed.
+ * The dfs number and the completion number
+ * of the given node will be passed in.
+ * By default this method does nothing
+ */
+ postVisit(node:yfiles.algorithms.Node,dfsNumber:number,compNumber:number):void;
+ /**
+ * Callback method that will be invoked if the given edge
+ * will be looked at in the search the first (and only) time.
+ * The given node is the node that will be visited next iff
+ * treeEdge == true.
+ * By default this method does nothing
+ */
+ preTraverse(edge:yfiles.algorithms.Edge,node:yfiles.algorithms.Node,treeEdge:boolean):void;
+ /**
+ * Callback method that will be invoked after the search returns
+ * from the given node.
+ * The node has been reached via the given edge.
+ * By default this method does nothing.
+ */
+ postTraverse(edge:yfiles.algorithms.Edge,node:yfiles.algorithms.Node):void;
+ /**
+ * Callback method that will be invoked whenever dfs continues
+ * its search at a new root node.
+ * By default this method does nothing
+ */
+ lookFurther(v:yfiles.algorithms.Node):void;
+ /**
+ * Subclasses can call this method to cancel the dfs.
+ */
+ cancel():void;
+ }
+ var Dfs:{
+ $class:yfiles.lang.Class;
+ /**
+ * Node state specifier.
+ * Indicates that a node was not yet visited.
+ */
+ WHITE:Object;
+ /**
+ * Node state specifier.
+ * Indicates that a node was already visited but
+ * has not been completed yet, i.e. it is still part of an active
+ * path of the dfs tree.
+ */
+ GRAY:Object;
+ /**
+ * Node state specifier.
+ * Indicates that the node has been completed,
+ * i.e. it has been visited before and is not part of an active
+ * path in the dfs tree anymore.
+ */
+ BLACK:Object;
+ /**
+ * Instantiates a new Dfs object.
+ */
+ new ():yfiles.algorithms.Dfs;
+ };
+ /**
+ * Responsible for finding cycles within a graph that have certain properties.
+ */
+ export interface Cycles extends Object{
+ }
+ var Cycles:{
+ $class:yfiles.lang.Class;
+ /**
+ * This method marks edges of a given graph whose removal or reversal would make
+ * that graph acyclic.
+ * This method tries to minimize the number of marked edges
+ * for that task heuristically, since it is a well known hard problem to come up
+ * with an optimal solution.
+ * Complexity: O(graph.E()+graph.N()*log(graph.E()))
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.IEdgeMap} cycleEdges
+ * return value. cycleEdge.getBool(e) == true iff
+ * e is a detected cycle edge.
+ */
+ findCycleEdges(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap):void;
+ /**
+ * This method is similar to {@link yfiles.algorithms.Cycles#findCycleEdges}, but instead of minimizing the
+ * number of marked edges it tries to find a set of marked edges, for which the associated
+ * cost is minimal.
+ * In case each edge has cost 1.0 the result will be
+ * the same as the one returned by {@link yfiles.algorithms.Cycles#findCycleEdges}.
+ * Complexity: O(graph.E()+graph.N()*log(graph.E()))
+ * @param {yfiles.algorithms.IDataProvider} costDP
+ * data provider that yields the reversal cost for each edge. The reversal cost
+ * for each edge must be a non-negative value of type double.
+ */
+ findCycleEdgesWithCost(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap,costDP:yfiles.algorithms.IDataProvider):void;
+ /**
+ * Like {@link yfiles.algorithms.Cycles#findCycleEdges} this method marks
+ * edges of a given graph whose removal or reversal would make
+ * that graph acyclic.
+ * The implementation of this method is
+ * based on a Depth First Search. The number of marked cycle edges
+ * is expected to be slightly larger than when using
+ * {@link yfiles.algorithms.Cycles#findCycleEdges}. The advantage of this method
+ * is that the result set is more stable when edges get added or removed
+ * over the time.
+ * Complexity: O(graph.E()+graph.N())
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {yfiles.algorithms.IEdgeMap} cycleEdges
+ * return value. cycleEdge.getBool(e) == true iff
+ * e is a detected cycle edge.
+ */
+ findCycleEdgesDFS(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap):void;
+ /**
+ * Returns an edge list that contains the edges of a cycle
+ * found in the given graph.
+ * The edges are returned in the
+ * order they appear in the found cycle.
+ * If the returned cycle is empty then no cycle has been
+ * found in the given graph.
+ * Complexity: O(graph.N()+graph.E())
+ */
+ findCycle(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList;
+ /**
+ * Returns all edges that are part of at least one directed or undirected
+ * simple cycle.
+ * A simple cycle is a closed edge path without repeating edges.
+ * Moreover, selfloops are always considered to be cycle edges.
+ * @param {yfiles.algorithms.Graph} graph the input graph
+ * @param {boolean} directed whether or not to look for edges on directed cycles
+ * @return {yfiles.algorithms.EdgeList} all edges that belong to a cycle
+ */
+ findAllCycleEdges(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList;
+ };
+ /**
+ * Extension method holder class with utility conversion methods for geometry structs
+ * like {@link yfiles.geometry.PointD} and {@link yfiles.geometry.RectD}.
+ */
+ export interface GeomExtensions extends Object{
+ }
+ var GeomExtensions:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a {@link yfiles.geometry.RectD} from a given {@link yfiles.algorithms.Rectangle2D}.
+ * @param {yfiles.algorithms.Rectangle2D} rect The {@link yfiles.algorithms.Rectangle2D}.
+ * @return {yfiles.geometry.RectD} The {@link yfiles.geometry.RectD}.
+ */
+ toRectDFromRectangle2D(rect:yfiles.algorithms.Rectangle2D):yfiles.geometry.RectD;
+ /**
+ * Creates a {@link yfiles.geometry.RectD} from a given {@link yfiles.algorithms.Rectangle}.
+ * @param {yfiles.algorithms.Rectangle} rect The {@link yfiles.algorithms.Rectangle}.
+ * @return {yfiles.geometry.RectD} The {@link yfiles.geometry.RectD}.
+ */
+ toRectDFromRectangle(rect:yfiles.algorithms.Rectangle):yfiles.geometry.RectD;
+ /**
+ * Creates a {@link yfiles.geometry.RectD} from a given {@link yfiles.algorithms.YRectangle}.
+ * @param {yfiles.algorithms.YRectangle} rect The {@link yfiles.algorithms.YRectangle}.
+ * @return {yfiles.geometry.RectD} The {@link yfiles.geometry.RectD}.
+ */
+ toRectD(rect:yfiles.algorithms.YRectangle):yfiles.geometry.RectD;
+ /**
+ * Creates a {@link yfiles.geometry.InsetsD} from a given {@link yfiles.algorithms.Insets}.
+ * @param {yfiles.algorithms.Insets} insets The {@link yfiles.algorithms.Insets}.
+ * @return {yfiles.geometry.InsetsD} The {@link yfiles.geometry.InsetsD}.
+ */
+ toInsetsD(insets:yfiles.algorithms.Insets):yfiles.geometry.InsetsD;
+ /**
+ * Creates a {@link yfiles.geometry.SizeD} from a given {@link yfiles.algorithms.YDimension}.
+ * @param {yfiles.algorithms.YDimension} dimension The {@link yfiles.algorithms.YDimension}.
+ * @return {yfiles.geometry.SizeD} The {@link yfiles.geometry.SizeD}.
+ */
+ toSizeD(dimension:yfiles.algorithms.YDimension):yfiles.geometry.SizeD;
+ /**
+ * Creates a {@link yfiles.geometry.PointD} from a given {@link yfiles.algorithms.Point2D}.
+ * @param {yfiles.algorithms.Point2D} point The {@link yfiles.algorithms.Point2D}.
+ * @return {yfiles.geometry.PointD} The {@link yfiles.geometry.PointD}.
+ */
+ toPointDFromPoint2D(point:yfiles.algorithms.Point2D):yfiles.geometry.PointD;
+ /**
+ * Creates a {@link yfiles.geometry.PointD} from a given {@link yfiles.algorithms.YPoint}.
+ * @param {yfiles.algorithms.YPoint} point The {@link yfiles.algorithms.YPoint}.
+ * @return {yfiles.geometry.PointD} The {@link yfiles.geometry.PointD}.
+ */
+ toPointD(point:yfiles.algorithms.YPoint):yfiles.geometry.PointD;
+ /**
+ * Creates a {@link yfiles.geometry.PointD} from a given {@link yfiles.algorithms.YVector}.
+ * @param {yfiles.algorithms.YVector} point The {@link yfiles.algorithms.YVector}.
+ * @return {yfiles.geometry.PointD} The {@link yfiles.geometry.PointD}.
+ */
+ toPointDFromVector(point:yfiles.algorithms.YVector):yfiles.geometry.PointD;
+ /**
+ * Creates a {@link yfiles.algorithms.Rectangle2D.Double Rectangle2D.Double} from a given {@link yfiles.geometry.RectD}.
+ * @param {yfiles.geometry.RectD} rect The {@link yfiles.geometry.RectD}.
+ * @return {yfiles.algorithms.Rectangle2D.Double} The {@link yfiles.algorithms.Rectangle2D.Double Rectangle2D.Double}.
+ */
+ toRectangle2D(rect:yfiles.geometry.RectD):yfiles.algorithms.Rectangle2D.Double;
+ /**
+ * Creates a {@link yfiles.algorithms.Rectangle} from a given {@link yfiles.geometry.RectD}.
+ * @param {yfiles.geometry.RectD} rect The {@link yfiles.geometry.RectD}.
+ * @return {yfiles.algorithms.Rectangle} The {@link yfiles.algorithms.Rectangle}.
+ */
+ toRectangle(rect:yfiles.geometry.RectD):yfiles.algorithms.Rectangle;
+ /**
+ * Creates a {@link yfiles.algorithms.YOrientedRectangle} from a given {@link yfiles.geometry.IOrientedRectangle}.
+ * @param {yfiles.geometry.IOrientedRectangle} rect The {@link yfiles.geometry.RectD}.
+ * @return {yfiles.algorithms.YOrientedRectangle} The {@link yfiles.algorithms.YOrientedRectangle}.
+ */
+ toOrientedRectangle(rect:yfiles.geometry.IOrientedRectangle):yfiles.algorithms.YOrientedRectangle;
+ /**
+ * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} from a given {@link yfiles.algorithms.YOrientedRectangle}.
+ * @param {yfiles.algorithms.YOrientedRectangle} rect The {@link yfiles.algorithms.YOrientedRectangle}.
+ * @return {yfiles.geometry.IOrientedRectangle} The {@link yfiles.geometry.IOrientedRectangle}.
+ */
+ toImmutableOrientedRectangle(rect:yfiles.algorithms.YOrientedRectangle):yfiles.geometry.IOrientedRectangle;
+ /**
+ * Creates a {@link yfiles.algorithms.YRectangle} from a given {@link yfiles.geometry.RectD}.
+ * @param {yfiles.geometry.RectD} rect The {@link yfiles.geometry.RectD}.
+ * @return {yfiles.algorithms.YRectangle} The {@link yfiles.algorithms.YRectangle}.
+ */
+ toYRectangle(rect:yfiles.geometry.RectD):yfiles.algorithms.YRectangle;
+ /**
+ * Creates a {@link yfiles.algorithms.YDimension} from a given {@link yfiles.geometry.SizeD}.
+ * @param {yfiles.geometry.SizeD} sizeD The {@link yfiles.geometry.SizeD}.
+ * @return {yfiles.algorithms.YDimension} The {@link yfiles.algorithms.YDimension}.
+ */
+ toYDimension(sizeD:yfiles.geometry.SizeD):yfiles.algorithms.YDimension;
+ /**
+ * Creates a {@link yfiles.algorithms.Insets} from a given {@link yfiles.geometry.InsetsD}.
+ * @param {yfiles.geometry.InsetsD} insetsD The {@link yfiles.geometry.InsetsD}.
+ * @return {yfiles.algorithms.Insets} The {@link yfiles.geometry.InsetsD}.
+ */
+ toInsets(insetsD:yfiles.geometry.InsetsD):yfiles.algorithms.Insets;
+ /**
+ * Creates a {@link yfiles.algorithms.YPoint} from a given {@link yfiles.geometry.PointD}.
+ * @param {yfiles.geometry.PointD} point The {@link yfiles.geometry.PointD}.
+ * @return {yfiles.algorithms.YPoint} The {@link yfiles.algorithms.YPoint}.
+ */
+ toYPoint(point:yfiles.geometry.PointD):yfiles.algorithms.YPoint;
+ /**
+ * Creates a {@link yfiles.algorithms.Point2D.Double} from a given {@link yfiles.geometry.PointD}.
+ * @param {yfiles.geometry.PointD} point The {@link yfiles.geometry.PointD}.
+ * @return {yfiles.algorithms.Point2D.Double} The {@link yfiles.algorithms.Point2D.Double}.
+ */
+ toPoint2D(point:yfiles.geometry.PointD):yfiles.algorithms.Point2D.Double;
+ /**
+ * Creates a {@link yfiles.algorithms.YVector} from a given {@link yfiles.geometry.PointD}.
+ * @param {yfiles.geometry.PointD} point The {@link yfiles.geometry.PointD}.
+ * @return {yfiles.algorithms.YVector} The {@link yfiles.algorithms.YVector}.
+ */
+ toYVector(point:yfiles.geometry.PointD):yfiles.algorithms.YVector;
+ };
+ /**
+ * A factory class that creates instances of the classes implementing
+ * {@link yfiles.algorithms.IMap}.
+ */
+ export interface MapFactory extends Object{
+ }
+ var MapFactory:{
+ $class:yfiles.lang.Class;
+ /**
+ * Creates a new {@link yfiles.algorithms.HashMap}.
+ * @return {yfiles.algorithms.IMap}
+ * a new instance of {@link yfiles.algorithms.HashMap}.
+ */
+ createHashMap():yfiles.algorithms.IMap;
+ /**
+ * Creates a new {@link yfiles.algorithms.HashMap} with the contents of the specified
+ * {@link yfiles.algorithms.IMap}.
+ * @return {yfiles.algorithms.IMap}
+ * a new instance of {@link yfiles.algorithms.HashMap}.
+ */
+ createHashMapFromMap(m:yfiles.algorithms.IMap):yfiles.algorithms.IMap;
+ /**
+ * Creates a new {@link yfiles.algorithms.TreeMap}.
+ * @return {yfiles.algorithms.IMap}
+ * a new instance of {@link yfiles.algorithms.TreeMap}.
+ */
+ createTreeMap():yfiles.algorithms.IMap;
+ /**
+ * Creates a new {@link yfiles.algorithms.TreeMap} with the contents of the specified
+ * {@link yfiles.algorithms.IMap}.
+ * @return {yfiles.algorithms.IMap}
+ * a new instance of {@link yfiles.algorithms.TreeMap}.
+ */
+ createTreeMapFromMap(m:yfiles.algorithms.IMap):yfiles.algorithms.IMap;
+ /**
+ * Creates a new {@link yfiles.algorithms.TreeMap} with the specified
+ * {@link yfiles.objectcollections.IComparer}.
+ * @return {yfiles.algorithms.IMap}
+ * a new instance of {@link yfiles.algorithms.TreeMap}.
+ */
+ createTreeMapWithComparator(comparator:yfiles.objectcollections.IComparer):yfiles.algorithms.IMap;
+ };
+ /**
+ * This class provides methods to generate pseudo-random numbers.
+ */
+ export interface Random extends Object{
+ /**
+ * Returns a pseudo-random uniformly distributed integer value of
+ * the number of bits specified by the argument bits.
+ * @param {number} bits The number of bits of the returned value.
+ * @return {number} A random integer.
+ */
+ next(bits:number):number;
+ /**
+ * Returns the next pseudo-random uniformly distributed boolean value.
+ * @return {boolean} A random boolean value.
+ */
+ nextBoolean():boolean;
+ /**
+ * Returns the next pseudo-random uniformly distributed random number between 0.0
+ * inclusively and 1.0 exclusively.
+ * @return {number} A random number between 0.0 and 1.0.
+ * @see {@link yfiles.algorithms.Random#nextFloat}
+ */
+ nextDouble():number;
+ /**
+ * Returns the next pseudo-random uniformly distributed random number between 0.0
+ * inclusively and 1.0 exclusively.
+ * @return {number} A random number between 0.0 and 1.0.
+ * @see {@link yfiles.algorithms.Random#nextDouble}
+ */
+ nextFloat():number;
+ /**
+ * Returns the next pseudo-random normally distributed
+ * number with mean 0.0 and a standard deviation value
+ * of 1.0.
+ * Implements G. E. P. Box, M. E. Muller, and G. Marsaglia's polar method
+ * found in The Art of Computer Programming, Volume 2: Seminumerical
+ * Algorithms, by Donald E. Knuth (section 3.4.1).
+ * @return {number} A random, normally distributed number.
+ * @see {@link yfiles.algorithms.Random#nextDouble}
+ */
+ nextGaussian():number;
+ /**
+ * Returns the next pseudo-random uniformly distributed integer.
+ * @return {number} A random integer.
+ * @see {@link yfiles.algorithms.Random#nextIntInRange}
+ * @see {@link yfiles.algorithms.Random#nextLong}
+ */
+ nextInt():number;
+ /**
+ * Returns the next pseudo-random uniformly distributed integer
+ * between 0 (inclusively) and n (exclusively).
+ * @param {number} n The upper limit of the returned random integer.
+ * @return {number} A random integer between 0 and n
+ */
+ nextIntInRange(n:number):number;
+ nextIntImpl():number;
+ nextIntInRangeImpl(max:number):number;
+ /**
+ * Returns the next pseudo-random uniformly distributed integer.
+ * @return {number} A random integer.
+ * @see {@link yfiles.algorithms.Random#nextInt}
+ * @see {@link yfiles.algorithms.Random#nextIntInRange}
+ */
+ nextLong():number;
+ /**
+ * The seed of this random number generator.
+ */
+ seed:number;
+ }
+ var Random:{
+ $class:yfiles.lang.Class;
+ /**
+ * Constructs a random generator with a seed based on the current time of day.
+ * @see {@link yfiles.algorithms.Random#seed}
+ */
+ new ():yfiles.algorithms.Random;
+ /**
+ * Construct a random generator with the given seed.
+ * @param {number} seed
+ * The seed of this random number generator.
+ * @see {@link yfiles.algorithms.Random#seed}
+ */
+ WithSeed:{
+ new (seed:number):yfiles.algorithms.Random;
+ };
+ };
+ /**
+ * An implementation of a doubly linked list that provides direct access to the
+ * cells that store the elements.
+ * The cells are represented by class {@link yfiles.algorithms.ListCell}.
+ * This class supports fast access and removal operations, specifically, it is possible
+ * to remove an element in constant time (i.e. O(1)) given a reference to its list
+ * cell.
+ * Class YList supports iteration over the elements either by using the list cells
+ * directly (methods {@link yfiles.algorithms.YList#firstCell}/{@link yfiles.algorithms.YList#lastCell} together with
+ * {@link yfiles.algorithms.YList#succCell}/{@link yfiles.algorithms.YList#predCell}, respectively) or by
+ * means of a cursor ({@link yfiles.algorithms.YList#cursor}).
+ * Furthermore, YList offers its own {@link yfiles.algorithms.YList#sort} method.
+ * Note that this class also provides all relevant methods to use the list like
+ * a stack data type.
+ * This implementation permits null as values.
+ * It implements the {@link yfiles.algorithms.IList} interface but does not support the
+ * {@link yfiles.algorithms.YList#subList} method. The implementation of this method will throw an
+ * {@link yfiles.system.NotSupportedException} if invoked.
+ * The {@link yfiles.algorithms.YList#iterator}s returned by instances of this class are fail fast, however
+ * the {@link yfiles.algorithms.YList#cursor} implementation is not.
+ */
+ export interface YList extends Object,yfiles.algorithms.ICollection,yfiles.algorithms.IList{
+ /**
+ * Inserts the given object at the head of this list.
+ * @return {yfiles.algorithms.ListCell} The newly created ListCell object that stores the given object.
+ */
+ addFirst(o:Object):yfiles.algorithms.ListCell;
+ /**
+ * Inserts the given object at the tail of this list.
+ * @return {yfiles.algorithms.ListCell} The newly created ListCell object that stores the given object.
+ */
+ addLast(o:Object):yfiles.algorithms.ListCell;
+ /**
+ * Adds a formerly removed ListCell object at the tail of this list.
+ * Attention: If the ListCell object is still part of any list, then that
+ * list will be corrupted afterwards.
+ * @param {yfiles.algorithms.ListCell} cell A list cell which is not part of any list.
+ */
+ addLastCell(cell:yfiles.algorithms.ListCell):void;
+ /**
+ * Adds a formerly removed ListCell object at the head of this list.
+ * Attention: If the ListCell object is still part of any list, then that
+ * list will be corrupted afterwards.
+ * @param {yfiles.algorithms.ListCell} cell A list cell which is not part of any list.
+ */
+ addFirstCell(cell:yfiles.algorithms.ListCell):void;
+ /**
+ * Same as {@link yfiles.algorithms.YList#addLast}.
+ * @return {boolean} true
+ * @see Specified by {@link yfiles.algorithms.ICollection#addObject}.
+ */
+ addObject(o:Object):boolean;
+ /**
+ * Appends all elements provided by the given collection to this list.
+ * @return {boolean} Whether there have been elements appended.
+ * @see Specified by {@link yfiles.algorithms.ICollection#addAll}.
+ */
+ addAll(collection:yfiles.algorithms.ICollection):boolean;
+ /**
+ * Appends all elements provided by the given cursor to this list.
+ * The cursor will be moved from its given position to the end.
+ * Be aware that a statement like aList.append(aList.cursor()) results
+ * in an infinite recursion.
+ */
+ addAllFromCursor(c:yfiles.algorithms.ICursor):void;
+ /**
+ * Inserts the given object into this list with respect to a given reference list
+ * cell.
+ * The (newly created) list cell that stores the object is inserted right before
+ * the reference list cell refCell.
+ * If refCell == null, the given object is appended to the list.
+ * Precondition:refCell must be part of this list.
+ * @param {Object} o The object to be inserted.
+ * @param {yfiles.algorithms.ListCell} refCell The list cell used to reference the position.
+ * @return {yfiles.algorithms.ListCell} The newly created ListCell object that stores object o.
+ */
+ insertBefore(o:Object,refCell:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell;
+ /**
+ * Inserts a formerly removed ListCell object into this list with respect to a
+ * given reference list cell.
+ * The ListCell object is inserted right before the reference list cell refCell.
+ * Attention: If the ListCell object is still part of any list, then that
+ * list will be corrupted afterwards.
+ * Precondition:refCell must be part of this list.
+ * @param {yfiles.algorithms.ListCell} cellToInsert A list cell which is not part of any list.
+ * @param {yfiles.algorithms.ListCell} refCell The list cell used to reference the position.
+ */
+ insertCellBefore(cellToInsert:yfiles.algorithms.ListCell,refCell:yfiles.algorithms.ListCell):void;
+ /**
+ * Inserts a formerly removed ListCell object into this list with respect to a
+ * given reference list cell.
+ * The ListCell object is inserted right after the reference list cell refCell.
+ * Attention: If the ListCell object is still part of any list, then that
+ * list will be corrupted afterwards.
+ * Precondition:refCell must be part of this list.
+ * @param {yfiles.algorithms.ListCell} cellToInsert A list cell which is not part of any list.
+ * @param {yfiles.algorithms.ListCell} refCell The list cell used to reference the position.
+ */
+ insertCellAfter(cellToInsert:yfiles.algorithms.ListCell,refCell:yfiles.algorithms.ListCell):void;
+ /**
+ * Inserts the given object into this list with respect to a given reference list
+ * cell.
+ * The (newly created) list cell that stores the object is inserted right after
+ * the reference list cell refCell.
+ * If refCell == null, the given object is inserted at the head of
+ * the list.
+ * Precondition:refCell must be part of this list.
+ * @param {Object} o The object to be inserted.
+ * @param {yfiles.algorithms.ListCell} refCell The list cell used to reference the position.
+ * @return {yfiles.algorithms.ListCell} The newly created ListCell object that stores object o.
+ */
+ insertAfter(o:Object,refCell:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell;
+ /**
+ * The number of elements in this list.
+ * @see Specified by {@link yfiles.algorithms.ICollection#count}.
+ */
+ count:number;
+ /**
+ * Checks whether this list contains elements.
+ * @see Specified by {@link yfiles.algorithms.ICollection#empty}.
+ */
+ empty:boolean;
+ /**
+ * Removes all elements from this list.
+ * @see Specified by {@link yfiles.algorithms.ICollection#clear}.
+ */
+ clear():void;
+ /**
+ * The first element of this list.
+ * Precondition:!isEmpty().
+ */
+ first:Object;
+ /**
+ * Removes the first element from this list and returns it.
+ */
+ pop():Object;
+ /**
+ * Equivalent to {@link yfiles.algorithms.YList#addFirst}.
+ */
+ push(o:Object):yfiles.algorithms.ListCell;
+ /**
+ * Equivalent to {@link yfiles.algorithms.YList#first}.
+ */
+ peek():Object;
+ /**
+ * The last element of this list.
+ * Precondition:!isEmpty().
+ */
+ last:Object;
+ /**
+ * Removes the last element from this list and returns it.
+ */
+ popLast():Object;
+ /**
+ * Returns the i-th element of this list.
+ * Precondition:i is a valid index, i.e., i >= 0 && i < size().
+ */
+ elementAt(i:number):Object;
+ /**
+ * Returns the zero-based index of the given element in this list.
+ * If the given element is not in the list, -1 is returned.
+ * @see Specified by {@link yfiles.algorithms.IList#indexOf}.
+ */
+ indexOf(obj:Object):number;
+ /**
+ * The first cell of this list.
+ * Precondition:!isEmpty().
+ */
+ firstCell:yfiles.algorithms.ListCell;
+ /**
+ * The last cell of this list.
+ * Precondition:!isEmpty().
+ */
+ lastCell:yfiles.algorithms.ListCell;
+ /**
+ * Returns the successor cell of the given list cell.
+ */
+ succCell(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell;
+ /**
+ * Returns the predecessor cell of the given list cell.
+ */
+ predCell(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell;
+ /**
+ * Returns the cyclic successor cell of the given list cell.
+ * The first cell is returned as the cyclic successor of the last list cell.
+ */
+ cyclicSucc(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell;
+ /**
+ * Returns the cyclic predecessor cell of the given list cell.
+ * The last cell is returned as the cyclic predecessor of the first list cell.
+ */
+ cyclicPred(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell;
+ /**
+ * Returns the element stored in the given list cell.
+ */
+ getInfo(c:yfiles.algorithms.ListCell):Object;
+ /**
+ * Updates the element stored in the given list cell with the given object.
+ */
+ setInfo(c:yfiles.algorithms.ListCell,value:Object):void;
+ /**
+ * Removes the given object from this list.
+ * Only the first element for which equality to o holds gets removed.
+ * Complexity: O(size())
+ * @see Specified by {@link yfiles.algorithms.ICollection#remove}.
+ */
+ remove(o:Object):boolean;
+ /**
+ * Removes the given collection of objects from this list.
+ * @return {boolean} Whether there have been elements removed.
+ * @see Specified by {@link yfiles.algorithms.ICollection#removeAll}.
+ */
+ removeAll(collection:yfiles.algorithms.ICollection):boolean;
+ /**
+ * Retains only those elements in this list which are contained in the given collection.
+ * Complexity:
+ * This operation has running time O(max(m, n)), were m and n are the sizes of
+ * this list and the given collection, respectively.
+ * @return {boolean} Whether there have been elements removed.
+ * @see Specified by {@link yfiles.algorithms.ICollection#retainAll}.
+ */
+ retainAll(collection:yfiles.algorithms.ICollection):boolean;
+ /**
+ * Removes the given list cell, and hence the element stored in it, from this
+ * list.
+ * Complexity: O(1)
+ * Precondition: The given list cell is part of this list.
+ * @return {Object} The element that is stored in the removed cell.
+ */
+ removeCell(c:yfiles.algorithms.ListCell):Object;
+ /**
+ * Removes the element pointed to by the given YCursor object.
+ * Precondition:
+ * The given cursor has been created by a call to this list's {@link yfiles.algorithms.YList#cursor}
+ * method and the element pointed to by it is contained in this list.
+ * @return {Object} The removed element.
+ */
+ removeItemPointedToByCursor(c:yfiles.algorithms.ICursor):Object;
+ /**
+ * Returns a cursor for this list.
+ * All cursor operations are supported.
+ * This cursor implementation is not fail-fast and continues to work
+ * if this list is modified during the traversal as long as the current
+ * ListCell the cursor points at is this in this list or has been removed
+ * from this list
+ * but has not been added to another instance since then.
+ */
+ cursor():yfiles.algorithms.ICursor;
+ /**
+ * Returns an iterator for that list.
+ * The remove operation is supported on the iterator. This iterator instance
+ * is fail-fast.
+ * @see Specified by {@link yfiles.algorithms.ICollection#iterator}.
+ */
+ iterator():yfiles.algorithms.IIterator;
+ /**
+ * Returns a list iterator that can be used to iterate over all items of this list
+ * in correct order.
+ * @return {yfiles.algorithms.IListIterator} a list iterator that iterates over the items of this list.
+ * @see Specified by {@link yfiles.algorithms.IList#listIterator}.
+ */
+ listIterator():yfiles.algorithms.IListIterator;
+ /**
+ * Whether or not this list contains the given element.
+ * Equality of elements is defined by the {@link Object#equals} method.
+ * @see Specified by {@link yfiles.algorithms.ICollection#contains}.
+ */
+ contains(o:Object):boolean;
+ /**
+ * Whether or not this list contains all the elements in the given collection.
+ * Equality of elements is defined by the {@link Object#equals} method.
+ * @see Specified by {@link yfiles.algorithms.ICollection#containsAll}.
+ */
+ containsAll(collection:yfiles.algorithms.ICollection):boolean;
+ /**
+ * Returns the {@link yfiles.algorithms.ListCell} where object o is stored.
+ * This operation returns null, if no such cell exists.
+ * Equality of elements is defined by the {@link Object#equals} method.
+ * The first element in the list that matches that criteria is returned.
+ * @return {yfiles.algorithms.ListCell}
+ * the ListCell that contains the element or null if no
+ * such ListCell was found
+ */
+ findCell(o:Object):yfiles.algorithms.ListCell;
+ /**
+ * Returns a string representation of this List.
+ */
+ toString():string;
+ /**
+ * Returns an array representation of this list.
+ * @see Specified by {@link yfiles.algorithms.ICollection#toArray}.
+ */
+ toArray():Object[];
+ /**
+ * Returns an array containing all list elements in the correct order.
+ * The runtime type of the returned array is that of the given array.
+ * If the list does not fit in the specified array, a new array is allocated with
+ * the runtime type of the specified array and the size of this list.
+ * If the list fits in the specified array with room to spare (i.e., the array
+ * has more elements than the list), the element in the array immediately following
+ * the end of the collection is set to null.
+ * This is useful in determining the length of the list only if the caller
+ * knows that the list does not contain any null elements.
+ * @param {Object} a
+ * The array into which the elements of the list are to be stored, if it is big
+ * enough.
+ * Otherwise, a new array of the same runtime type is allocated for this purpose.
+ * @return {Object} An array containing the elements of the list.
+ * @see Specified by {@link yfiles.algorithms.ICollection#toGivenArray}.
+ */
+ toGivenArray(a:Object):Object;
+ /**
+ * Reverses the sequence of elements in this list.
+ */
+ reverse():void;
+ /**
+ * Sorts the elements in this list according to the given comparator.
+ * NOTE: The elements will be assigned to different list cells by this method.
+ * Complexity: O(size() * log(size()))
+ */
+ sortWithComparer(comp:yfiles.objectcollections.IComparer):void;
+ /**
+ * Sorts the elements in this list into ascending order, according to their natural
+ * ordering.
+ * All elements must implement the {@link yfiles.lang.IObjectComparable} interface.
+ * Furthermore, all elements in this list must be mutually comparable (that is,
+ * e1.compareTo(e2) must not throw a ClassCastException for any elements
+ * e1 and e2 in this list).
+ * NOTE: The elements will be assigned to different list cells by this method.
+ * Complexity: O(size() * log(size()))
+ */
+ sort():void;
+ /**
+ * Transfers the contents of the given list to the end of this list.
+ * The given list will be empty after this operation.
+ * Note that this operation transfers the list cells of the given list to this
+ * list.
+ * No new list cells are created by this operation.
+ * Complexity: O(1)
+ */
+ splice(list:yfiles.algorithms.YList):void;
+ /**
+ * Adds all items of the given collection at the specified index.
+ *
+ * All subsequent items are shifted to the right by the number of items added.
+ *
+ * @param {number} index the index at which to insert the items.
+ * @param {yfiles.algorithms.ICollection} c the collection whose items will be added.
+ * @return {boolean} true if this list has been modified due to the call of this method.
+ * @see Specified by {@link yfiles.algorithms.IList#addAllAt}.
+ */
+ addAllAt(index:number,c:yfiles.algorithms.ICollection):boolean;
+ /**
+ * Gets the cell at the given index.
+ * @param {number} index the zero-based index of the cell in this list.
+ * @return {yfiles.algorithms.ListCell} The cell.
+ * @throws {yfiles.system.IndexOutOfRangeException}
+ * if the index is negative or greater or equal than the {@link yfiles.algorithms.YList#count}
+ */
+ getCell(index:number):yfiles.algorithms.ListCell;
+ /**
+ * Returns the index of the last occurrence of the specified item in this list,
+ * or -1 if the list does not contain the object.
+ * @param {Object} o the item whose last index is being returned.
+ * @return {number} the index of last occurrence of the specified item, or -1.
+ * @see Specified by {@link yfiles.algorithms.IList#lastIndexOf}.
+ */
+ lastIndexOf(o:Object):number;
+ /**
+ * Replaces the item at the specified index with the given item.
+ * @param {number} index the index at which to replace the item.
+ * @param {Object} item the item which should be set at the specified index.
+ * @return {Object} the item that was previously at the specified index.
+ * @see Specified by {@link yfiles.algorithms.IList#setAtListIndex}.
+ */
+ setAtListIndex(index:number,element:Object):Object;
+ /**
+ * Removes the object at the specified index.
+ *
+ * All subsequent list items are shifted to the left by one step.
+ *
+ * @param {number} index the index of the item to be removed.
+ * @return {Object} the object previously at the specified position
+ * @see Specified by {@link yfiles.algorithms.IList#removeAtIndex}.
+ */
+ removeAtIndex(index:number):Object;
+ /**
+ * Returns a list iterator that can be used to iterate over all items of this list
+ * in correct order.
+ * The iteration starts at the specified index.
+ * @param {number} index the index at which to start the iteration.
+ * @return {yfiles.algorithms.IListIterator}
+ * a list iterator that iterates over the items of this list, starting at the
+ * specified index.
+ * @see Specified by {@link yfiles.algorithms.IList#listIteratorFrom}.
+ */
+ listIteratorFrom(index:number):yfiles.algorithms.IListIterator;
+ /**
+ * Returns the item at the specified index.
+ * @param {number} index the index of the item that is retrieved.
+ * @return {Object} the item at the specified index.
+ * @see Specified by {@link yfiles.algorithms.IList#getAtListIndex}.
+ */
+ getAtListIndex(index:number):Object;
+ /**
+ * Adds the given object to the collection at the specified index.
+ *
+ * All subsequent items are shifted to the right one step.
+ *
+ * @param {number} index the index at which to insert the item
+ * @param {Object} item the item to insert
+ * @see Specified by {@link yfiles.algorithms.IList#addAt}.
+ */
+ addAt(index:number,element:Object):void;
+ /**
+ * Returns a list that contains the specified range of items in this list.
+ * @param {number} fromIndex the index of the item that is the first element of the returned list.
+ * @param {number} toIndex
+ * the end index the returned list. The item at this index is not included
+ * in the returned list.
+ * @return {yfiles.algorithms.IList} a list that contains the items of this list in the specified range.
+ * @see Specified by {@link yfiles.algorithms.IList#subList}.
+ */
+ subList(fromIndex:number,toIndex:number):yfiles.algorithms.IList;
+ equals(other:Object):boolean;
+ hashCode():number;
+ getObjectEnumerator():yfiles.objectcollections.IEnumerator;
+ copyTo(array:Object,index:number):void;
+ syncRoot:Object;
+ isSynchronized:boolean;
+ getEnumerator():yfiles.collections.IEnumerator